Chromium Code Reviews| 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 CSSVariableValue_h | |
| 6 #define CSSVariableValue_h | |
| 7 | |
| 8 #include "core/css/CSSValue.h" | |
| 9 #include "core/css/CSSVariableData.h" | |
| 10 #include "wtf/RefPtr.h" | |
| 11 #include "wtf/text/AtomicString.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class CSSVariableValue : public CSSValue { | |
|
alancutter (OOO until 2018)
2015/06/26 06:56:07
I'd call this CSSCustomPropertyValue to stay close
| |
| 16 public: | |
| 17 static PassRefPtrWillBeRawPtr<CSSVariableValue> create(const AtomicString& n ame, PassRefPtr<CSSVariableData> value) | |
| 18 { | |
| 19 return adoptRefWillBeNoop(new CSSVariableValue(name, value)); | |
| 20 } | |
| 21 | |
| 22 static PassRefPtrWillBeRawPtr<CSSVariableValue> create(const AtomicString& n ame, CSSValueID id) | |
| 23 { | |
| 24 return adoptRefWillBeNoop(new CSSVariableValue(name, id)); | |
| 25 } | |
| 26 | |
| 27 const AtomicString& name() const { return m_name; } | |
| 28 CSSVariableData* value() const { return m_value.get(); } | |
| 29 CSSValueID id() const { return m_valueId; } | |
| 30 | |
| 31 bool equals(const CSSVariableValue& other) const { return this == &other; } | |
| 32 | |
| 33 void traceAfterDispatch(Visitor* visitor) { CSSValue::traceAfterDispatch(vis itor); } | |
| 34 | |
| 35 private: | |
| 36 CSSVariableValue(const AtomicString& name, CSSValueID id) | |
| 37 : CSSValue(VariableClass) | |
| 38 , m_name(name) | |
| 39 , m_value(nullptr) | |
| 40 , m_valueId(id) | |
| 41 { | |
| 42 ASSERT(id == CSSValueInherit || id == CSSValueInitial); | |
| 43 } | |
| 44 | |
| 45 CSSVariableValue(const AtomicString& name, PassRefPtr<CSSVariableData> v alue) | |
| 46 : CSSValue(VariableClass) | |
| 47 , m_name(name) | |
| 48 , m_value(value) | |
| 49 , m_valueId(CSSValueInternalVariableValue) | |
| 50 { | |
| 51 } | |
| 52 | |
| 53 const AtomicString m_name; | |
| 54 RefPtr<CSSVariableData> m_value; | |
| 55 CSSValueID m_valueId; | |
| 56 }; | |
| 57 | |
| 58 DEFINE_CSS_VALUE_TYPE_CASTS(CSSVariableValue, isVariableValue()); | |
| 59 | |
| 60 } // namespace blink | |
| 61 | |
| 62 #endif // CSSVariableValue_h | |
| OLD | NEW |