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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase / fix comments for tests (FYI) 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/CSSSelectorList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
index 114fb8460e58dd0739288b723d1235976e1d1985..758fffd69689371154c112b5c3b990337855dc1d 100644
--- a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
@@ -168,6 +168,13 @@ bool CSSSelectorList::selectorHasShadowDistributed(size_t index) const
}, selectorAt(index));
}
+bool CSSSelectorList::selectorHasShadowSlotted(size_t index) const
+{
+ return forEachTagSelector([](const CSSSelector& selector) -> bool {
+ return selector.relationIsAffectedByPseudoSlotted();
+ }, selectorAt(index));
+}
+
bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) const
{
return forEachTagSelector([](const CSSSelector& selector) -> bool {
@@ -178,7 +185,7 @@ bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) con
bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const
{
return forEachTagSelector([](const CSSSelector& selector) -> bool {
- return selector.relationIsAffectedByPseudoContent() || selector.pseudoType() == CSSSelector::PseudoHostContext;
+ return selector.relationIsAffectedByPseudoContent() || selector.relationIsAffectedByPseudoSlotted() || selector.pseudoType() == CSSSelector::PseudoHostContext;
}, selectorAt(index));
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698