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..67da6a59240ca2c55d1b39c13ebe257e520f85ea |
| --- /dev/null |
| +++ b/Source/core/css/CSSVariableData.h |
| @@ -0,0 +1,55 @@ |
| +// 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 "core/css/parser/CSSParserTokenRange.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, bool needsVariableResolution = true) |
| + { |
| + return adoptRef(new CSSVariableData(range, needsVariableResolution)); |
| + } |
| + |
| + static PassRefPtr<CSSVariableData> createResolved(const Vector<CSSParserToken>& resolvedTokens) |
| + { |
| + return adoptRef(new CSSVariableData(resolvedTokens)); |
| + } |
|
alancutter (OOO until 2018)
2015/08/25 01:59:08
Minor nit: createResolved() seems out of place wit
|
| + |
| + CSSParserTokenRange tokenRange() { return m_tokens; } |
| + |
| + const Vector<CSSParserToken>& tokens() { return m_tokens; } |
| + |
| + bool needsVariableResolution() const { return m_needsVariableResolution; } |
| + void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVariableResolution = needsVariableResolution; } |
|
Timothy Loh
2015/08/25 09:21:10
unused
|
| + |
| + String string() const { return m_string; } |
|
Timothy Loh
2015/08/25 09:21:10
unused
|
| +private: |
| + CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution); |
| + CSSVariableData(const Vector<CSSParserToken>& resolvedTokens) |
| + : m_tokens(resolvedTokens) |
| + , m_needsVariableResolution(false) |
| + { } |
| + |
| + template<typename CharacterType> void consumeAndUpdateTokens(const CSSParserTokenRange&); |
| + |
| + String m_string; |
|
Timothy Loh
2015/08/25 09:21:10
const everywhere?
|
| + Vector<CSSParserToken> m_tokens; |
| + bool m_needsVariableResolution; |
|
Timothy Loh
2015/08/25 09:21:10
m_hasVarFunction?
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CSSVariableData_h |