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

Unified Diff: Source/core/html/HTMLCollection.cpp

Issue 196823006: Replace nextSiblingChildren() with simpler nextSibling() when equivalent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCollection.cpp
diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
index 0ab210b3e08d5e60ed8f424b56a1fdce9149a9b9..0b0bce0f17c357f35fab2f810a247c70944d8676 100644
--- a/Source/core/html/HTMLCollection.cpp
+++ b/Source/core/html/HTMLCollection.cpp
@@ -309,17 +309,17 @@ static inline bool nameShouldBeVisibleInDocumentAll(const HTMLElement& element)
inline Element* firstMatchingChildElement(const HTMLCollection& nodeList, const ContainerNode& root)
{
- Element* element = ElementTraversal::firstWithin(root);
+ Element* element = ElementTraversal::firstChild(root);
while (element && !isMatchingElement(nodeList, *element))
- element = ElementTraversal::nextSkippingChildren(*element, &root);
+ element = ElementTraversal::nextSibling(*element);
return element;
}
-inline Element* nextMatchingChildElement(const HTMLCollection& nodeList, Element& current, const ContainerNode& root)
+inline Element* nextMatchingChildElement(const HTMLCollection& nodeList, Element& current)
{
Element* next = &current;
do {
- next = ElementTraversal::nextSkippingChildren(*next, &root);
+ next = ElementTraversal::nextSibling(*next);
} while (next && !isMatchingElement(nodeList, *next));
return next;
}
@@ -345,7 +345,7 @@ inline Element* HTMLCollection::traverseNextElement(Element& previous, const Con
if (overridesItemAfter())
return virtualItemAfter(&previous);
if (shouldOnlyIncludeDirectChildren())
- return nextMatchingChildElement(*this, previous, root);
+ return nextMatchingChildElement(*this, previous);
return nextMatchingElement(*this, previous, root);
}
@@ -368,7 +368,7 @@ Element* HTMLCollection::traverseForwardToOffset(unsigned offset, Element& curre
}
if (shouldOnlyIncludeDirectChildren()) {
Element* next = &currentElement;
- while ((next = nextMatchingChildElement(*this, *next, root))) {
+ while ((next = nextMatchingChildElement(*this, *next))) {
if (++currentOffset == offset)
return next;
}
« no previous file with comments | « no previous file | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698