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

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

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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 | « Source/core/dom/Element.h ('k') | Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index eb04d84f1f757cb56c9b9cf073925ec82fe89bba..13f1db1c6e8efa2ac1cb66be3966624cc75bdf0d 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1598,11 +1598,15 @@ ElementShadow& Element::ensureShadow()
return ensureElementRareData().ensureShadow();
}
-void Element::didAffectSelector(AffectedSelectorMask mask)
+void Element::pseudoStateChanged(CSSSelector::PseudoType pseudo)
{
- setNeedsStyleRecalc(SubtreeStyleChange);
+ StyleResolver* styleResolver = document().styleResolver();
+
+ if (inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange)
+ styleResolver->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(pseudo, *this);
+
if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this))
- elementShadow->didAffectSelector(mask);
+ elementShadow->distributedNodePseudoStateChanged(pseudo);
}
void Element::setAnimationStyleChange(bool animationStyleChange)
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698