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

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

Issue 1308063008: Introduce ComposedTreeTraversal::previousPostOrder() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-09T16:39:28 Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/core/dom/shadow/ComposedTreeTraversal.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Composed tree version of |NodeTraversal::nextSkippingChildren()|. This 75 // Composed tree version of |NodeTraversal::nextSkippingChildren()|. This
76 // function is similar to |next()| but skips child nodes of a specified 76 // function is similar to |next()| but skips child nodes of a specified
77 // node. 77 // node.
78 static Node* nextSkippingChildren(const Node&); 78 static Node* nextSkippingChildren(const Node&);
79 static Node* nextSkippingChildren(const Node&, const Node* stayWithin); 79 static Node* nextSkippingChildren(const Node&, const Node* stayWithin);
80 80
81 // Composed tree version of |NodeTraversal::previousSkippingChildren()| 81 // Composed tree version of |NodeTraversal::previousSkippingChildren()|
82 // similar to |previous()| but skipping child nodes of the specified node. 82 // similar to |previous()| but skipping child nodes of the specified node.
83 static Node* previousSkippingChildren(const Node&); 83 static Node* previousSkippingChildren(const Node&);
84 84
85 // Like previous, but visits parents before their children.
86 static Node* previousPostOrder(const Node&, const Node* stayWithin = nullptr );
87
85 // Composed tree version of |Node::isDescendantOf(other)|. This function 88 // Composed tree version of |Node::isDescendantOf(other)|. This function
86 // returns true if |other| contains |node|, otherwise returns 89 // returns true if |other| contains |node|, otherwise returns
87 // false. If |other| is |node|, this function returns false. 90 // false. If |other| is |node|, this function returns false.
88 static bool isDescendantOf(const Node& /*node*/, const Node& other); 91 static bool isDescendantOf(const Node& /*node*/, const Node& other);
89 92
90 static bool contains(const ContainerNode& container, const Node& node) 93 static bool contains(const ContainerNode& container, const Node& node)
91 { 94 {
92 assertPrecondition(container); 95 assertPrecondition(container);
93 assertPrecondition(node); 96 assertPrecondition(node);
94 return container == node || isDescendantOf(node, container); 97 return container == node || isDescendantOf(node, container);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 306 }
304 307
305 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node) 308 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node)
306 { 309 {
307 return traverseChild(node, TraversalDirectionBackward); 310 return traverseChild(node, TraversalDirectionBackward);
308 } 311 }
309 312
310 } // namespace 313 } // namespace
311 314
312 #endif 315 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/shadow/ComposedTreeTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698