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

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

Issue 1683923003: Don't add siblingRules with combinator left of ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing clear Created 4 years, 10 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: third_party/WebKit/Source/core/css/RuleFeature.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleFeature.cpp b/third_party/WebKit/Source/core/css/RuleFeature.cpp
index d732d585ab686d0a1b43c810e621cc032beb9b41..f2da0c24a98cc945a68241005d9a75e13241b254 100644
--- a/third_party/WebKit/Source/core/css/RuleFeature.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -587,15 +587,15 @@ void RuleFeatureSet::collectFeaturesFromSelector(const CSSSelector& selector, Ru
metadata.maxDirectAdjacentSelectors = maxDirectAdjacentSelectors;
maxDirectAdjacentSelectors = 0;
}
- if (current->isSiblingSelector())
+ if (!metadata.foundInsertionPointCrossing && current->isSiblingSelector())
metadata.foundSiblingSelector = true;
- const CSSSelectorList* selectorList = current->selectorList();
- if (!selectorList)
- continue;
-
- for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(*subSelector))
- collectFeaturesFromSelector(*subSelector, metadata);
+ if (const CSSSelectorList* selectorList = current->selectorList()) {
+ for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(*subSelector))
+ collectFeaturesFromSelector(*subSelector, metadata);
+ }
+ if (current->relationIsAffectedByPseudoContent())
+ metadata.foundInsertionPointCrossing = true;
}
ASSERT(!maxDirectAdjacentSelectors);
@@ -613,6 +613,7 @@ void RuleFeatureSet::FeatureMetadata::clear()
usesFirstLineRules = false;
usesWindowInactiveSelector = false;
foundSiblingSelector = false;
+ foundInsertionPointCrossing = false;
maxDirectAdjacentSelectors = 0;
}
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.h ('k') | third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698