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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 const QualifiedName& attributeName() | 81 const QualifiedName& attributeName() |
82 { | 82 { |
83 return m_attributeName; | 83 return m_attributeName; |
84 } | 84 } |
85 | 85 |
86 void attachToSVGElementAttribute(SVGElement* contextElement, const Qualified
Name& attributeName) | 86 void attachToSVGElementAttribute(SVGElement* contextElement, const Qualified
Name& attributeName) |
87 { | 87 { |
88 ASSERT(!isImmutable()); | 88 ASSERT(!isImmutable()); |
89 ASSERT(contextElement); | 89 ASSERT(contextElement); |
90 ASSERT(attributeName != nullQName()); | 90 ASSERT(attributeName != QualifiedName::null()); |
91 m_contextElement = contextElement; | 91 m_contextElement = contextElement; |
92 m_attributeName = attributeName; | 92 m_attributeName = attributeName; |
93 } | 93 } |
94 | 94 |
95 virtual AnimatedPropertyType type() const = 0; | 95 virtual AnimatedPropertyType type() const = 0; |
96 | 96 |
97 protected: | 97 protected: |
98 SVGPropertyTearOffBase(SVGElement* contextElement, PropertyIsAnimValType pro
pertyIsAnimVal, const QualifiedName& attributeName = nullQName()) | 98 SVGPropertyTearOffBase(SVGElement* contextElement, PropertyIsAnimValType pro
pertyIsAnimVal, const QualifiedName& attributeName = QualifiedName::null()) |
99 : m_contextElement(contextElement) | 99 : m_contextElement(contextElement) |
100 , m_propertyIsAnimVal(propertyIsAnimVal) | 100 , m_propertyIsAnimVal(propertyIsAnimVal) |
101 , m_isReadOnlyProperty(false) | 101 , m_isReadOnlyProperty(false) |
102 , m_attributeName(attributeName) | 102 , m_attributeName(attributeName) |
103 { | 103 { |
104 } | 104 } |
105 | 105 |
106 private: | 106 private: |
107 // These references are kept alive from V8 wrapper to prevent reference cycl
es | 107 // These references are kept alive from V8 wrapper to prevent reference cycl
es |
108 SVGElement* m_contextElement; | 108 SVGElement* m_contextElement; |
(...skipping 15 matching lines...) Expand all Loading... |
124 { | 124 { |
125 m_target = target; | 125 m_target = target; |
126 } | 126 } |
127 | 127 |
128 virtual AnimatedPropertyType type() const OVERRIDE | 128 virtual AnimatedPropertyType type() const OVERRIDE |
129 { | 129 { |
130 return Property::classType(); | 130 return Property::classType(); |
131 } | 131 } |
132 | 132 |
133 protected: | 133 protected: |
134 SVGPropertyTearOff(PassRefPtr<Property> target, SVGElement* contextElement,
PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName = nu
llQName()) | 134 SVGPropertyTearOff(PassRefPtr<Property> target, SVGElement* contextElement,
PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName = Qu
alifiedName::null()) |
135 : SVGPropertyTearOffBase(contextElement, propertyIsAnimVal, attributeNam
e) | 135 : SVGPropertyTearOffBase(contextElement, propertyIsAnimVal, attributeNam
e) |
136 , m_target(target) | 136 , m_target(target) |
137 { | 137 { |
138 ASSERT(m_target); | 138 ASSERT(m_target); |
139 } | 139 } |
140 | 140 |
141 private: | 141 private: |
142 RefPtr<Property> m_target; | 142 RefPtr<Property> m_target; |
143 }; | 143 }; |
144 | 144 |
145 } | 145 } |
146 | 146 |
147 #endif // SVGPropertyTearOff_h | 147 #endif // SVGPropertyTearOff_h |
OLD | NEW |