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

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

Issue 2310823002: Skeleton implementation of CSS Properties and Values API (Closed)
Patch Set: fix stylevardata copy ctor Created 4 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CSSSyntaxDescriptor_h
6 #define CSSSyntaxDescriptor_h
7
8 #include "core/css/parser/CSSParserTokenRange.h"
9
10 namespace blink {
11
12 class CSSValue;
13
14 enum class CSSSyntaxType {
15 TokenStream,
16 Length,
17 // TODO(timloh): Add all the other types
18 };
19
20 struct CSSSyntaxComponent {
21 CSSSyntaxComponent(CSSSyntaxType type)
22 : m_type(type)
23 {
24 }
25
26 CSSSyntaxType m_type;
27 // TODO(timloh): This will need to support arbitrary idents and list types
28 };
29
30 class CSSSyntaxDescriptor {
31 public:
32 CSSSyntaxDescriptor(String syntax);
33
34 const CSSValue* parse(CSSParserTokenRange) const;
35 const CSSValue* parse(const String&) const;
36 bool isValid() const { return !m_syntaxComponents.isEmpty(); }
37 bool isTokenStream() const { return m_syntaxComponents.size() == 1 && m_synt axComponents[0].m_type == CSSSyntaxType::TokenStream; }
38
39 private:
40 Vector<CSSSyntaxComponent> m_syntaxComponents;
41 };
42
43 } // namespace blink
44
45 #endif // CSSSyntaxDescriptor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698