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

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

Issue 1459063004: Use invalidation sets for visited link updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/VisitedLinkState.cpp
diff --git a/third_party/WebKit/Source/core/dom/VisitedLinkState.cpp b/third_party/WebKit/Source/core/dom/VisitedLinkState.cpp
index c5b047572688d1c386bc72def282c520e34fa104..51b1c75b0bf2193947f24ab8d4c6b03f7f8efb0d 100644
--- a/third_party/WebKit/Source/core/dom/VisitedLinkState.cpp
+++ b/third_party/WebKit/Source/core/dom/VisitedLinkState.cpp
@@ -64,8 +64,10 @@ void VisitedLinkState::invalidateStyleForAllLinks()
if (m_linksCheckedForVisitedState.isEmpty())
return;
for (Node& node : NodeTraversal::startsAt(document().firstChild())) {
- if (node.isLink())
- node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::VisitedLink));
+ if (node.isLink()) {
+ toElement(node).pseudoStateChanged(CSSSelector::PseudoLink);
+ toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited);
+ }
}
}
@@ -74,8 +76,10 @@ void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash)
if (!m_linksCheckedForVisitedState.contains(linkHash))
return;
for (Node& node : NodeTraversal::startsAt(document().firstChild())) {
- if (node.isLink() && linkHashForElement(toElement(node)) == linkHash)
- node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::VisitedLink));
+ if (node.isLink() && linkHashForElement(toElement(node)) == linkHash) {
+ toElement(node).pseudoStateChanged(CSSSelector::PseudoLink);
+ toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited);
+ }
}
}
« 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