Title: [230172] trunk/LayoutTests
Revision
230172
Author
[email protected]
Date
2018-04-02 12:42:18 -0700 (Mon, 02 Apr 2018)

Log Message

Followup(r230063): Add test a layout test for https://bugs.webkit.org/show_bug.cgi?id=183972
https://bugs.webkit.org/show_bug.cgi?id=184162

Reviewed by Daniel Bates.

Without r230063, running run-webkit-tests -g for this test will crash.

* svg/dom/animated-tearoff-list-remove-target-expected.txt: Added.
* svg/dom/animated-tearoff-list-remove-target.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (230171 => 230172)


--- trunk/LayoutTests/ChangeLog	2018-04-02 19:06:44 UTC (rev 230171)
+++ trunk/LayoutTests/ChangeLog	2018-04-02 19:42:18 UTC (rev 230172)
@@ -1,3 +1,15 @@
+2018-04-02  Said Abou-Hallawa  <[email protected]>
+
+        Followup(r230063): Add test a layout test for https://bugs.webkit.org/show_bug.cgi?id=183972
+        https://bugs.webkit.org/show_bug.cgi?id=184162
+
+        Reviewed by Daniel Bates.
+
+        Without r230063, running run-webkit-tests -g for this test will crash.
+
+        * svg/dom/animated-tearoff-list-remove-target-expected.txt: Added.
+        * svg/dom/animated-tearoff-list-remove-target.html: Added.
+
 2018-04-02  Jer Noble  <[email protected]>
 
         AudioBufferSourceNode start method causes OfflineAudioContext to start running

Added: trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target-expected.txt (0 => 230172)


--- trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target-expected.txt	2018-04-02 19:42:18 UTC (rev 230172)
@@ -0,0 +1,4 @@
+Removing the target of an animate element should detach the wrappers of the attributes from their animated properties.
+
+PASS.
+

Added: trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target.html (0 => 230172)


--- trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target.html	                        (rev 0)
+++ trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target.html	2018-04-02 19:42:18 UTC (rev 230172)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<body>
+    <div>Removing the target of an animate element should detach the wrappers of the attributes from their animated properties.</div>
+    <svg>
+        <text x="15" y="40">
+            <tspan id="first-tspan">First tspan.</tspan> 
+        </text>
+        <text x="15" y="60">
+            <tspan id="second-tspan">Second tspan</tspan> 
+        </text>
+        <animate id="animate" xlink:href="" attributeType="XML" attributeName="x" from="0" to="100" dur="10s" repeatCount="indefinite"/>
+    </svg>
+    <script>
+        function gc() {
+            if (window.GCController)
+                return GCController.collect();
+
+            // Force garbage collection.
+            for (var i = 0; i < 10000; i++)
+                var s = new String("abc");
+        }
+
+        (function() {
+            if (window.testRunner)  {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+
+            setTimeout(() => {
+                // The target of the <animate> element is the "first-tspan".
+                var tspanElement = document.getElementById("first-tspan");
+
+                // animItem is a reference (not a copy) to the first item in the x animated list.
+                var animList = tspanElement.x.animVal;
+                var animItem = animList.getItem(0);
+
+                // Now change the target of the <animate> element to be the "second-tspan".
+                var animateElement = document.getElementById("animate");
+                animateElement.setAttributeNS("http://www.w3.org/1999/xlink", "href", "second-tspan");
+
+                // By now animItem should be detached from the animated animList and has its own copy
+                // of an SVGLength. animItem should not be affected if garbage collection is forced.
+                gc();
+                if (animItem.valueAsString == "0") {
+                    document.querySelector("div").innerHTML += "<br><br>PASS."
+                    document.querySelector("svg").remove();
+                }
+
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0);
+        })();
+    </script>
+</body>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to