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

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

Issue 21151005: Implement ::content (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 4 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/CSSSelectorList.cpp ('k') | Source/core/css/SelectorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 1b80f44312dcbcf29d4abd2eca64197334c50687..03d9571ed64f1b8c34bae204d73a2b7b68bb0d4e 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -108,6 +108,9 @@ SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& con
if (context.selector->isCustomPseudoElement()) {
if (!matchesCustomPseudoElement(context.element, context.selector))
return SelectorFailsLocally;
+ } else if (context.selector->isContentPseudoElement()) {
+ if (!context.element->isInShadowTree() || !context.element->isInsertionPoint())
+ return SelectorFailsLocally;
} else {
if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode == QueryingRules)
return SelectorFailsLocally;
@@ -157,7 +160,7 @@ SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& con
switch (relation) {
case CSSSelector::Descendant:
- if (context.selector->relationIsForShadowDistributed()) {
+ if (context.selector->relationIsAffectedByPseudoContent()) {
for (Element* element = context.element; element; element = element->parentElement()) {
if (matchForShadowDistributed(element, siblingTraversalStrategy, ignoreDynamicPseudo, nextContext) == SelectorMatches)
return SelectorMatches;
@@ -176,7 +179,7 @@ SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& con
}
return SelectorFailsCompletely;
case CSSSelector::Child:
- if (context.selector->relationIsForShadowDistributed())
+ if (context.selector->relationIsAffectedByPseudoContent())
return matchForShadowDistributed(context.element, siblingTraversalStrategy, ignoreDynamicPseudo, nextContext);
nextContext.element = context.element->parentElement();
if (!nextContext.element)
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/SelectorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698