OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CSSSyntaxDescriptor_h | 5 #ifndef CSSSyntaxDescriptor_h |
6 #define CSSSyntaxDescriptor_h | 6 #define CSSSyntaxDescriptor_h |
7 | 7 |
8 #include "core/css/parser/CSSParserTokenRange.h" | 8 #include "core/css/parser/CSSParserTokenRange.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 29 matching lines...) Expand all Loading... |
40 CSSSyntaxType m_type; | 40 CSSSyntaxType m_type; |
41 String m_string; // Only used when m_type is CSSSyntaxType::Ident | 41 String m_string; // Only used when m_type is CSSSyntaxType::Ident |
42 bool m_repeatable; | 42 bool m_repeatable; |
43 }; | 43 }; |
44 | 44 |
45 class CSSSyntaxDescriptor { | 45 class CSSSyntaxDescriptor { |
46 public: | 46 public: |
47 CSSSyntaxDescriptor(String syntax); | 47 CSSSyntaxDescriptor(String syntax); |
48 | 48 |
49 const CSSValue* parse(CSSParserTokenRange) const; | 49 const CSSValue* parse(CSSParserTokenRange) const; |
50 const CSSValue* parse(const String&) const; | |
51 bool isValid() const { return !m_syntaxComponents.isEmpty(); } | 50 bool isValid() const { return !m_syntaxComponents.isEmpty(); } |
52 bool isTokenStream() const { return m_syntaxComponents.size() == 1 && m_synt
axComponents[0].m_type == CSSSyntaxType::TokenStream; } | 51 bool isTokenStream() const { return m_syntaxComponents.size() == 1 && m_synt
axComponents[0].m_type == CSSSyntaxType::TokenStream; } |
53 | 52 |
54 private: | 53 private: |
55 Vector<CSSSyntaxComponent> m_syntaxComponents; | 54 Vector<CSSSyntaxComponent> m_syntaxComponents; |
56 }; | 55 }; |
57 | 56 |
58 } // namespace blink | 57 } // namespace blink |
59 | 58 |
60 #endif // CSSSyntaxDescriptor_h | 59 #endif // CSSSyntaxDescriptor_h |
OLD | NEW |