REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Apr 2019 00:03:44 +0000 (00:03 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Apr 2019 00:03:44 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197137

Reviewed by Darin Adler.

Source/WebCore:

All the DOM objects accessing the viewTarget of the same SVGViewElement
should hold a Ref pointer to the same SVGStringList property.

Test: svg/dom/SVGViewElement-viewTarget.html

* svg/SVGViewElement.idl:

LayoutTests:

* svg/dom/SVGViewElement-viewTarget-expected.txt: Added.
* svg/dom/SVGViewElement-viewTarget.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244491 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/dom/SVGViewElement-viewTarget-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGViewElement-viewTarget.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGViewElement.idl

index 1281907..c10fcad 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-20  Said Abou-Hallawa  <said@apple.com>
+
+        REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
+        https://bugs.webkit.org/show_bug.cgi?id=197137
+
+        Reviewed by Darin Adler.
+
+        * svg/dom/SVGViewElement-viewTarget-expected.txt: Added.
+        * svg/dom/SVGViewElement-viewTarget.html: Added.
+
 2019-04-19  Megan Gardner  <megan_gardner@apple.com>
 
         Fix Long Press Image Test
diff --git a/LayoutTests/svg/dom/SVGViewElement-viewTarget-expected.txt b/LayoutTests/svg/dom/SVGViewElement-viewTarget-expected.txt
new file mode 100644 (file)
index 0000000..916ce29
--- /dev/null
@@ -0,0 +1,23 @@
+This test checks the SVGStringList API - utilizing the viewTarget property of SVGViewElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial viewTarget value
+PASS viewElement.viewTarget.toString() is "[object SVGStringList]"
+PASS viewElement.viewTarget.numberOfItems is 1
+PASS viewElement.viewTarget.getItem(0) is "rect-view"
+
+Check the uniqueness of viewTarget per SVGViewElement
+PASS viewElement.viewTarget is viewTarget
+PASS viewTarget.getItem(0) is "rect-view"
+
+Check modifying viewTarget
+PASS viewTarget.replaceItem('circle-view', 0) is "circle-view"
+PASS viewElement.viewTarget.getItem(0) is "circle-view"
+PASS viewElement.getAttribute('viewTarget') is "circle-view"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGViewElement-viewTarget.html b/LayoutTests/svg/dom/SVGViewElement-viewTarget.html
new file mode 100644 (file)
index 0000000..0333529
--- /dev/null
@@ -0,0 +1,36 @@
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This test checks the SVGStringList API - utilizing the viewTarget property of SVGViewElement");
+
+var viewElement = document.createElementNS("http://www.w3.org/2000/svg", "view");
+viewElement.setAttribute("viewTarget", "rect-view");
+
+debug("");
+debug("Check initial viewTarget value");
+shouldBeEqualToString("viewElement.viewTarget.toString()", "[object SVGStringList]");
+shouldBe("viewElement.viewTarget.numberOfItems", "1");
+shouldBeEqualToString("viewElement.viewTarget.getItem(0)", "rect-view");
+
+var viewTarget = viewElement.viewTarget;
+debug("");
+debug("Check the uniqueness of viewTarget per SVGViewElement");
+shouldBe("viewElement.viewTarget", "viewTarget");
+shouldBeEqualToString("viewTarget.getItem(0)", "rect-view");
+
+debug("");
+debug("Check modifying viewTarget");
+shouldBeEqualToString("viewTarget.replaceItem('circle-view', 0)", "circle-view");
+shouldBeEqualToString("viewElement.viewTarget.getItem(0)", "circle-view");
+shouldBeEqualToString("viewElement.getAttribute('viewTarget')", "circle-view");
+
+successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index 2e8d757..a2d454f 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-20  Said Abou-Hallawa  <said@apple.com>
+
+        REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
+        https://bugs.webkit.org/show_bug.cgi?id=197137
+
+        Reviewed by Darin Adler.
+
+        All the DOM objects accessing the viewTarget of the same SVGViewElement 
+        should hold a Ref pointer to the same SVGStringList property.
+
+        Test: svg/dom/SVGViewElement-viewTarget.html
+
+        * svg/SVGViewElement.idl:
+
 2019-04-20  Jer Noble  <jer.noble@apple.com>
 
         REGRESSION(r243958): Unnecessary deactivation of AudioSession (PLT Regression)
index d717647..ccdeceb 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 interface SVGViewElement : SVGElement {
-    [NewObject] readonly attribute SVGStringList viewTarget;
+    readonly attribute SVGStringList viewTarget;
 };
 
 SVGViewElement implements SVGExternalResourcesRequired;