| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSSelectorParser_h | 5 #ifndef CSSSelectorParser_h |
| 6 #define CSSSelectorParser_h | 6 #define CSSSelectorParser_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/parser/CSSParserSelector.h" | 9 #include "core/css/parser/CSSParserSelector.h" |
| 10 #include "core/css/parser/CSSParserTokenRange.h" | 10 #include "core/css/parser/CSSParserTokenRange.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const AtomicString& defaultNamespace() const; | 51 const AtomicString& defaultNamespace() const; |
| 52 const AtomicString& determineNamespace(const AtomicString& prefix); | 52 const AtomicString& determineNamespace(const AtomicString& prefix); |
| 53 void prependTypeSelectorIfNeeded(const AtomicString& namespacePrefix, const
AtomicString& elementName, CSSParserSelector*); | 53 void prependTypeSelectorIfNeeded(const AtomicString& namespacePrefix, const
AtomicString& elementName, CSSParserSelector*); |
| 54 void rewriteSpecifiersWithElementNameForCustomPseudoElement(const QualifiedN
ame& tag, CSSParserSelector*, bool tagIsImplicit); | 54 void rewriteSpecifiersWithElementNameForCustomPseudoElement(const QualifiedN
ame& tag, CSSParserSelector*, bool tagIsImplicit); |
| 55 void rewriteSpecifiersWithElementNameForContentPseudoElement(const Qualified
Name& tag, CSSParserSelector*, bool tagIsImplicit); | 55 void rewriteSpecifiersWithElementNameForContentPseudoElement(const Qualified
Name& tag, CSSParserSelector*, bool tagIsImplicit); |
| 56 static PassOwnPtr<CSSParserSelector> addSimpleSelectorToCompound(PassOwnPtr<
CSSParserSelector> compoundSelector, PassOwnPtr<CSSParserSelector> simpleSelecto
r); | 56 static PassOwnPtr<CSSParserSelector> addSimpleSelectorToCompound(PassOwnPtr<
CSSParserSelector> compoundSelector, PassOwnPtr<CSSParserSelector> simpleSelecto
r); |
| 57 | 57 |
| 58 const CSSParserContext& m_context; | 58 const CSSParserContext& m_context; |
| 59 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; // FIXME: Should be con
st | 59 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; // FIXME: Should be con
st |
| 60 | 60 |
| 61 bool m_failedParsing; | 61 bool m_failedParsing = false; |
| 62 bool m_disallowPseudoElements = false; |
| 63 |
| 64 class DisallowPseudoElementsScope { |
| 65 STACK_ALLOCATED(); |
| 66 WTF_MAKE_NONCOPYABLE(DisallowPseudoElementsScope); |
| 67 public: |
| 68 DisallowPseudoElementsScope(CSSSelectorParser* parser) |
| 69 : m_parser(parser), m_wasDisallowed(m_parser->m_disallowPseudoElemen
ts) |
| 70 { |
| 71 m_parser->m_disallowPseudoElements = true; |
| 72 } |
| 73 |
| 74 ~DisallowPseudoElementsScope() |
| 75 { |
| 76 m_parser->m_disallowPseudoElements = m_wasDisallowed; |
| 77 } |
| 78 |
| 79 private: |
| 80 CSSSelectorParser* m_parser; |
| 81 bool m_wasDisallowed; |
| 82 }; |
| 62 }; | 83 }; |
| 63 | 84 |
| 64 } // namespace | 85 } // namespace |
| 65 | 86 |
| 66 #endif // CSSSelectorParser_h | 87 #endif // CSSSelectorParser_h |
| OLD | NEW |