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

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

Issue 565493002: Use invalidation set for :empty pseudo changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@empty-flag-20140910
Patch Set: 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/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/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index b0623cd8ef5d19427e63b56463fa616af5abee85..dfa59f4f2814ce3975f34f7ea37db485ba2c79ae 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1718,9 +1718,15 @@ void Element::checkForEmptyStyleChange()
if (!style && !styleAffectedByEmpty())
return;
+ if (styleChangeType() >= SubtreeStyleChange)
+ return;
+ if (!inActiveDocument())
+ return;
+ if (!document().styleResolver())
+ return;
if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildren())))
- setNeedsStyleRecalc(SubtreeStyleChange);
+ document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoEmpty, *this);
}
void Element::childrenChanged(const ChildrenChange& change)
« 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