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

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: 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..512207af67f2f0ddfc482ef28ad30283ce31a16c 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())
kochi 2016/02/15 04:10:17 If foundInsertionPointCrossing is only used for th
rune 2016/02/15 07:27:04 It's passed recursively down to selectorList below
rune 2016/02/15 08:12:07 Done.
kochi 2016/02/15 10:10:56 Thanks for explanation. I overlooked that it is p
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);
« 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