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 TransformValue_h | |
6 #define TransformValue_h | |
7 | |
8 #include "bindings/core/v8/Iterable.h" | |
9 #include "bindings/core/v8/ScriptWrappable.h" | |
10 #include "core/CoreExport.h" | |
11 #include "core/css/cssom/CSSStyleValue.h" | |
12 #include "core/css/cssom/CSSTransformComponent.h" | |
13 #include "platform/heap/HeapAllocator.h" | |
14 | |
15 namespace blink { | |
16 | |
17 class CORE_EXPORT TransformValue final : public CSSStyleValue, public ValueItera
ble<CSSTransformComponent*> { | |
18 WTF_MAKE_NONCOPYABLE(TransformValue); | |
19 DEFINE_WRAPPERTYPEINFO(); | |
20 public: | |
21 static TransformValue* create() | |
22 { | |
23 return new TransformValue(); | |
24 } | |
25 | |
26 static TransformValue* create(const HeapVector<Member<CSSTransformComponent>
>& transformComponents) | |
27 { | |
28 return new TransformValue(transformComponents); | |
29 } | |
30 | |
31 static TransformValue* fromCSSValue(const CSSValue&); | |
32 | |
33 bool is2D() const; | |
34 | |
35 CSSValue* toCSSValue() const override; | |
36 | |
37 StyleValueType type() const override { return TransformType; } | |
38 | |
39 CSSTransformComponent* componentAtIndex(int index) { return m_transformCompo
nents.at(index); } | |
40 | |
41 size_t size() { return m_transformComponents.size(); } | |
42 | |
43 DEFINE_INLINE_VIRTUAL_TRACE() | |
44 { | |
45 visitor->trace(m_transformComponents); | |
46 CSSStyleValue::trace(visitor); | |
47 } | |
48 | |
49 private: | |
50 TransformValue() {} | |
51 TransformValue(const HeapVector<Member<CSSTransformComponent>>& transformCom
ponents) : CSSStyleValue(), | |
52 m_transformComponents(transformComponents) {} | |
53 | |
54 HeapVector<Member<CSSTransformComponent>> m_transformComponents; | |
55 | |
56 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | |
57 }; | |
58 | |
59 } // namespace blink | |
60 | |
61 #endif | |
OLD | NEW |