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

Unified Diff: Source/core/css/CSSSelector.cpp

Issue 15657003: Make a '::distributed' pseudo element the first-ever client who can accept a relative selector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce m_relationIsForShadowDistributed Created 7 years, 7 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
« no previous file with comments | « Source/core/css/CSSSelector.h ('k') | Source/core/css/CSSSelectorList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/css/CSSSelector.h ('k') | Source/core/css/CSSSelectorList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698