Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SVGPathSegListTearOff_h | 31 #ifndef SVGPathSegListTearOff_h |
| 32 #define SVGPathSegListTearOff_h | 32 #define SVGPathSegListTearOff_h |
| 33 | 33 |
| 34 #include "SVGNames.h" | |
| 34 #include "core/svg/SVGPathSegList.h" | 35 #include "core/svg/SVGPathSegList.h" |
| 35 #include "core/svg/properties/SVGListPropertyTearOffHelper.h" | 36 #include "core/svg/properties/SVGListPropertyTearOffHelper.h" |
| 36 | 37 |
| 37 namespace WebCore { | 38 namespace WebCore { |
| 38 | 39 |
| 39 template<> | 40 template<> |
| 40 class ListItemPropertyTraits<SVGPathSeg> { | 41 class ListItemPropertyTraits<SVGPathSeg> { |
| 41 public: | 42 public: |
| 42 typedef SVGPathSeg ItemPropertyType; | 43 typedef SVGPathSeg ItemPropertyType; |
| 43 // FIXME: Currently SVGPathSegitself is a tear-off. | 44 // FIXME: Currently SVGPathSegitself is a tear-off. |
| 44 typedef SVGPathSeg ItemTearOffType; | 45 typedef SVGPathSeg ItemTearOffType; |
| 45 | 46 |
| 46 static PassRefPtr<ItemPropertyType> getValueForInsertionFromTearOff(PassRefP tr<ItemTearOffType> passNewItem) | 47 static PassRefPtr<ItemPropertyType> getValueForInsertionFromTearOff(PassRefP tr<ItemTearOffType> passNewItem, SVGElement* contextElement, const QualifiedName & attributeName) |
| 47 { | 48 { |
| 48 return passNewItem; | 49 ASSERT(attributeName == SVGNames::dAttr); |
| 50 RefPtr<ItemTearOffType> newItem = passNewItem; | |
| 51 newItem->setContextElement(contextElement); | |
|
Erik Dahlström (inactive)
2014/06/11 08:31:32
Doesn't this need to set attributeName too? Like i
kouhei (in TOK)
2014/06/12 04:25:28
I think this is correct. SVGAnimateMotionElement d
Erik Dahlström (inactive)
2014/06/12 08:47:04
Fair enough for pathseglist then, but the other li
| |
| 52 return newItem.release(); | |
| 49 } | 53 } |
| 50 | 54 |
| 51 static PassRefPtr<ItemTearOffType> createTearOff(PassRefPtr<ItemPropertyType > passValue, SVGElement* contextElement, PropertyIsAnimValType, const QualifiedN ame&) | 55 static PassRefPtr<ItemTearOffType> createTearOff(PassRefPtr<ItemPropertyType > passValue, SVGElement* contextElement, PropertyIsAnimValType, const QualifiedN ame&) |
| 52 { | 56 { |
| 53 RefPtr<SVGPathSeg> value = passValue; | 57 RefPtr<SVGPathSeg> value = passValue; |
| 54 value->setContextElement(contextElement); | 58 value->setContextElement(contextElement); |
| 55 return value.release(); | 59 return value.release(); |
| 56 } | 60 } |
| 57 }; | 61 }; |
| 58 | 62 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 69 SVGPathSegListTearOff(PassRefPtr<SVGPathSegList> target, SVGElement* context Element, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attribute Name = nullQName()) | 73 SVGPathSegListTearOff(PassRefPtr<SVGPathSegList> target, SVGElement* context Element, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attribute Name = nullQName()) |
| 70 : SVGListPropertyTearOffHelper<SVGPathSegListTearOff, SVGPathSegList>(ta rget, contextElement, propertyIsAnimVal, attributeName) | 74 : SVGListPropertyTearOffHelper<SVGPathSegListTearOff, SVGPathSegList>(ta rget, contextElement, propertyIsAnimVal, attributeName) |
| 71 { | 75 { |
| 72 ScriptWrappable::init(this); | 76 ScriptWrappable::init(this); |
| 73 } | 77 } |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 } // namespace WebCore | 80 } // namespace WebCore |
| 77 | 81 |
| 78 #endif // SVGPathSegListTearOff_h_ | 82 #endif // SVGPathSegListTearOff_h_ |
| OLD | NEW |