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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 5 years 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/SelectorFilter.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorFilter.cpp b/third_party/WebKit/Source/core/css/SelectorFilter.cpp
index 9fba0f6e2dec3d12661b9739b459d1dcb596cca3..bd8967ce27769f1c5cdd064dc315fd922d50952d 100644
--- a/third_party/WebKit/Source/core/css/SelectorFilter.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorFilter.cpp
@@ -154,7 +154,7 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign
unsigned* hash = identifierHashes;
unsigned* end = identifierHashes + maximumIdentifierCount;
CSSSelector::Relation relation = selector.relation();
- bool relationIsAffectedByPseudoContent = selector.relationIsAffectedByPseudoContent();
+ bool relationIsAffectedByPseudoContentOrSlotted = selector.relationIsAffectedByPseudoContent() || selector.relationIsAffectedByPseudoSlotted();
// Skip the topmost selector. It is handled quickly by the rule hashes.
bool skipOverSubselectors = true;
@@ -171,7 +171,8 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign
break;
case CSSSelector::Descendant:
case CSSSelector::Child:
- if (relationIsAffectedByPseudoContent) {
+ case CSSSelector::ShadowSlot:
+ if (relationIsAffectedByPseudoContentOrSlotted) {
// Disable fastRejectSelector.
*identifierHashes = 0;
return;
@@ -186,7 +187,7 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign
if (hash == end)
return;
relation = current->relation();
- relationIsAffectedByPseudoContent = current->relationIsAffectedByPseudoContent();
+ relationIsAffectedByPseudoContentOrSlotted = current->relationIsAffectedByPseudoContent() || current->relationIsAffectedByPseudoSlotted();
}
*hash = 0;
}

Powered by Google App Engine
This is Rietveld 408576698