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/CSSTokenizer.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,
bool needsVariableResolution = true) |
| 21 { |
| 22 return adoptRef(new CSSVariableData(range, needsVariableResolution)); |
| 23 } |
| 24 |
| 25 Vector<CSSParserToken>& tokens() { return m_tokens; } |
| 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&, bool needsVariableResolution); |
| 33 |
| 34 template<typename CharacterType> void consumeAndUpdateTokens(const CSSParser
TokenRange&); |
| 35 |
| 36 String m_string; |
| 37 Vector<String> m_stringPool; |
| 38 Vector<CSSParserToken> m_tokens; |
| 39 bool m_needsVariableResolution : 1; |
| 40 bool m_important : 1; |
| 41 }; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif // CSSVariableData_h |
OLD | NEW |