Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index c8485a36b2a426c5234039e26282047a08b551e7..971504ef70b6f112e689dd27031c569032eb9b01 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -1668,7 +1668,7 @@ void Node::showNodePathForThis() const |
static void traverseTreeAndMark(const String& baseIndent, const Node* rootNode, const Node* markedNode1, const char* markedLabel1, const Node* markedNode2, const char* markedLabel2) |
{ |
- for (const Node* node = rootNode; node; node = NodeTraversal::next(*node, rootNode)) { |
+ for (Node& node : NodeTraversal::inclusiveDescendantsOf(*rootNode)) { |
if (node == markedNode1) |
fprintf(stderr, "%s", markedLabel1); |
if (node == markedNode2) |
@@ -1676,26 +1676,26 @@ static void traverseTreeAndMark(const String& baseIndent, const Node* rootNode, |
StringBuilder indent; |
indent.append(baseIndent); |
- for (const Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentOrShadowHostNode()) |
+ for (const Node* tmpNode = &node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentOrShadowHostNode()) |
indent.append('\t'); |
fprintf(stderr, "%s", indent.toString().utf8().data()); |
- node->showNode(); |
+ node.showNode(); |
indent.append('\t'); |
- if (node->isElementNode()) { |
- const Element* element = toElement(node); |
- if (Element* pseudo = element->pseudoElement(BEFORE)) |
+ if (node.isElementNode()) { |
+ const Element& element = toElement(node); |
+ if (Element* pseudo = element.pseudoElement(BEFORE)) |
traverseTreeAndMark(indent.toString(), pseudo, markedNode1, markedLabel1, markedNode2, markedLabel2); |
- if (Element* pseudo = element->pseudoElement(AFTER)) |
+ if (Element* pseudo = element.pseudoElement(AFTER)) |
traverseTreeAndMark(indent.toString(), pseudo, markedNode1, markedLabel1, markedNode2, markedLabel2); |
- if (Element* pseudo = element->pseudoElement(BACKDROP)) |
+ if (Element* pseudo = element.pseudoElement(BACKDROP)) |
traverseTreeAndMark(indent.toString(), pseudo, markedNode1, markedLabel1, markedNode2, markedLabel2); |
} |
- if (node->isShadowRoot()) { |
- if (ShadowRoot* youngerShadowRoot = toShadowRoot(node)->youngerShadowRoot()) |
+ if (node.isShadowRoot()) { |
+ if (ShadowRoot* youngerShadowRoot = toShadowRoot(node).youngerShadowRoot()) |
traverseTreeAndMark(indent.toString(), youngerShadowRoot, markedNode1, markedLabel1, markedNode2, markedLabel2); |
- } else if (ShadowRoot* oldestShadowRoot = oldestShadowRootFor(node)) |
+ } else if (ShadowRoot* oldestShadowRoot = oldestShadowRootFor(&node)) |
traverseTreeAndMark(indent.toString(), oldestShadowRoot, markedNode1, markedLabel1, markedNode2, markedLabel2); |
} |
} |