| 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 PropertyRegistration_h | 5 #ifndef PropertyRegistration_h |
| 6 #define PropertyRegistration_h | 6 #define PropertyRegistration_h |
| 7 | 7 |
| 8 #include "core/animation/InterpolationType.h" |
| 9 #include "core/animation/InterpolationTypesMap.h" |
| 10 #include "core/css/CSSSyntaxDescriptor.h" |
| 11 #include "core/css/CSSValue.h" |
| 12 #include "core/css/CSSVariableData.h" |
| 8 #include "wtf/Allocator.h" | 13 #include "wtf/Allocator.h" |
| 14 #include "wtf/RefPtr.h" |
| 9 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
| 10 | 16 |
| 11 namespace blink { | 17 namespace blink { |
| 12 | 18 |
| 13 class ExceptionState; | 19 class ExceptionState; |
| 14 class PropertyDescriptor; | 20 class PropertyDescriptor; |
| 15 class ScriptState; | 21 class ScriptState; |
| 16 | 22 |
| 17 class PropertyRegistration { | 23 class PropertyRegistration |
| 18 STATIC_ONLY(PropertyRegistration); | 24 : public GarbageCollectedFinalized<PropertyRegistration> { |
| 19 | |
| 20 public: | 25 public: |
| 21 static void registerProperty(ScriptState*, | 26 static void registerProperty(ScriptState*, |
| 22 const PropertyDescriptor&, | 27 const PropertyDescriptor&, |
| 23 ExceptionState&); | 28 ExceptionState&); |
| 29 |
| 30 PropertyRegistration(const CSSSyntaxDescriptor& syntax, |
| 31 bool inherits, |
| 32 const CSSValue* initial, |
| 33 PassRefPtr<CSSVariableData> initialVariableData, |
| 34 InterpolationTypes interpolationTypes) |
| 35 : m_syntax(syntax), |
| 36 m_inherits(inherits), |
| 37 m_initial(initial), |
| 38 m_initialVariableData(initialVariableData), |
| 39 m_interpolationTypes(std::move(interpolationTypes)) {} |
| 40 |
| 41 const CSSSyntaxDescriptor& syntax() const { return m_syntax; } |
| 42 bool inherits() const { return m_inherits; } |
| 43 const CSSValue* initial() const { return m_initial; } |
| 44 CSSVariableData* initialVariableData() const { |
| 45 return m_initialVariableData.get(); |
| 46 } |
| 47 const InterpolationTypes& interpolationTypes() const { |
| 48 return m_interpolationTypes; |
| 49 } |
| 50 |
| 51 DEFINE_INLINE_TRACE() { visitor->trace(m_initial); } |
| 52 |
| 53 private: |
| 54 const CSSSyntaxDescriptor m_syntax; |
| 55 const bool m_inherits; |
| 56 const Member<const CSSValue> m_initial; |
| 57 const RefPtr<CSSVariableData> m_initialVariableData; |
| 58 const InterpolationTypes m_interpolationTypes; |
| 24 }; | 59 }; |
| 25 | 60 |
| 26 } // namespace blink | 61 } // namespace blink |
| 27 | 62 |
| 28 #endif // PropertyRegistration_h | 63 #endif // PropertyRegistration_h |
| OLD | NEW |