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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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* parent(const Node* node, ParentDetails* details) | 50 ContainerNode* parent(const Node* node, ParentDetails* details) |
51 { | 51 { |
| 52 if (ShadowRoot* root = node->containingShadowRoot()) |
| 53 root->host()->ensureDistribution(); |
| 54 |
52 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo
undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); | 55 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo
undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); |
53 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d
etails)); | 56 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d
etails)); |
54 return details->outOfComposition() ? 0 : found; | 57 return details->outOfComposition() ? 0 : found; |
55 } | 58 } |
56 | 59 |
57 Node* nextSibling(const Node* node) | 60 Node* nextSibling(const Node* node) |
58 { | 61 { |
59 ComposedShadowTreeWalker walker(node); | 62 ComposedShadowTreeWalker walker(node); |
60 if (node->isBeforePseudoElement()) { | 63 if (node->isBeforePseudoElement()) { |
61 walker.parent(); | 64 walker.parent(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 Node* lastChildInScope(const Node* node) | 119 Node* lastChildInScope(const Node* node) |
117 { | 120 { |
118 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha
dowTreeWalker::DoNotCrossUpperBoundary); | 121 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha
dowTreeWalker::DoNotCrossUpperBoundary); |
119 walker.lastChild(); | 122 walker.lastChild(); |
120 return walker.get(); | 123 return walker.get(); |
121 } | 124 } |
122 | 125 |
123 } | 126 } |
124 | 127 |
125 } // namespace | 128 } // namespace |
OLD | NEW |