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

Side by Side Diff: Source/core/dom/NodeTraversal.cpp

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/Range.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return next; 67 return next;
68 for (current = current->parentNode(); current; current = current->parentNode ()) { 68 for (current = current->parentNode(); current; current = current->parentNode ()) {
69 if (current == stayWithin) 69 if (current == stayWithin)
70 return 0; 70 return 0;
71 if (Node* next = current->pseudoAwareNextSibling()) 71 if (Node* next = current->pseudoAwareNextSibling())
72 return next; 72 return next;
73 } 73 }
74 return 0; 74 return 0;
75 } 75 }
76 76
77 Node* nextAncestorSibling(const Node* current) 77 Node* nextAncestorSibling(const Node& current)
78 { 78 {
79 ASSERT(!current->nextSibling()); 79 ASSERT(!current.nextSibling());
80 for (current = current->parentNode(); current; current = current->parentNode ()) { 80 for (Node* parent = current.parentNode(); parent; parent = parent->parentNod e()) {
81 if (current->nextSibling()) 81 if (parent->nextSibling())
82 return current->nextSibling(); 82 return parent->nextSibling();
83 } 83 }
84 return 0; 84 return 0;
85 } 85 }
86 86
87 Node* nextAncestorSibling(const Node* current, const Node* stayWithin) 87 Node* nextAncestorSibling(const Node& current, const Node* stayWithin)
88 { 88 {
89 ASSERT(!current->nextSibling()); 89 ASSERT(!current.nextSibling());
90 ASSERT(current != stayWithin); 90 ASSERT(current != stayWithin);
91 for (current = current->parentNode(); current; current = current->parentNode ()) { 91 for (Node* parent = current.parentNode(); parent; parent = parent->parentNod e()) {
92 if (current == stayWithin) 92 if (parent == stayWithin)
93 return 0; 93 return 0;
94 if (current->nextSibling()) 94 if (parent->nextSibling())
95 return current->nextSibling(); 95 return parent->nextSibling();
96 } 96 }
97 return 0; 97 return 0;
98 } 98 }
99 99
100 Node* previous(const Node& current, const Node* stayWithin) 100 Node* previous(const Node& current, const Node* stayWithin)
101 { 101 {
102 if (current == stayWithin) 102 if (current == stayWithin)
103 return 0; 103 return 0;
104 if (current.previousSibling()) { 104 if (current.previousSibling()) {
105 Node* previous = current.previousSibling(); 105 Node* previous = current.previousSibling();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 { 164 {
165 if (current == stayWithin) 165 if (current == stayWithin)
166 return 0; 166 return 0;
167 if (current.previousSibling()) 167 if (current.previousSibling())
168 return current.previousSibling(); 168 return current.previousSibling();
169 return previousAncestorSiblingPostOrder(current, stayWithin); 169 return previousAncestorSiblingPostOrder(current, stayWithin);
170 } 170 }
171 171
172 } 172 }
173 } 173 }
OLDNEW
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698