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

Unified Diff: Source/core/dom/TreeScope.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/SelectorQuery.cpp ('k') | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 46fe4ca1f99e4e00602a7d9f7ecd62cb37c0e522..370397441482bf28bab149239580bf38e6c8bea7 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -277,7 +277,7 @@ HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeV
if (!m_labelsByForAttribute) {
// Populate the map on first access.
m_labelsByForAttribute = adoptPtr(new DocumentOrderedMap);
- for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::next(element)) {
+ for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::next(*element)) {
if (isHTMLLabelElement(element)) {
HTMLLabelElement* label = toHTMLLabelElement(element);
const AtomicString& forValue = label->fastGetAttribute(forAttr);
@@ -311,7 +311,7 @@ Element* TreeScope::findAnchor(const String& name)
return 0;
if (Element* element = getElementById(name))
return element;
- for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::next(element)) {
+ for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::next(*element)) {
if (isHTMLAnchorElement(element)) {
HTMLAnchorElement* anchor = toHTMLAnchorElement(element);
if (rootNode()->document().inQuirksMode()) {
@@ -485,7 +485,7 @@ Element* TreeScope::getElementByAccessKey(const String& key) const
return 0;
Element* result = 0;
Node* root = rootNode();
- for (Element* element = ElementTraversal::firstWithin(root); element; element = ElementTraversal::next(element, root)) {
+ for (Element* element = ElementTraversal::firstWithin(root); element; element = ElementTraversal::next(*element, root)) {
if (equalIgnoringCase(element->fastGetAttribute(accesskeyAttr), key))
result = element;
for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
« no previous file with comments | « Source/core/dom/SelectorQuery.cpp ('k') | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698