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

Unified Diff: Source/core/dom/NodeTraversal.cpp

Issue 133993004: Fix mac bot specific performance regression by reverting set of patches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeTraversal.cpp
diff --git a/Source/core/dom/NodeTraversal.cpp b/Source/core/dom/NodeTraversal.cpp
index d5d298042d2784ef73491936c7037e96700b1e30..b5eba511658b779a44fdf5666f002bd6279262ff 100644
--- a/Source/core/dom/NodeTraversal.cpp
+++ b/Source/core/dom/NodeTraversal.cpp
@@ -74,6 +74,29 @@ Node* nextIncludingPseudoSkippingChildren(const Node& current, const Node* stayW
return 0;
}
+Node* nextAncestorSibling(const Node& current)
+{
+ ASSERT(!current.nextSibling());
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent->nextSibling())
+ return parent->nextSibling();
+ }
+ return 0;
+}
+
+Node* nextAncestorSibling(const Node& current, const Node* stayWithin)
+{
+ ASSERT(!current.nextSibling());
+ ASSERT(current != stayWithin);
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent == stayWithin)
+ return 0;
+ if (parent->nextSibling())
+ return parent->nextSibling();
+ }
+ return 0;
+}
+
Node* previous(const Node& current, const Node* stayWithin)
{
if (current == stayWithin)
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698