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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index db24f8986e1bc58999d14d2f4dcb43612704a35e..d847158b75f12637d937c842173229bb33946d81 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -1069,7 +1069,7 @@ String Range::toString(ExceptionState& es) const
StringBuilder builder;
Node* pastLast = pastLastNode();
- for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(n)) {
+ for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(*n)) {
if (n->nodeType() == Node::TEXT_NODE || n->nodeType() == Node::CDATA_SECTION_NODE) {
String data = toCharacterData(n)->data();
int length = data.length();
@@ -1478,7 +1478,7 @@ void Range::checkDeleteExtract(const String& methodName, ExceptionState& es)
return;
Node* pastLast = pastLastNode();
- for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(n)) {
+ for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(*n)) {
if (n->nodeType() == Node::DOCUMENT_TYPE_NODE) {
es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
return;
@@ -1541,7 +1541,7 @@ void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight, RangeInFi
bool someFixed = false;
Node* stopNode = pastLastNode();
- for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
+ for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
RenderObject* r = node->renderer();
if (!r || !r->isText())
continue;
@@ -1573,7 +1573,7 @@ void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn
bool someFixed = false;
Node* stopNode = pastLastNode();
- for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
+ for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
RenderObject* r = node->renderer();
if (!r || !r->isText())
continue;
@@ -1850,12 +1850,12 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
Node* stopNode = pastLastNode();
HashSet<Node*> nodeSet;
- for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
+ for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
if (node->isElementNode())
nodeSet.add(node);
}
- for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
+ for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
if (node->isElementNode()) {
if (!nodeSet.contains(node->parentNode())) {
if (RenderBoxModelObject* renderBoxModelObject = toElement(node)->renderBoxModelObject()) {
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698