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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 for (Node* n = context->previousSibling(); n; n = n->previousSibling()) { 325 for (Node* n = context->previousSibling(); n; n = n->previousSibling()) {
326 if (nodeMatches(evaluationContext, n, PrecedingSiblingAxis, nodeTest ())) 326 if (nodeMatches(evaluationContext, n, PrecedingSiblingAxis, nodeTest ()))
327 nodes.append(n); 327 nodes.append(n);
328 } 328 }
329 nodes.markSorted(false); 329 nodes.markSorted(false);
330 return; 330 return;
331 331
332 case FollowingAxis: 332 case FollowingAxis:
333 if (context->isAttributeNode()) { 333 if (context->isAttributeNode()) {
334 for (Node* p = NodeTraversal::next(*toAttr(context)->ownerElement()) ; p; p = NodeTraversal::next(*p)) { 334 for (Node& p : NodeTraversal::fromNext(*toAttr(context)->ownerElemen t())) {
335 if (nodeMatches(evaluationContext, p, FollowingAxis, nodeTest()) ) 335 if (nodeMatches(evaluationContext, &p, FollowingAxis, nodeTest() ))
336 nodes.append(p); 336 nodes.append(&p);
337 } 337 }
338 } else { 338 } else {
339 for (Node* p = context; !isRootDomNode(p); p = p->parentNode()) { 339 for (Node* p = context; !isRootDomNode(p); p = p->parentNode()) {
340 for (Node* n = p->nextSibling(); n; n = n->nextSibling()) { 340 for (Node* n = p->nextSibling(); n; n = n->nextSibling()) {
341 if (nodeMatches(evaluationContext, n, FollowingAxis, nodeTes t())) 341 if (nodeMatches(evaluationContext, n, FollowingAxis, nodeTes t()))
342 nodes.append(n); 342 nodes.append(n);
343 for (Node* c = n->firstChild(); c; c = NodeTraversal::next(* c, n)) { 343 for (Node* c = n->firstChild(); c; c = NodeTraversal::next(* c, n)) {
344 if (nodeMatches(evaluationContext, c, FollowingAxis, nod eTest())) 344 if (nodeMatches(evaluationContext, c, FollowingAxis, nod eTest()))
345 nodes.append(c); 345 nodes.append(c);
346 } 346 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 nodes.markSorted(false); 431 nodes.markSorted(false);
432 return; 432 return;
433 } 433 }
434 } 434 }
435 ASSERT_NOT_REACHED(); 435 ASSERT_NOT_REACHED();
436 } 436 }
437 437
438 } 438 }
439 439
440 } 440 }
OLDNEW
« 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