Index: Source/core/svg/properties/SVGListPropertyTearOffHelper.h |
diff --git a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h |
index 08e46005a932fc9d9889d49543ebca9dc56f56df..d2cd09b2cc03e25085c529efe9084504038fb602 100644 |
--- a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h |
+++ b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h |
@@ -51,8 +51,9 @@ public: |
// |newItem| is immutable, OR |
// |newItem| belongs to a SVGElement, but it does not belong to an animated list |
// (for example: "textElement.x.baseVal.appendItem(rectElement.width.baseVal)") |
- if (newItem->isImmutable() |
- || (newItem->contextElement() && !newItem->target()->ownerList())) { |
+ // Spec: If newItem is already in a list, then a new 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. |
+ if (newItem->isImmutable() || newItem->target()->ownerList() || newItem->contextElement()) { |
// We have to copy the incoming |newItem|, |
// Otherwise we'll end up having two tearoffs that operate on the same SVGProperty. Consider the example below: |
// SVGRectElements SVGAnimatedLength 'width' property baseVal points to the same tear off object |