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 "wtf/RefCounted.h" | |
10 #include "wtf/text/WTFString.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class CSSParserTokenRange; | |
15 | |
16 class CSSVariableData : public RefCounted<CSSVariableData> { | |
17 WTF_MAKE_NONCOPYABLE(CSSVariableData); | |
18 WTF_MAKE_FAST_ALLOCATED(CSSVariableData); | |
19 public: | |
20 static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, const String& baseString, bool needsVariableResolution = true) | |
21 { | |
22 return adoptRef(new CSSVariableData(range, baseString, needsVariableReso lution)); | |
23 } | |
24 | |
25 Vector<CSSParserToken>& tokens() { return m_tokens; } | |
Timothy Loh
2015/07/23 08:11:46
better to return a CSSParserTokenRange
leviw_travelin_and_unemployed
2015/08/04 00:42:20
I believe change this will result in a lot of extr
| |
26 | |
27 bool needsVariableResolution() const { return m_needsVariableResolution; } | |
28 void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVaria bleResolution = needsVariableResolution; } | |
29 | |
30 String string() const { return m_string; } | |
31 private: | |
32 CSSVariableData(const CSSParserTokenRange&, const String&, bool needsVariabl eResolution); | |
33 | |
34 template<typename CharacterType> void consumeAndUpdateTokens(const CSSParser TokenRange&, const String&); | |
35 | |
36 String m_string; | |
Timothy Loh
2015/07/23 08:11:46
Probably nicer if we just join all the token strin
leviw_travelin_and_unemployed
2015/08/04 00:42:20
Makes sense.
| |
37 Vector<String> m_stringPool; | |
38 Vector<CSSParserToken> m_tokens; | |
39 bool m_needsVariableResolution; | |
40 }; | |
41 | |
42 } // namespace blink | |
43 | |
44 #endif // CSSVariableData_h | |
OLD | NEW |