Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/cssom/CSSStyleVariableReferenceValue.h |
| diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleVariableReferenceValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleVariableReferenceValue.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..85626ad6e0deccd416c171cc07b3c1af742b3327 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleVariableReferenceValue.h |
| @@ -0,0 +1,46 @@ |
| +#ifndef CSSStyleVariableReferenceValue_h |
|
Timothy Loh
2016/07/07 05:40:26
There's a 3-line license header to add on new file
anthonyhkf
2016/07/08 00:17:17
Done.
|
| +#define CSSStyleVariableReferenceValue_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/CSSPropertyNames.h" |
| +#include "core/CoreExport.h" |
| +#include "core/css/CSSValue.h" |
| + |
| +namespace blink { |
| + |
| +class CORE_EXPORT CSSStyleVariableReferenceValue final : public GarbageCollectedFinalized<CSSStyleVariableReferenceValue>, public ScriptWrappable { |
| + WTF_MAKE_NONCOPYABLE(CSSStyleVariableReferenceValue); |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + virtual ~CSSStyleVariableReferenceValue() { } |
| + |
| + static CSSStyleVariableReferenceValue* create() |
| + { |
| + return new CSSStyleVariableReferenceValue(); |
| + } |
| + |
| + // TODO(anthonyhkf): add fallback: create(variable, fallback) |
| + static CSSStyleVariableReferenceValue* create(const String& variable) |
| + { |
| + return new CSSStyleVariableReferenceValue(variable); |
| + } |
| + |
| + DEFINE_INLINE_TRACE() { } |
| + |
| + String variable() const { return m_variable; } |
|
Timothy Loh
2016/07/07 05:40:26
const String& is probably more common (maybe avoid
anthonyhkf
2016/07/08 00:17:17
Done.
|
| + |
| +protected: |
| + CSSStyleVariableReferenceValue() { } |
|
meade_UTC10
2016/07/07 05:30:30
We shouldn't have this empty constructor - m_varia
anthonyhkf
2016/07/08 00:17:17
Done.
|
| + |
| + CSSStyleVariableReferenceValue(String variable) |
| + { |
|
Timothy Loh
2016/07/07 05:40:26
Use an initializer list here, e.g.
CSSStyl..(..)
anthonyhkf
2016/07/08 00:17:17
Done.
|
| + m_variable = variable; |
| + } |
| + |
| + String m_variable; |
| + |
| +}; |
| + |
| +} |
|
Timothy Loh
2016/07/07 05:40:26
prevalent style is to write
} // namespace blink
anthonyhkf
2016/07/08 00:17:17
Done.
|
| + |
| +#endif |