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