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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return nullptr; | 191 return nullptr; |
192 } | 192 } |
193 | 193 |
194 RefPtr<ItemPropertyType> value = toDerived()->target()->appendItem(getVa
lueForInsertionFromTearOff(item)); | 194 RefPtr<ItemPropertyType> value = toDerived()->target()->appendItem(getVa
lueForInsertionFromTearOff(item)); |
195 toDerived()->commitChange(); | 195 toDerived()->commitChange(); |
196 | 196 |
197 return createItemTearOff(value.release()); | 197 return createItemTearOff(value.release()); |
198 } | 198 } |
199 | 199 |
200 protected: | 200 protected: |
201 SVGListPropertyTearOffHelper(PassRefPtr<ListPropertyType> target, SVGElement
* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName&
attributeName = nullQName()) | 201 SVGListPropertyTearOffHelper(PassRefPtr<ListPropertyType> target, SVGElement
* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName&
attributeName = QualifiedName::null()) |
202 : SVGPropertyTearOff<ListPropertyType>(target, contextElement, propertyI
sAnimVal, attributeName) | 202 : SVGPropertyTearOff<ListPropertyType>(target, contextElement, propertyI
sAnimVal, attributeName) |
203 { | 203 { |
204 } | 204 } |
205 | 205 |
206 PassRefPtr<ItemPropertyType> getValueForInsertionFromTearOff(PassRefPtr<Item
TearOffType> passNewItem) | 206 PassRefPtr<ItemPropertyType> getValueForInsertionFromTearOff(PassRefPtr<Item
TearOffType> passNewItem) |
207 { | 207 { |
208 return ItemTraits::getValueForInsertionFromTearOff(passNewItem, toDerive
d()->contextElement(), toDerived()->attributeName()); | 208 return ItemTraits::getValueForInsertionFromTearOff(passNewItem, toDerive
d()->contextElement(), toDerived()->attributeName()); |
209 } | 209 } |
210 | 210 |
211 PassRefPtr<ItemTearOffType> createItemTearOff(PassRefPtr<ItemPropertyType> v
alue) | 211 PassRefPtr<ItemTearOffType> createItemTearOff(PassRefPtr<ItemPropertyType> v
alue) |
212 { | 212 { |
213 if (!value) | 213 if (!value) |
214 return nullptr; | 214 return nullptr; |
215 | 215 |
216 if (value->ownerList() == toDerived()->target()) | 216 if (value->ownerList() == toDerived()->target()) |
217 return ItemTraits::createTearOff(value, toDerived()->contextElement(
), toDerived()->propertyIsAnimVal(), toDerived()->attributeName()); | 217 return ItemTraits::createTearOff(value, toDerived()->contextElement(
), toDerived()->propertyIsAnimVal(), toDerived()->attributeName()); |
218 | 218 |
219 return ItemTraits::createTearOff(value, 0, PropertyIsNotAnimVal, nullQNa
me()); | 219 return ItemTraits::createTearOff(value, 0, PropertyIsNotAnimVal, Qualifi
edName::null()); |
220 } | 220 } |
221 | 221 |
222 private: | 222 private: |
223 Derived* toDerived() { return static_cast<Derived*>(this); } | 223 Derived* toDerived() { return static_cast<Derived*>(this); } |
224 }; | 224 }; |
225 | 225 |
226 } | 226 } |
227 | 227 |
228 #endif // SVGListPropertyTearOffHelper_h | 228 #endif // SVGListPropertyTearOffHelper_h |
OLD | NEW |