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

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

Issue 1576553002: Pseudo element selectors in compound selector lists are invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review issues 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.h
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h
index ddf444ea61d81a86a698d0d4f2760886e03a94da..bf9bd41233778eb28a9b2dbca48586155e85b62f 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h
@@ -58,7 +58,28 @@ private:
const CSSParserContext& m_context;
RawPtrWillBeMember<StyleSheetContents> m_styleSheet; // FIXME: Should be const
- bool m_failedParsing;
+ bool m_failedParsing = false;
+ bool m_disallowPseudoElements = false;
+
+ class DisallowPseudoElementsScope {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(DisallowPseudoElementsScope);
+ public:
+ DisallowPseudoElementsScope(CSSSelectorParser* parser)
+ : m_parser(parser), m_wasDisallowed(m_parser->m_disallowPseudoElements)
+ {
+ m_parser->m_disallowPseudoElements = true;
+ }
+
+ ~DisallowPseudoElementsScope()
+ {
+ m_parser->m_disallowPseudoElements = m_wasDisallowed;
+ }
+
+ private:
+ CSSSelectorParser* m_parser;
+ bool m_wasDisallowed;
+ };
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698