Chromium Code Reviews| Index: Source/core/css/CSSVariableData.h |
| diff --git a/Source/core/css/CSSVariableData.h b/Source/core/css/CSSVariableData.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..88d07aee607e9d957ad1495faf2db9dffa9691c4 |
| --- /dev/null |
| +++ b/Source/core/css/CSSVariableData.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CSSVariableData_h |
| +#define CSSVariableData_h |
| + |
| +#include "core/css/parser/CSSParserToken.h" |
| +#include "wtf/RefCounted.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class CSSParserTokenRange; |
| + |
| +class CSSVariableData : public RefCounted<CSSVariableData> { |
| + WTF_MAKE_NONCOPYABLE(CSSVariableData); |
| + WTF_MAKE_FAST_ALLOCATED(CSSVariableData); |
| +public: |
| + static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, const String& baseString, bool needsVariableResolution = true) |
| + { |
| + return adoptRef(new CSSVariableData(range, baseString, needsVariableResolution)); |
| + } |
| + |
| + 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
|
| + |
| + bool needsVariableResolution() const { return m_needsVariableResolution; } |
| + void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVariableResolution = needsVariableResolution; } |
| + |
| + String string() const { return m_string; } |
| +private: |
| + CSSVariableData(const CSSParserTokenRange&, const String&, bool needsVariableResolution); |
| + |
| + template<typename CharacterType> void consumeAndUpdateTokens(const CSSParserTokenRange&, const String&); |
| + |
| + 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.
|
| + Vector<String> m_stringPool; |
| + Vector<CSSParserToken> m_tokens; |
| + bool m_needsVariableResolution; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CSSVariableData_h |