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

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

Issue 187353003: Implement /content/ combinator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 9 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 bbaac4e2ff9262bac9de856d51ae6a9ae4643b7c..39baba00f3e037e0af2ba92d86761da0daaa4776 100644
--- a/Source/core/css/CSSSelector.cpp
+++ b/Source/core/css/CSSSelector.cpp
@@ -252,7 +252,6 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoPastCue:
case PseudoDistributed:
case PseudoUnresolved:
- case PseudoContent:
case PseudoHost:
case PseudoAncestor:
case PseudoFullScreen:
@@ -346,7 +345,6 @@ static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap()
DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, scope, ("scope", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, unresolved, ("unresolved", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, content, ("content", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, host, ("host", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, hostWithParams, ("host(", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, ancestor, ("ancestor", AtomicString::ConstructFromLiteral));
@@ -435,7 +433,6 @@ static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap()
nameToPseudoType->set(hostWithParams.impl(), CSSSelector::PseudoHost);
nameToPseudoType->set(ancestor.impl(), CSSSelector::PseudoAncestor);
nameToPseudoType->set(ancestorWithParams.impl(), CSSSelector::PseudoAncestor);
- nameToPseudoType->set(content.impl(), CSSSelector::PseudoContent);
}
}
return nameToPseudoType;
@@ -519,7 +516,6 @@ void CSSSelector::extractPseudoType() const
case PseudoSelection:
case PseudoUserAgentCustomElement:
case PseudoWebKitCustomElement:
- case PseudoContent:
element = true;
break;
case PseudoUnknown:
@@ -701,11 +697,6 @@ String CSSSelector::selectorText(const String& rightSide) const
} else if (cs->m_match == CSSSelector::PseudoElement) {
str.appendLiteral("::");
str.append(cs->value());
-
- if (cs->pseudoType() == PseudoContent) {
- if (cs->relation() == CSSSelector::SubSelector && cs->tagHistory())
- return cs->tagHistory()->selectorText() + str.toString() + rightSide;
- }
} else if (cs->isAttributeSelector()) {
str.append('[');
const AtomicString& prefix = cs->attribute().prefix();
@@ -753,11 +744,11 @@ String CSSSelector::selectorText(const String& rightSide) const
if (const CSSSelector* tagHistory = cs->tagHistory()) {
switch (cs->relation()) {
case CSSSelector::Descendant:
- if (cs->relationIsAffectedByPseudoContent() && tagHistory->pseudoType() != CSSSelector::PseudoContent)
+ if (cs->relationIsAffectedByPseudoContent())
return tagHistory->selectorText("::-webkit-distributed(" + str.toString() + rightSide + ")");
return tagHistory->selectorText(" " + str.toString() + rightSide);
case CSSSelector::Child:
- if (cs->relationIsAffectedByPseudoContent() && tagHistory->pseudoType() != CSSSelector::PseudoContent)
+ if (cs->relationIsAffectedByPseudoContent())
return tagHistory->selectorText("::-webkit-distributed(> " + str.toString() + rightSide + ")");
return tagHistory->selectorText(" > " + str.toString() + rightSide);
case CSSSelector::ShadowAll:
@@ -772,6 +763,8 @@ String CSSSelector::selectorText(const String& rightSide) const
ASSERT_NOT_REACHED();
case CSSSelector::ShadowPseudo:
return tagHistory->selectorText(str.toString() + rightSide);
+ case CSSSelector::ShadowContent:
+ return tagHistory->selectorText(" /content/ " + 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