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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp

Issue 1576553002: Pseudo element selectors in compound selector lists are invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
index bfd0f9fab4f5a90fbc5758c04248954b227fa73a..fda48705691bbdf542fd255ca204e15b3e9f51a2 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
@@ -78,9 +78,8 @@ CSSSelectorList CSSSelectorParser::parseSelector(CSSParserTokenRange range, cons
}
CSSSelectorParser::CSSSelectorParser(const CSSParserContext& context, StyleSheetContents* styleSheet)
-: m_context(context)
-, m_styleSheet(styleSheet)
-, m_failedParsing(false)
+ : m_context(context)
+ , m_styleSheet(styleSheet)
{
}
@@ -107,6 +106,8 @@ CSSSelectorList CSSSelectorParser::consumeComplexSelectorList(CSSParserTokenRang
CSSSelectorList CSSSelectorParser::consumeCompoundSelectorList(CSSParserTokenRange& range)
{
+ DisallowPseudoElementsScope scope(this);
Timothy Loh 2016/01/11 05:20:54 I think it would make more sense for this to be at
rune 2016/01/11 09:30:22 Done.
+
Vector<OwnPtr<CSSParserSelector>> selectorList;
OwnPtr<CSSParserSelector> selector = consumeCompoundSelector(range);
range.consumeWhitespace();
@@ -334,6 +335,9 @@ PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumePseudo(CSSParserTokenRan
bool hasArguments = token.type() == FunctionToken;
selector->updatePseudoType(AtomicString(value.is8Bit() ? value.lower() : value), hasArguments);
+ if (selector->match() == CSSSelector::PseudoElement && m_disallowPseudoElements)
+ return nullptr;
+
if (token.type() == IdentToken) {
range.consume();
if (selector->pseudoType() == CSSSelector::PseudoUnknown)

Powered by Google App Engine
This is Rietveld 408576698