Index: Source/core/dom/DocumentOrderedMap.cpp |
diff --git a/Source/core/dom/DocumentOrderedMap.cpp b/Source/core/dom/DocumentOrderedMap.cpp |
index 556fe1a8ba1e747266cc71eed22e950a5e04e0de..c0b4039bed16d3360216ac911babb5a9bd6adc40 100644 |
--- a/Source/core/dom/DocumentOrderedMap.cpp |
+++ b/Source/core/dom/DocumentOrderedMap.cpp |
@@ -121,11 +121,11 @@ inline Element* DocumentOrderedMap::get(const AtomicString& key, const TreeScope |
return entry->element; |
// We know there's at least one node that matches; iterate to find the first one. |
- for (Element* element = ElementTraversal::firstWithin(scope->rootNode()); element; element = ElementTraversal::next(*element)) { |
- if (!keyMatches(key, *element)) |
+ for (Element& element : ElementTraversal::fromNext(scope->rootNode())) { |
+ if (!keyMatches(key, element)) |
continue; |
- entry->element = element; |
- return element; |
+ entry->element = &element; |
+ return &element; |
} |
ASSERT_NOT_REACHED(); |
return 0; |