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

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

Issue 221643002: Only support AddFeatures invalidation set mode for :host or :any in a rightmost selector (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix cojmpilation. Created 6 years, 9 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleFeature.cpp
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index 33b5ed35496d04b053c91f7e56daef4bafc9844e..7b793eb675b171c8a0759f4b543f84f561eb2f90 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -103,7 +103,7 @@ static bool isSkippableComponentForInvalidation(const CSSSelector& selector)
}
// This method is somewhat conservative in what it accepts.
-RuleFeatureSet::InvalidationSetMode RuleFeatureSet::supportsClassDescendantInvalidation(const CSSSelector& selector)
+RuleFeatureSet::InvalidationSetMode RuleFeatureSet::invalidationSetModeForSelector(const CSSSelector& selector)
{
bool foundDescendantRelation = false;
bool foundIdent = false;
@@ -116,10 +116,10 @@ RuleFeatureSet::InvalidationSetMode RuleFeatureSet::supportsClassDescendantInval
} else if (component->pseudoType() == CSSSelector::PseudoHost || component->pseudoType() == CSSSelector::PseudoAny) {
if (const CSSSelectorList* selectorList = component->selectorList()) {
for (const CSSSelector* selector = selectorList->first(); selector; selector = CSSSelectorList::next(*selector)) {
- InvalidationSetMode hostMode = supportsClassDescendantInvalidation(*selector);
+ InvalidationSetMode hostMode = invalidationSetModeForSelector(*selector);
if (hostMode == UseSubtreeStyleChange)
return foundDescendantRelation ? UseLocalStyleChange : UseSubtreeStyleChange;
- if (hostMode == AddFeatures)
+ if (!foundDescendantRelation && hostMode == AddFeatures)
foundIdent = true;
}
}
@@ -172,7 +172,7 @@ DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS
RuleFeatureSet::InvalidationSetMode RuleFeatureSet::updateInvalidationSets(const CSSSelector& selector)
{
- InvalidationSetMode mode = supportsClassDescendantInvalidation(selector);
+ InvalidationSetMode mode = invalidationSetModeForSelector(selector);
if (mode != AddFeatures)
return mode;
« no previous file with comments | « Source/core/css/RuleFeature.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698