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

Unified Diff: Source/core/xml/XPathStep.cpp

Issue 642973003: Introduce typed Node/Element iterators for range-based for loops of C++11. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename `from` to `fromNext`. Make some parameters const references. Created 6 years, 2 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
Index: Source/core/xml/XPathStep.cpp
diff --git a/Source/core/xml/XPathStep.cpp b/Source/core/xml/XPathStep.cpp
index 7ef3d677d663d0522417b7f77f6404cc9ab5925e..16662a20c105afb9fe6c324c0da9907989a5f415 100644
--- a/Source/core/xml/XPathStep.cpp
+++ b/Source/core/xml/XPathStep.cpp
@@ -331,9 +331,9 @@ void Step::nodesInAxis(EvaluationContext& evaluationContext, Node* context, Node
case FollowingAxis:
if (context->isAttributeNode()) {
- for (Node* p = NodeTraversal::next(*toAttr(context)->ownerElement()); p; p = NodeTraversal::next(*p)) {
- if (nodeMatches(evaluationContext, p, FollowingAxis, nodeTest()))
- nodes.append(p);
+ for (Node& p : NodeTraversal::fromNext(*toAttr(context)->ownerElement())) {
+ if (nodeMatches(evaluationContext, &p, FollowingAxis, nodeTest()))
+ nodes.append(&p);
}
} else {
for (Node* p = context; !isRootDomNode(p); p = p->parentNode()) {
« Source/core/dom/ElementTraversal.h ('K') | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698