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