Index: Source/core/css/CSSSelector.cpp |
diff --git a/Source/core/css/CSSSelector.cpp b/Source/core/css/CSSSelector.cpp |
index e6645dfcb0af5094d9263909bdad3d7685d8762c..74adeb1e2d07a557ae6180b86141d33ce8dc2fa5 100644 |
--- a/Source/core/css/CSSSelector.cpp |
+++ b/Source/core/css/CSSSelector.cpp |
@@ -684,8 +684,12 @@ String CSSSelector::selectorText(const String& rightSide) const |
if (const CSSSelector* tagHistory = cs->tagHistory()) { |
switch (cs->relation()) { |
case CSSSelector::Descendant: |
+ if (cs->relationIsForShadowDistributed()) |
+ return tagHistory->selectorText("::-webkit-distributed(" + str.toString() + rightSide + ")"); |
return tagHistory->selectorText(" " + str.toString() + rightSide); |
case CSSSelector::Child: |
+ if (cs->relationIsForShadowDistributed()) |
+ return tagHistory->selectorText("::-webkit-distributed(> " + str.toString() + rightSide + ")"); |
return tagHistory->selectorText(" > " + str.toString() + rightSide); |
case CSSSelector::DirectAdjacent: |
return tagHistory->selectorText(" + " + str.toString() + rightSide); |
@@ -695,8 +699,6 @@ String CSSSelector::selectorText(const String& rightSide) const |
ASSERT_NOT_REACHED(); |
case CSSSelector::ShadowPseudo: |
return tagHistory->selectorText(str.toString() + rightSide); |
- case CSSSelector::ShadowDistributed: |
- return tagHistory->selectorText("::-webkit-distributed(" + str.toString() + rightSide + ")"); |
} |
} |
return str.toString() + rightSide; |