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

Unified Diff: Source/core/css/RuleFeature.cpp

Issue 1349543004: CSS: Avoid invalidating style when only descendants need updating (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: invalidatesSelf Created 5 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
Index: Source/core/css/RuleFeature.cpp
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index d29f5b75ac7b860ef066bb81667b3a7b47b1cc79..f89de00af3ef780abe8d90b3ac724873fc0d88cc 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -318,7 +318,7 @@ void RuleFeatureSet::updateInvalidationSetsForContentAttribute(const RuleData& r
CSSFunctionValue* functionValue = toCSSFunctionValue(item.get());
if (functionValue->functionType() != CSSValueAttr)
continue;
- ensureAttributeInvalidationSet(AtomicString(toCSSPrimitiveValue(functionValue->item(0))->getStringValue()));
+ ensureAttributeInvalidationSet(AtomicString(toCSSPrimitiveValue(functionValue->item(0))->getStringValue())).setInvalidatesSelf();
}
}
@@ -330,7 +330,9 @@ RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelector& selector, Inva
if (!negated)
foundFeatures |= extractInvalidationSetFeature(*current, features);
// Initialize the entry in the invalidation set map, if supported.
- if (!invalidationSetForSelector(*current)) {
+ if (InvalidationSet* invalidationSet = invalidationSetForSelector(*current)) {
+ invalidationSet->setInvalidatesSelf();
+ } else {
if (requiresSubtreeInvalidation(*current)) {
// Fall back to use subtree invalidations, even for features in the
// rightmost compound selector. Returning the start &selector here
« no previous file with comments | « LayoutTests/media/track/cue-style-invalidation-expected.txt ('k') | Source/core/css/invalidation/InvalidationSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698