OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CSSPositionValue_h | 5 #ifndef CSSPositionValue_h |
6 #define CSSPositionValue_h | 6 #define CSSPositionValue_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/css/cssom/StyleValue.h" | 10 #include "core/css/cssom/CSSStyleValue.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class CSSLengthValue; | 14 class CSSLengthValue; |
15 | 15 |
16 class CORE_EXPORT CSSPositionValue final : public StyleValue { | 16 class CORE_EXPORT CSSPositionValue final : public CSSStyleValue { |
17 WTF_MAKE_NONCOPYABLE(CSSPositionValue); | 17 WTF_MAKE_NONCOPYABLE(CSSPositionValue); |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 19 public: |
20 static CSSPositionValue* create(const CSSLengthValue* x, const CSSLengthValu
e* y) | 20 static CSSPositionValue* create(const CSSLengthValue* x, const CSSLengthValu
e* y) |
21 { | 21 { |
22 return new CSSPositionValue(x, y); | 22 return new CSSPositionValue(x, y); |
23 } | 23 } |
24 | 24 |
25 // Bindings require a non const return value. | 25 // Bindings require a non const return value. |
26 CSSLengthValue* x() const { return const_cast<CSSLengthValue*>(m_x.get()); } | 26 CSSLengthValue* x() const { return const_cast<CSSLengthValue*>(m_x.get()); } |
27 CSSLengthValue* y() const { return const_cast<CSSLengthValue*>(m_y.get()); } | 27 CSSLengthValue* y() const { return const_cast<CSSLengthValue*>(m_y.get()); } |
28 | 28 |
29 StyleValueType type() const override { return PositionType; } | 29 StyleValueType type() const override { return PositionType; } |
30 | 30 |
31 CSSValue* toCSSValue() const override; | 31 CSSValue* toCSSValue() const override; |
32 | 32 |
33 DEFINE_INLINE_VIRTUAL_TRACE() | 33 DEFINE_INLINE_VIRTUAL_TRACE() |
34 { | 34 { |
35 visitor->trace(m_x); | 35 visitor->trace(m_x); |
36 visitor->trace(m_y); | 36 visitor->trace(m_y); |
37 StyleValue::trace(visitor); | 37 CSSStyleValue::trace(visitor); |
38 } | 38 } |
39 | 39 |
40 protected: | 40 protected: |
41 CSSPositionValue(const CSSLengthValue* x, const CSSLengthValue* y) | 41 CSSPositionValue(const CSSLengthValue* x, const CSSLengthValue* y) |
42 : m_x(x) | 42 : m_x(x) |
43 , m_y(y) | 43 , m_y(y) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 Member<const CSSLengthValue> m_x; | 47 Member<const CSSLengthValue> m_x; |
48 Member<const CSSLengthValue> m_y; | 48 Member<const CSSLengthValue> m_y; |
49 | 49 |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif | 54 #endif |
OLD | NEW |