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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.h

Issue 2561773003: Parse input argument types and store the argument types in CSSPaintDefinition. (Closed)
Patch Set: update tests Created 3 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 unified diff | Download patch
OLDNEW
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 21 matching lines...) Expand all
32 32
33 struct CSSSyntaxComponent { 33 struct CSSSyntaxComponent {
34 CSSSyntaxComponent(CSSSyntaxType type, const String& string, bool repeatable) 34 CSSSyntaxComponent(CSSSyntaxType type, const String& string, bool repeatable)
35 : m_type(type), m_string(string), m_repeatable(repeatable) {} 35 : m_type(type), m_string(string), m_repeatable(repeatable) {}
36 36
37 CSSSyntaxType m_type; 37 CSSSyntaxType m_type;
38 String m_string; // Only used when m_type is CSSSyntaxType::Ident 38 String m_string; // Only used when m_type is CSSSyntaxType::Ident
39 bool m_repeatable; 39 bool m_repeatable;
40 }; 40 };
41 41
42 class CSSSyntaxDescriptor { 42 class CORE_EXPORT CSSSyntaxDescriptor {
43 public: 43 public:
44 CSSSyntaxDescriptor(String syntax); 44 CSSSyntaxDescriptor(String syntax);
45 45
46 const CSSValue* parse(CSSParserTokenRange, 46 const CSSValue* parse(CSSParserTokenRange,
47 const CSSParserContext*, 47 const CSSParserContext*,
48 bool isAnimationTainted) const; 48 bool isAnimationTainted) const;
49 bool isValid() const { return !m_syntaxComponents.isEmpty(); } 49 bool isValid() const { return !m_syntaxComponents.isEmpty(); }
50 bool isTokenStream() const { 50 bool isTokenStream() const {
51 return m_syntaxComponents.size() == 1 && 51 return m_syntaxComponents.size() == 1 &&
52 m_syntaxComponents[0].m_type == CSSSyntaxType::TokenStream; 52 m_syntaxComponents[0].m_type == CSSSyntaxType::TokenStream;
53 } 53 }
54 54
55 private: 55 private:
56 Vector<CSSSyntaxComponent> m_syntaxComponents; 56 Vector<CSSSyntaxComponent> m_syntaxComponents;
57 }; 57 };
58 58
59 } // namespace blink 59 } // namespace blink
60 60
61 #endif // CSSSyntaxDescriptor_h 61 #endif // CSSSyntaxDescriptor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698