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

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: 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..9d54ac745702282b33add8f481f824c765448d7a 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())).setAppliesDirectly();
}
}
@@ -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->setAppliesDirectly();
+ } else {
if (requiresSubtreeInvalidation(*current)) {
// Fall back to use subtree invalidations, even for features in the
// rightmost compound selector. Returning the start &selector here

Powered by Google App Engine
This is Rietveld 408576698