| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 m_insertionPoint = insertionPoint; | 40 m_insertionPoint = insertionPoint; |
| 41 m_resetStyleInheritance = m_resetStyleInheritance || insertionPoint->re
setStyleInheritance(); | 41 m_resetStyleInheritance = m_resetStyleInheritance || insertionPoint->re
setStyleInheritance(); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 void ParentDetails::didTraverseShadowRoot(const ShadowRoot* root) | 45 void ParentDetails::didTraverseShadowRoot(const ShadowRoot* root) |
| 46 { | 46 { |
| 47 m_resetStyleInheritance = m_resetStyleInheritance || root->resetStyleInheri
tance(); | 47 m_resetStyleInheritance = m_resetStyleInheritance || root->resetStyleInheri
tance(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 ContainerNode* parentSlow(const Node* node, ParentDetails* details) | 50 ContainerNode* parent(const Node* node, ParentDetails* details) |
| 51 { | 51 { |
| 52 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo
undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); | 52 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo
undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); |
| 53 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d
etails)); | 53 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d
etails)); |
| 54 return details->outOfComposition() ? 0 : found; | 54 return details->outOfComposition() ? 0 : found; |
| 55 } | 55 } |
| 56 | 56 |
| 57 Node* nextSiblingSlow(const Node* node) | 57 Node* nextSibling(const Node* node) |
| 58 { | 58 { |
| 59 ComposedShadowTreeWalker walker(node); | 59 ComposedShadowTreeWalker walker(node); |
| 60 if (node->isBeforePseudoElement()) { | 60 if (node->isBeforePseudoElement()) { |
| 61 walker.parent(); | 61 walker.parent(); |
| 62 walker.firstChild(); | 62 walker.firstChild(); |
| 63 } else | 63 } else |
| 64 walker.nextSibling(); | 64 walker.nextSibling(); |
| 65 | 65 |
| 66 if (walker.get() || node->isAfterPseudoElement()) | 66 if (walker.get() || node->isAfterPseudoElement()) |
| 67 return walker.get(); | 67 return walker.get(); |
| 68 | 68 |
| 69 Node* parent = walker.traverseParent(node); | 69 Node* parent = walker.traverseParent(node); |
| 70 if (parent && parent->isElementNode()) | 70 if (parent && parent->isElementNode()) |
| 71 return toElement(parent)->pseudoElement(AFTER); | 71 return toElement(parent)->pseudoElement(AFTER); |
| 72 | 72 |
| 73 return 0; | 73 return 0; |
| 74 } | 74 } |
| 75 | 75 |
| 76 Node* previousSiblingSlow(const Node* node) | 76 Node* previousSibling(const Node* node) |
| 77 { | 77 { |
| 78 ComposedShadowTreeWalker walker(node); | 78 ComposedShadowTreeWalker walker(node); |
| 79 if (node->isAfterPseudoElement()) { | 79 if (node->isAfterPseudoElement()) { |
| 80 walker.parent(); | 80 walker.parent(); |
| 81 walker.lastChild(); | 81 walker.lastChild(); |
| 82 } else | 82 } else |
| 83 walker.previousSibling(); | 83 walker.previousSibling(); |
| 84 | 84 |
| 85 if (walker.get() || node->isBeforePseudoElement()) | 85 if (walker.get() || node->isBeforePseudoElement()) |
| 86 return walker.get(); | 86 return walker.get(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 116 Node* lastChildInScope(const Node* node) | 116 Node* lastChildInScope(const Node* node) |
| 117 { | 117 { |
| 118 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha
dowTreeWalker::DoNotCrossUpperBoundary); | 118 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha
dowTreeWalker::DoNotCrossUpperBoundary); |
| 119 walker.lastChild(); | 119 walker.lastChild(); |
| 120 return walker.get(); | 120 return walker.get(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace | 125 } // namespace |
| OLD | NEW |