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

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

Issue 68173014: Have ElementTraversal::firstWithin() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/ContainerNode.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 3388b1d232304afa36428ef56a5ff40e83fa8307..7aa25e358dcc70ecbb94fabc2d0ab6e93c10172c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -675,7 +675,7 @@ void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* a
{
ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- Element* newDocumentElement = ElementTraversal::firstWithin(this);
+ Element* newDocumentElement = ElementTraversal::firstWithin(*this);
if (newDocumentElement == m_documentElement)
return;
m_documentElement = newDocumentElement;
@@ -2673,7 +2673,7 @@ void Document::updateBaseURL()
if (!equalIgnoringFragmentIdentifier(oldBaseURL, m_baseURL)) {
// Base URL change changes any relative visited links.
// FIXME: There are other URLs in the tree that would need to be re-evaluated on dynamic base URL change. Style should be invalidated too.
- for (Element* element = ElementTraversal::firstWithin(this); element; element = ElementTraversal::next(*element)) {
+ for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::next(*element)) {
if (isHTMLAnchorElement(element))
toHTMLAnchorElement(element)->invalidateCachedVisitedLinkHash();
}
@@ -2691,7 +2691,7 @@ void Document::processBaseElement()
// Find the first href attribute in a base element and the first target attribute in a base element.
const AtomicString* href = 0;
const AtomicString* target = 0;
- for (Element* element = ElementTraversal::firstWithin(this); element && (!href || !target); element = ElementTraversal::next(*element)) {
+ for (Element* element = ElementTraversal::firstWithin(*this); element && (!href || !target); element = ElementTraversal::next(*element)) {
if (element->hasTagName(baseTag)) {
if (!href) {
const AtomicString& value = element->fastGetAttribute(hrefAttr);
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698