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

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

Issue 483383002: Use NodeTraversal instead of ElementTraversal in VisitedLinkState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/VisitedLinkState.cpp
diff --git a/Source/core/dom/VisitedLinkState.cpp b/Source/core/dom/VisitedLinkState.cpp
index 4f83485da0e3b3f8ea0b7109233123d8ff1d4bdd..8dde6d834e5e575aa50eaf94852c6bde4369c7dd 100644
--- a/Source/core/dom/VisitedLinkState.cpp
+++ b/Source/core/dom/VisitedLinkState.cpp
@@ -63,9 +63,9 @@ void VisitedLinkState::invalidateStyleForAllLinks()
{
if (m_linksCheckedForVisitedState.isEmpty())
return;
- for (Element* element = ElementTraversal::firstWithin(document()); element; element = ElementTraversal::next(*element)) {
- if (element->isLink())
- element->setNeedsStyleRecalc(SubtreeStyleChange);
+ for (Node* node = document().firstChild(); node; node = NodeTraversal::next(*node)) {
+ if (node->isLink())
+ node->setNeedsStyleRecalc(SubtreeStyleChange);
esprehn 2014/08/20 21:44:52 Note that this code is busted because it doesn't w
adamk 2014/08/20 21:48:45 This isn't newly-broken, right? The existing code
esprehn 2014/08/20 21:52:03 Correct, but there's an isElement() check inside t
}
}
@@ -73,9 +73,9 @@ void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash)
{
if (!m_linksCheckedForVisitedState.contains(linkHash))
return;
- for (Element* element = ElementTraversal::firstWithin(document()); element; element = ElementTraversal::next(*element)) {
- if (element->isLink() && linkHashForElement(*element) == linkHash)
- element->setNeedsStyleRecalc(SubtreeStyleChange);
+ for (Node* node = document().firstChild(); node; node = NodeTraversal::next(*node)) {
+ if (node->isLink() && linkHashForElement(toElement(*node)) == linkHash)
+ node->setNeedsStyleRecalc(SubtreeStyleChange);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698