OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 StyleRuleKeyframe_h | 5 #ifndef StyleRuleKeyframe_h |
6 #define StyleRuleKeyframe_h | 6 #define StyleRuleKeyframe_h |
7 | 7 |
8 #include "core/css/StyleRule.h" | 8 #include "core/css/StyleRule.h" |
9 #include <memory> | |
10 | 9 |
11 namespace blink { | 10 namespace blink { |
12 | 11 |
13 class MutableStylePropertySet; | 12 class MutableStylePropertySet; |
14 class StylePropertySet; | 13 class StylePropertySet; |
15 | 14 |
16 class StyleRuleKeyframe final : public StyleRuleBase { | 15 class StyleRuleKeyframe final : public StyleRuleBase { |
17 public: | 16 public: |
18 static StyleRuleKeyframe* create(std::unique_ptr<Vector<double>> keys, Style
PropertySet* properties) | 17 static StyleRuleKeyframe* create(PassOwnPtr<Vector<double>> keys, StylePrope
rtySet* properties) |
19 { | 18 { |
20 return new StyleRuleKeyframe(std::move(keys), properties); | 19 return new StyleRuleKeyframe(std::move(keys), properties); |
21 } | 20 } |
22 | 21 |
23 // Exposed to JavaScript. | 22 // Exposed to JavaScript. |
24 String keyText() const; | 23 String keyText() const; |
25 bool setKeyText(const String&); | 24 bool setKeyText(const String&); |
26 | 25 |
27 // Used by StyleResolver. | 26 // Used by StyleResolver. |
28 const Vector<double>& keys() const; | 27 const Vector<double>& keys() const; |
29 | 28 |
30 const StylePropertySet& properties() const { return *m_properties; } | 29 const StylePropertySet& properties() const { return *m_properties; } |
31 MutableStylePropertySet& mutableProperties(); | 30 MutableStylePropertySet& mutableProperties(); |
32 | 31 |
33 String cssText() const; | 32 String cssText() const; |
34 | 33 |
35 DECLARE_TRACE_AFTER_DISPATCH(); | 34 DECLARE_TRACE_AFTER_DISPATCH(); |
36 | 35 |
37 private: | 36 private: |
38 StyleRuleKeyframe(std::unique_ptr<Vector<double>>, StylePropertySet*); | 37 StyleRuleKeyframe(PassOwnPtr<Vector<double>>, StylePropertySet*); |
39 | 38 |
40 Member<StylePropertySet> m_properties; | 39 Member<StylePropertySet> m_properties; |
41 Vector<double> m_keys; | 40 Vector<double> m_keys; |
42 }; | 41 }; |
43 | 42 |
44 DEFINE_STYLE_RULE_TYPE_CASTS(Keyframe); | 43 DEFINE_STYLE_RULE_TYPE_CASTS(Keyframe); |
45 | 44 |
46 } // namespace blink | 45 } // namespace blink |
47 | 46 |
48 #endif // StyleRuleKeyframe_h | 47 #endif // StyleRuleKeyframe_h |
OLD | NEW |