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

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

Issue 220943002: Use invalidation sets for :hover, :active, and :focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary seenCombinator handling. Created 6 years, 8 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/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index f355f618b05a5d2abd7d3807fca55973c52daf0d..efb06651b06ba78d6fc10de0c900fd0dde2b6764 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -814,9 +814,10 @@ void ContainerNode::focusStateChanged()
if (!renderer())
return;
- if ((isElementNode() && toElement(this)->childrenAffectedByFocus())
- || (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FIRST_LETTER)))
+ if (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange);
+ else if (isElementNode() && toElement(this)->childrenAffectedByFocus())
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
else if (renderStyle()->affectedByFocus())
setNeedsStyleRecalc(LocalStyleChange);
@@ -838,7 +839,7 @@ void ContainerNode::setFocus(bool received)
// If :focus sets display: none, we lose focus but still need to recalc our style.
if (isElementNode() && toElement(this)->childrenAffectedByFocus())
- setNeedsStyleRecalc(SubtreeStyleChange);
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
else
setNeedsStyleRecalc(LocalStyleChange);
}
@@ -852,9 +853,10 @@ void ContainerNode::setActive(bool down)
// FIXME: Why does this not need to handle the display: none transition like :hover does?
if (renderer()) {
- if ((isElementNode() && toElement(this)->childrenAffectedByActive())
- || (renderStyle()->affectedByActive() && renderStyle()->hasPseudoStyle(FIRST_LETTER)))
+ if (renderStyle()->affectedByActive() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange);
+ else if (isElementNode() && toElement(this)->childrenAffectedByActive())
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoActive, *toElement(this));
else if (renderStyle()->affectedByActive())
setNeedsStyleRecalc(LocalStyleChange);
@@ -875,15 +877,16 @@ void ContainerNode::setHovered(bool over)
if (over)
return;
if (isElementNode() && toElement(this)->childrenAffectedByHover())
- setNeedsStyleRecalc(SubtreeStyleChange);
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
else
setNeedsStyleRecalc(LocalStyleChange);
return;
}
- if ((isElementNode() && toElement(this)->childrenAffectedByHover())
- || (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FIRST_LETTER)))
+ if (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange);
+ else if (isElementNode() && toElement(this)->childrenAffectedByHover())
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
else if (renderStyle()->affectedByHover())
setNeedsStyleRecalc(LocalStyleChange);
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698