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 |