Index: Source/core/css/SelectorChecker.cpp |
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp |
index cff70da5bf3d5b3080ae8f813134c603f44ac2aa..3700398372d804cfed902f4923e74603d43b7a0b 100644 |
--- a/Source/core/css/SelectorChecker.cpp |
+++ b/Source/core/css/SelectorChecker.cpp |
@@ -350,6 +350,14 @@ SelectorChecker::Match SelectorChecker::matchForRelation(const SelectorCheckingC |
case CSSSelector::ShadowDeep: |
{ |
+ if (context.selector->relationIsAffectedByPseudoContent()) { |
+ for (Element* element = context.element; element; element = parentOrShadowHostButDisallowEscapingClosedShadowTree(*element)) { |
+ if (matchForShadowDistributed(element, siblingTraversalStrategy, nextContext, result) == SelectorMatches) |
+ return SelectorMatches; |
+ } |
+ return SelectorFailsCompletely; |
+ } |
+ |
nextContext.isSubSelector = false; |
nextContext.elementStyle = 0; |
for (nextContext.element = parentOrShadowHostButDisallowEscapingClosedShadowTree(*context.element); nextContext.element; nextContext.element = parentOrShadowHostButDisallowEscapingClosedShadowTree(*nextContext.element)) { |