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

Unified Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 208933006: Only :host and :ancestor should ever match the host in a ShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test for :first-child too 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/SelectorChecker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/BisonCSSParser-in.cpp
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index 8ab5561a934df07b7f2c67e060129f53b35a1b19..fcf9b9e36d49f0c7165c6139c3228b26678804ae 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -1934,9 +1934,11 @@ CSSParserSelector* BisonCSSParser::rewriteSpecifiersWithElementName(const Atomic
if (specifiers->needsCrossingTreeScopeBoundary())
return rewriteSpecifiersWithElementNameForCustomPseudoElement(tag, elementName, specifiers, tagIsForNamespaceRule);
- if (tag == anyQName())
+ // *:host never matches, so we can't discard the * otherwise we can't tell the
+ // difference between *:host and just :host.
+ if (tag == anyQName() && !specifiers->hasHostPseudoSelector())
return specifiers;
- if (!(specifiers->pseudoType() == CSSSelector::PseudoCue))
+ if (specifiers->pseudoType() != CSSSelector::PseudoCue)
specifiers->prependTagSelector(tag, tagIsForNamespaceRule);
return specifiers;
}
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698