OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CSSVariableReferenceValue_h | 5 #ifndef CSSVariableReferenceValue_h |
6 #define CSSVariableReferenceValue_h | 6 #define CSSVariableReferenceValue_h |
7 | 7 |
8 #include "core/css/CSSValue.h" | 8 #include "core/css/CSSValue.h" |
9 #include "core/css/CSSVariableData.h" | 9 #include "core/css/CSSVariableData.h" |
10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class CSSVariableReferenceValue : public CSSValue { | 14 class CSSVariableReferenceValue : public CSSValue { |
15 public: | 15 public: |
16 static RawPtr<CSSVariableReferenceValue> create(PassRefPtr<CSSVariableData>
data) | 16 static CSSVariableReferenceValue* create(PassRefPtr<CSSVariableData> data) |
17 { | 17 { |
18 return new CSSVariableReferenceValue(data); | 18 return new CSSVariableReferenceValue(data); |
19 } | 19 } |
20 | 20 |
21 CSSVariableData* variableDataValue() const | 21 CSSVariableData* variableDataValue() const |
22 { | 22 { |
23 return m_data.get(); | 23 return m_data.get(); |
24 } | 24 } |
25 | 25 |
26 bool equals(const CSSVariableReferenceValue& other) const { return m_data ==
other.m_data; } | 26 bool equals(const CSSVariableReferenceValue& other) const { return m_data ==
other.m_data; } |
27 String customCSSText() const; | 27 String customCSSText() const; |
28 | 28 |
29 DECLARE_TRACE_AFTER_DISPATCH(); | 29 DECLARE_TRACE_AFTER_DISPATCH(); |
30 private: | 30 private: |
31 CSSVariableReferenceValue(PassRefPtr<CSSVariableData> data) | 31 CSSVariableReferenceValue(PassRefPtr<CSSVariableData> data) |
32 : CSSValue(VariableReferenceClass) | 32 : CSSValue(VariableReferenceClass) |
33 , m_data(data) | 33 , m_data(data) |
34 { | 34 { |
35 } | 35 } |
36 | 36 |
37 RefPtr<CSSVariableData> m_data; | 37 RefPtr<CSSVariableData> m_data; |
38 }; | 38 }; |
39 | 39 |
40 DEFINE_CSS_VALUE_TYPE_CASTS(CSSVariableReferenceValue, isVariableReferenceValue(
)); | 40 DEFINE_CSS_VALUE_TYPE_CASTS(CSSVariableReferenceValue, isVariableReferenceValue(
)); |
41 | 41 |
42 } // namespace blink | 42 } // namespace blink |
43 | 43 |
44 #endif // CSSVariableReferenceValue_h | 44 #endif // CSSVariableReferenceValue_h |
OLD | NEW |