OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void AttachToSVGElementAttribute(SVGElement* context_element, | 63 void AttachToSVGElementAttribute(SVGElement* context_element, |
64 const QualifiedName& attribute_name) { | 64 const QualifiedName& attribute_name) { |
65 DCHECK(!IsImmutable()); | 65 DCHECK(!IsImmutable()); |
66 DCHECK(context_element); | 66 DCHECK(context_element); |
67 DCHECK(attribute_name != QualifiedName::Null()); | 67 DCHECK(attribute_name != QualifiedName::Null()); |
68 context_element_ = context_element; | 68 context_element_ = context_element; |
69 attribute_name_ = attribute_name; | 69 attribute_name_ = attribute_name; |
70 } | 70 } |
71 | 71 |
72 virtual AnimatedPropertyType GetType() const = 0; | |
73 | |
74 DEFINE_INLINE_VIRTUAL_TRACE() {} | 72 DEFINE_INLINE_VIRTUAL_TRACE() {} |
75 | 73 |
76 static void ThrowReadOnly(ExceptionState&); | 74 static void ThrowReadOnly(ExceptionState&); |
77 | 75 |
78 protected: | 76 protected: |
79 SVGPropertyTearOffBase( | 77 SVGPropertyTearOffBase( |
80 SVGElement* context_element, | 78 SVGElement* context_element, |
81 PropertyIsAnimValType property_is_anim_val, | 79 PropertyIsAnimValType property_is_anim_val, |
82 const QualifiedName& attribute_name = QualifiedName::Null()) | 80 const QualifiedName& attribute_name = QualifiedName::Null()) |
83 : context_element_(context_element), | 81 : context_element_(context_element), |
(...skipping 15 matching lines...) Expand all Loading... |
99 public: | 97 public: |
100 Property* Target() { | 98 Property* Target() { |
101 if (IsAnimVal()) | 99 if (IsAnimVal()) |
102 contextElement()->EnsureAttributeAnimValUpdated(); | 100 contextElement()->EnsureAttributeAnimValUpdated(); |
103 | 101 |
104 return target_.Get(); | 102 return target_.Get(); |
105 } | 103 } |
106 | 104 |
107 void SetTarget(Property* target) { target_ = target; } | 105 void SetTarget(Property* target) { target_ = target; } |
108 | 106 |
109 AnimatedPropertyType GetType() const override { | |
110 return Property::ClassType(); | |
111 } | |
112 | |
113 DEFINE_INLINE_VIRTUAL_TRACE() { | 107 DEFINE_INLINE_VIRTUAL_TRACE() { |
114 visitor->Trace(target_); | 108 visitor->Trace(target_); |
115 SVGPropertyTearOffBase::Trace(visitor); | 109 SVGPropertyTearOffBase::Trace(visitor); |
116 } | 110 } |
117 | 111 |
118 protected: | 112 protected: |
119 SVGPropertyTearOff( | 113 SVGPropertyTearOff( |
120 Property* target, | 114 Property* target, |
121 SVGElement* context_element, | 115 SVGElement* context_element, |
122 PropertyIsAnimValType property_is_anim_val, | 116 PropertyIsAnimValType property_is_anim_val, |
123 const QualifiedName& attribute_name = QualifiedName::Null()) | 117 const QualifiedName& attribute_name = QualifiedName::Null()) |
124 : SVGPropertyTearOffBase(context_element, | 118 : SVGPropertyTearOffBase(context_element, |
125 property_is_anim_val, | 119 property_is_anim_val, |
126 attribute_name), | 120 attribute_name), |
127 target_(target) { | 121 target_(target) { |
128 DCHECK(target_); | 122 DCHECK(target_); |
129 } | 123 } |
130 | 124 |
131 private: | 125 private: |
132 Member<Property> target_; | 126 Member<Property> target_; |
133 }; | 127 }; |
134 | 128 |
135 } // namespace blink | 129 } // namespace blink |
136 | 130 |
137 #endif // SVGPropertyTearOff_h | 131 #endif // SVGPropertyTearOff_h |
OLD | NEW |