Index: Source/core/css/CSSCustomVariableValue.h |
diff --git a/Source/core/css/CSSCustomVariableValue.h b/Source/core/css/CSSCustomVariableValue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e5de73bb90ea3a83ea2123a905c55b407339db8c |
--- /dev/null |
+++ b/Source/core/css/CSSCustomVariableValue.h |
@@ -0,0 +1,62 @@ |
+// 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 CSSCustomVariableValue_h |
+#define CSSCustomVariableValue_h |
+ |
+#include "core/css/CSSValue.h" |
+#include "core/css/CSSVariableData.h" |
+#include "wtf/RefPtr.h" |
+#include "wtf/text/AtomicString.h" |
+ |
+namespace blink { |
+ |
+class CSSCustomVariableValue : public CSSValue { |
+public: |
+ static PassRefPtrWillBeRawPtr<CSSCustomVariableValue> create(const AtomicString& name, PassRefPtr<CSSVariableData> value) |
+ { |
+ return adoptRefWillBeNoop(new CSSCustomVariableValue(name, value)); |
+ } |
+ |
+ static PassRefPtrWillBeRawPtr<CSSCustomVariableValue> create(const AtomicString& name, CSSValueID id) |
+ { |
+ return adoptRefWillBeNoop(new CSSCustomVariableValue(name, id)); |
+ } |
+ |
+ const AtomicString& name() const { return m_name; } |
+ CSSVariableData* value() const { return m_value.get(); } |
+ CSSValueID id() const { return m_valueId; } |
+ |
+ bool equals(const CSSCustomVariableValue& other) const { return this == &other; } |
+ |
+ void traceAfterDispatch(Visitor* visitor) { CSSValue::traceAfterDispatch(visitor); } |
+ |
+private: |
+ CSSCustomVariableValue(const AtomicString& name, CSSValueID id) |
+ : CSSValue(VariableClass) |
+ , m_name(name) |
+ , m_value(nullptr) |
+ , m_valueId(id) |
+ { |
+ ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset); |
+ } |
+ |
+ CSSCustomVariableValue(const AtomicString& name, PassRefPtr<CSSVariableData> value) |
+ : CSSValue(VariableClass) |
+ , m_name(name) |
+ , m_value(value) |
+ , m_valueId(CSSValueInternalVariableValue) |
+ { |
+ } |
+ |
+ const AtomicString m_name; |
+ RefPtr<CSSVariableData> m_value; |
+ CSSValueID m_valueId; |
+}; |
+ |
+DEFINE_CSS_VALUE_TYPE_CASTS(CSSCustomVariableValue, isVariableValue()); |
+ |
+} // namespace blink |
+ |
+#endif // CSSCustomVariableValue_h |