OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CSSVariableData_h | |
6 #define CSSVariableData_h | |
7 | |
8 #include "core/css/parser/CSSParserToken.h" | |
9 #include "core/css/parser/CSSParserTokenRange.h" | |
10 #include "wtf/RefCounted.h" | |
11 #include "wtf/text/WTFString.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class CSSParserTokenRange; | |
16 | |
17 class CSSVariableData : public RefCounted<CSSVariableData> { | |
18 WTF_MAKE_NONCOPYABLE(CSSVariableData); | |
19 WTF_MAKE_FAST_ALLOCATED(CSSVariableData); | |
20 public: | |
21 static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, bool needsVariableResolution = true) | |
22 { | |
23 return adoptRef(new CSSVariableData(range, needsVariableResolution)); | |
24 } | |
25 | |
26 static PassRefPtr<CSSVariableData> createResolved(const Vector<CSSParserToke n>& resolvedTokens) | |
27 { | |
28 return adoptRef(new CSSVariableData(resolvedTokens)); | |
29 } | |
alancutter (OOO until 2018)
2015/08/25 01:59:08
Minor nit: createResolved() seems out of place wit
| |
30 | |
31 CSSParserTokenRange tokenRange() { return m_tokens; } | |
32 | |
33 const Vector<CSSParserToken>& tokens() { return m_tokens; } | |
34 | |
35 bool needsVariableResolution() const { return m_needsVariableResolution; } | |
36 void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVaria bleResolution = needsVariableResolution; } | |
Timothy Loh
2015/08/25 09:21:10
unused
| |
37 | |
38 String string() const { return m_string; } | |
Timothy Loh
2015/08/25 09:21:10
unused
| |
39 private: | |
40 CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution); | |
41 CSSVariableData(const Vector<CSSParserToken>& resolvedTokens) | |
42 : m_tokens(resolvedTokens) | |
43 , m_needsVariableResolution(false) | |
44 { } | |
45 | |
46 template<typename CharacterType> void consumeAndUpdateTokens(const CSSParser TokenRange&); | |
47 | |
48 String m_string; | |
Timothy Loh
2015/08/25 09:21:10
const everywhere?
| |
49 Vector<CSSParserToken> m_tokens; | |
50 bool m_needsVariableResolution; | |
Timothy Loh
2015/08/25 09:21:10
m_hasVarFunction?
| |
51 }; | |
52 | |
53 } // namespace blink | |
54 | |
55 #endif // CSSVariableData_h | |
OLD | NEW |