Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/ComposedTreeTraversal.h

Issue 1530643003: Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 static void assertPostcondition(const Node* node) 134 static void assertPostcondition(const Node* node)
135 { 135 {
136 #if ENABLE(ASSERT) 136 #if ENABLE(ASSERT)
137 if (node) 137 if (node)
138 assertPrecondition(*node); 138 assertPrecondition(*node);
139 #endif 139 #endif
140 } 140 }
141 141
142 static Node* resolveDistributionStartingAt(const Node*, TraversalDirection); 142 static Node* resolveDistributionStartingAt(const Node*, TraversalDirection);
143 static Node* v1ResolveDistributionStartingAt(const Node&, TraversalDirection );
144 static Node* v0ResolveDistributionStartingAt(const Node&, TraversalDirection ); 143 static Node* v0ResolveDistributionStartingAt(const Node&, TraversalDirection );
145 144
146 static Node* traverseNext(const Node&); 145 static Node* traverseNext(const Node&);
147 static Node* traverseNext(const Node&, const Node* stayWithin); 146 static Node* traverseNext(const Node&, const Node* stayWithin);
148 static Node* traverseNextSkippingChildren(const Node&, const Node* stayWithi n); 147 static Node* traverseNextSkippingChildren(const Node&, const Node* stayWithi n);
149 static Node* traversePrevious(const Node&); 148 static Node* traversePrevious(const Node&);
150 149
151 static Node* traverseFirstChild(const Node&); 150 static Node* traverseFirstChild(const Node&);
152 static Node* traverseLastChild(const Node&); 151 static Node* traverseLastChild(const Node&);
153 static Node* traverseChild(const Node&, TraversalDirection); 152 static Node* traverseChild(const Node&, TraversalDirection);
154 153
155 static ContainerNode* traverseParent(const Node&, ParentTraversalDetails* = 0); 154 static ContainerNode* traverseParent(const Node&, ParentTraversalDetails* = 0);
156 // TODO(hayato): Make ParentTraversalDetails be aware of slot elements too. 155 // TODO(hayato): Make ParentTraversalDetails be aware of slot elements too.
157 static ContainerNode* v1TraverseParent(const Node&); 156 static ContainerNode* traverseParentForV0(const Node&, ParentTraversalDetai ls* = 0);
158 static ContainerNode* v0TraverseParent(const Node&, ParentTraversalDetails* = 0); 157 static ContainerNode* traverseParentOrHost(const Node&);
159 158
160 static Node* traverseNextSibling(const Node&); 159 static Node* traverseNextSibling(const Node&);
161 static Node* traversePreviousSibling(const Node&); 160 static Node* traversePreviousSibling(const Node&);
162 161
163 static Node* traverseSiblings(const Node&, TraversalDirection); 162 static Node* traverseSiblings(const Node&, TraversalDirection);
164 static Node* v1TraverseSiblings(const Node&, TraversalDirection); 163 static Node* traverseSiblingsForV1HostChild(const Node&, TraversalDirection) ;
165 static Node* v0TraverseSiblings(const Node&, TraversalDirection); 164 static Node* traverseSiblingsForV0Distribution(const Node&, TraversalDirecti on);
166 165
167 static Node* traverseSiblingsOrShadowInsertionPointSiblings(const Node&, Tra versalDirection);
168
169 static ContainerNode* traverseParentOrHost(const Node&);
170 static Node* traverseNextAncestorSibling(const Node&); 166 static Node* traverseNextAncestorSibling(const Node&);
171 static Node* traversePreviousAncestorSibling(const Node&); 167 static Node* traversePreviousAncestorSibling(const Node&);
172 }; 168 };
173 169
174 inline ContainerNode* ComposedTreeTraversal::parent(const Node& node, ParentTrav ersalDetails* details) 170 inline ContainerNode* ComposedTreeTraversal::parent(const Node& node, ParentTrav ersalDetails* details)
175 { 171 {
176 assertPrecondition(node); 172 assertPrecondition(node);
177 ContainerNode* result = traverseParent(node, details); 173 ContainerNode* result = traverseParent(node, details);
178 assertPostcondition(result); 174 assertPostcondition(result);
179 return result; 175 return result;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 305 }
310 306
311 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node) 307 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node)
312 { 308 {
313 return traverseChild(node, TraversalDirectionBackward); 309 return traverseChild(node, TraversalDirectionBackward);
314 } 310 }
315 311
316 } // namespace 312 } // namespace
317 313
318 #endif 314 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/ComposedTreeTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698