| 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 CSSTransformValue_h | 5 #ifndef CSSTransformValue_h |
| 6 #define CSSTransformValue_h | 6 #define CSSTransformValue_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/cssom/CSSStyleValue.h" | 9 #include "core/css/cssom/CSSStyleValue.h" |
| 10 #include "core/css/cssom/CSSTransformComponent.h" | 10 #include "core/css/cssom/CSSTransformComponent.h" |
| 11 #include "platform/bindings/ScriptWrappable.h" | 11 #include "platform/bindings/ScriptWrappable.h" |
| 12 #include "platform/heap/HeapAllocator.h" | 12 #include "platform/heap/HeapAllocator.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class DOMMatrix; |
| 17 |
| 16 class CORE_EXPORT CSSTransformValue final : public CSSStyleValue { | 18 class CORE_EXPORT CSSTransformValue final : public CSSStyleValue { |
| 17 WTF_MAKE_NONCOPYABLE(CSSTransformValue); | 19 WTF_MAKE_NONCOPYABLE(CSSTransformValue); |
| 18 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 19 | 21 |
| 20 public: | 22 public: |
| 21 static CSSTransformValue* Create() { return new CSSTransformValue(); } | 23 static CSSTransformValue* Create() { return new CSSTransformValue(); } |
| 22 | 24 |
| 23 static CSSTransformValue* Create( | 25 static CSSTransformValue* Create( |
| 24 const HeapVector<Member<CSSTransformComponent>>& transform_components) { | 26 const HeapVector<Member<CSSTransformComponent>>& transform_components) { |
| 25 return new CSSTransformValue(transform_components); | 27 return new CSSTransformValue(transform_components); |
| 26 } | 28 } |
| 27 | 29 |
| 28 static CSSTransformValue* FromCSSValue(const CSSValue&); | 30 static CSSTransformValue* FromCSSValue(const CSSValue&); |
| 29 | 31 |
| 30 bool is2D() const; | 32 bool is2D() const; |
| 31 | 33 |
| 34 DOMMatrix* toMatrix() const; |
| 35 |
| 32 const CSSValue* ToCSSValue() const override; | 36 const CSSValue* ToCSSValue() const override; |
| 33 | 37 |
| 34 StyleValueType GetType() const override { return kTransformType; } | 38 StyleValueType GetType() const override { return kTransformType; } |
| 35 | 39 |
| 36 CSSTransformComponent* componentAtIndex(uint32_t index) { | 40 CSSTransformComponent* componentAtIndex(uint32_t index) { |
| 37 return transform_components_.at(index); | 41 return transform_components_.at(index); |
| 38 } | 42 } |
| 39 | 43 |
| 40 size_t length() const { return transform_components_.size(); } | 44 size_t length() const { return transform_components_.size(); } |
| 41 | 45 |
| 42 DEFINE_INLINE_VIRTUAL_TRACE() { | 46 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 43 visitor->Trace(transform_components_); | 47 visitor->Trace(transform_components_); |
| 44 CSSStyleValue::Trace(visitor); | 48 CSSStyleValue::Trace(visitor); |
| 45 } | 49 } |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 CSSTransformValue() {} | 52 CSSTransformValue() {} |
| 49 CSSTransformValue( | 53 CSSTransformValue( |
| 50 const HeapVector<Member<CSSTransformComponent>>& transform_components) | 54 const HeapVector<Member<CSSTransformComponent>>& transform_components) |
| 51 : CSSStyleValue(), transform_components_(transform_components) {} | 55 : CSSStyleValue(), transform_components_(transform_components) {} |
| 52 | 56 |
| 53 HeapVector<Member<CSSTransformComponent>> transform_components_; | 57 HeapVector<Member<CSSTransformComponent>> transform_components_; |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 } // namespace blink | 60 } // namespace blink |
| 57 | 61 |
| 58 #endif // CSSTransformValue_h | 62 #endif // CSSTransformValue_h |
| OLD | NEW |