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

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 compilation. 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
« Source/core/css/RuleFeature.h ('K') | « 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 bdc04544ce4e4a588c187dbca89a74e2ef7ea4b5..75f1215945213193a98d1201084338eb403644e4 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::getInvalidationSetMode(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 = getInvalidationSetMode(*selector);
if (hostMode == UseSubtreeStyleChange)
return foundDescendantRelation ? UseLocalStyleChange : UseSubtreeStyleChange;
- if (hostMode == AddFeatures)
+ if (!foundDescendantRelation && hostMode == AddFeatures)
foundIdent = true;
}
}
@@ -170,7 +170,7 @@ DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS
RuleFeatureSet::InvalidationSetMode RuleFeatureSet::updateInvalidationSets(const CSSSelector& selector)
{
- InvalidationSetMode mode = supportsClassDescendantInvalidation(selector);
+ InvalidationSetMode mode = getInvalidationSetMode(selector);
if (mode != AddFeatures)
return mode;
« Source/core/css/RuleFeature.h ('K') | « Source/core/css/RuleFeature.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698