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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tentative fix for crash / querySelector test Created 4 years, 11 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 76f9b60c3b773d6ff67988f73955cd478a5e8adf..be037d420bdfb0fbd5914e86be16187ea21a79d9 100644
--- a/third_party/WebKit/Source/core/css/RuleFeature.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -173,7 +173,8 @@ bool supportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo)
|| pseudo == CSSSelector::PseudoCue
|| pseudo == CSSSelector::PseudoHost
|| pseudo == CSSSelector::PseudoHostContext
- || pseudo == CSSSelector::PseudoNot;
+ || pseudo == CSSSelector::PseudoNot
+ || pseudo == CSSSelector::PseudoSlotted;
}
#endif // ENABLE(ASSERT)
@@ -194,6 +195,9 @@ bool requiresSubtreeInvalidation(const CSSSelector& selector)
case CSSSelector::PseudoHostContext:
// :host-context matches a shadow host, yet the simple selectors inside
// :host-context matches an ancestor of the shadow host.
+ case CSSSelector::PseudoSlotted:
+ // TODO(kochi): This recalculates a bit more than necessary. Find out a way
+ // to avoid unnecessary recalculation.
rune 2016/01/09 01:15:36 This shouldn't be necessary as long as we extract
return true;
default:
ASSERT(supportsInvalidation(selector.pseudoType()));
@@ -472,7 +476,7 @@ void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector* selector,
} else {
if (current->isHostPseudoClass())
descendantFeatures.treeBoundaryCrossing = true;
- if (current->isInsertionPointCrossing())
+ if (current->isInsertionPointCrossing() || current->isSlottedPseudoElement())
descendantFeatures.insertionPointCrossing = true;
if (const CSSSelectorList* selectorList = current->selectorList()) {
ASSERT(supportsInvalidationWithSelectorList(current->pseudoType()));

Powered by Google App Engine
This is Rietveld 408576698