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

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

Issue 1695393002: Don't add to siblingRules for features left of ::slotted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 f2da0c24a98cc945a68241005d9a75e13241b254..47ea1b49ebe89349e0866fa400c42a2737d712ca 100644
--- a/third_party/WebKit/Source/core/css/RuleFeature.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -587,15 +587,21 @@ void RuleFeatureSet::collectFeaturesFromSelector(const CSSSelector& selector, Ru
metadata.maxDirectAdjacentSelectors = maxDirectAdjacentSelectors;
maxDirectAdjacentSelectors = 0;
}
- if (!metadata.foundInsertionPointCrossing && current->isSiblingSelector())
+ if (!metadata.foundInsertionPointCrossing && current->isSiblingPseudo())
metadata.foundSiblingSelector = true;
if (const CSSSelectorList* selectorList = current->selectorList()) {
for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(*subSelector))
collectFeaturesFromSelector(*subSelector, metadata);
}
- if (current->relationIsAffectedByPseudoContent())
+ if (current->relationIsAffectedByPseudoContent()
+ || current->pseudoType() == CSSSelector::PseudoHost
+ || current->pseudoType() == CSSSelector::PseudoHostContext
+ || current->pseudoType() == CSSSelector::PseudoSlotted) {
metadata.foundInsertionPointCrossing = true;
+ }
+ if (!metadata.foundInsertionPointCrossing && current->isAdjacentSelector())
+ metadata.foundSiblingSelector = true;
}
ASSERT(!maxDirectAdjacentSelectors);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.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