Index: Source/core/svg/SVGPathSegListTearOff.h |
diff --git a/Source/core/svg/SVGPathSegListTearOff.h b/Source/core/svg/SVGPathSegListTearOff.h |
index b95e6b20a6657d40b87fad6d2deaf47eeff7c76b..52400e355f3f850945382eb549ddc54d94e19b41 100644 |
--- a/Source/core/svg/SVGPathSegListTearOff.h |
+++ b/Source/core/svg/SVGPathSegListTearOff.h |
@@ -48,6 +48,13 @@ public: |
{ |
ASSERT(attributeName == SVGNames::dAttr); |
RefPtrWillBeRawPtr<ItemTearOffType> newItem = passNewItem; |
+ |
+ // Spec: If newItem is already in a list, then a new SVGPathSeg object is created with the same values as newItem and this item is inserted into the list. |
+ // Otherwise, newItem itself is inserted into the list. |
+ // https://svgwg.org/svg2-draft/paths.html#InterfaceSVGPathSegList |
+ if (newItem->ownerList()) |
+ newItem = newItem->clone(); |
+ |
newItem->setContextElement(contextElement); |
return newItem.release(); |
} |