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