Diff
Modified: trunk/LayoutTests/ChangeLog (249190 => 249191)
--- trunk/LayoutTests/ChangeLog 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/ChangeLog 2019-08-28 07:10:44 UTC (rev 249191)
@@ -1,3 +1,20 @@
+2019-08-28 Said Abou-Hallawa <[email protected]>
+
+ SVG2: Add length, item getter and item setter to all SVG lists
+ https://bugs.webkit.org/show_bug.cgi?id=199526
+
+ Reviewed by Simon Fraser.
+
+ * svg/custom/polyline-points-crash-expected.txt:
+ * svg/dom/SVGLengthList-basics-expected.txt:
+ * svg/dom/SVGLengthList-length-indexed-access-expected.txt: Added.
+ * svg/dom/SVGLengthList-length-indexed-access.xhtml: Added.
+ * svg/dom/SVGNumberList-basics-expected.txt:
+ * svg/dom/SVGPathSegList-length-indexed-access-expected.txt: Added.
+ * svg/dom/SVGPathSegList-length-indexed-access.xhtml: Added.
+ * svg/dom/SVGPointList-basics-expected.txt:
+ * svg/dom/SVGTransformList-basics-expected.txt:
+
2019-08-27 Fujii Hironori <[email protected]>
Make FrameLoader::open() set outgoing referrer properly
Modified: trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt (249190 => 249191)
--- trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -1,2 +1,2 @@
-Caught exception: TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint
+Caught exception: TypeError: Argument 1 ('newItem') to SVGPointList.appendItem must be an instance of SVGPoint
PASSED -- WebKit did not crash!
Modified: trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt (249190 => 249191)
--- trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -12,10 +12,10 @@
PASS text1.x.baseVal.getItem(2).value is 1500
Test uncommon arguments for initialize()
-PASS text1.x.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
-PASS text1.x.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
-PASS text1.x.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
-PASS text1.x.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
+PASS text1.x.baseVal.initialize(30) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.initialize must be an instance of SVGLength.
+PASS text1.x.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.initialize must be an instance of SVGLength.
+PASS text1.x.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.initialize must be an instance of SVGLength.
+PASS text1.x.baseVal.initialize(null) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.initialize must be an instance of SVGLength.
Test uncommon arguments for getItem()
PASS text1.x.baseVal.getItem(30) threw exception IndexSizeError: The index is not in the allowed range..
@@ -56,10 +56,10 @@
PASS text1.x.baseVal.getItem(1).value is 1000
PASS text1.x.baseVal.getItem(2).value is 1500
PASS text1.getAttribute('x') is "500 1000 1500"
-PASS text1.x.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
-PASS text1.x.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
-PASS text1.x.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
-PASS text1.x.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
+PASS text1.x.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
+PASS text1.x.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
+PASS text1.x.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
+PASS text1.x.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
Set x='1 2 3 4' for text1
PASS text1.setAttribute('x', '1 2 3 4') is undefined.
@@ -89,10 +89,10 @@
PASS text1.x.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
PASS text1.x.baseVal.replaceItem(text1) threw exception TypeError: Not enough arguments.
PASS text1.x.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
-PASS text1.x.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
-PASS text1.x.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
-PASS text1.x.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
-PASS text1.x.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
+PASS text1.x.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.replaceItem must be an instance of SVGLength.
+PASS text1.x.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.replaceItem must be an instance of SVGLength.
+PASS text1.x.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.replaceItem must be an instance of SVGLength.
+PASS text1.x.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.replaceItem must be an instance of SVGLength.
PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0) is text1.x.baseVal.getItem(0)
PASS text1.x.baseVal.numberOfItems is 4
PASS text1.x.baseVal.getItem(0).value is 1
@@ -161,10 +161,10 @@
PASS text1.getAttribute('x') is "3 4"
Test uncommon arguments for appendItem()
-PASS text1.x.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
-PASS text1.x.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
-PASS text1.x.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
-PASS text1.x.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
+PASS text1.x.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.appendItem must be an instance of SVGLength.
+PASS text1.x.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.appendItem must be an instance of SVGLength.
+PASS text1.x.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.appendItem must be an instance of SVGLength.
+PASS text1.x.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('newItem') to SVGLengthList.appendItem must be an instance of SVGLength.
Testing animVal clear throws
PASS text1.x.animVal.clear() threw exception NoModificationAllowedError: The object can not be modified..
Added: trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access-expected.txt (0 => 249191)
--- trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -0,0 +1,58 @@
+ABC
+This is a test of the 'length' attribute and the indexed property access of the SVGLengthList interface.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test list length/numberOfItems
+PASS text1.x.baseVal.length is 2
+PASS text1.x.baseVal.numberOfItems is 2
+PASS text1.rotate.baseVal.length is 3
+PASS text1.rotate.baseVal.numberOfItems is 3
+
+Test item getter
+PASS text1.x.baseVal.getItem(0).value is 50
+PASS text1.x.baseVal[0].value is 50
+PASS text1.x.baseVal.getItem(1).value is 100
+PASS text1.x.baseVal[1].value is 100
+PASS text1.x.baseVal.getItem(2) threw exception IndexSizeError: The index is not in the allowed range..
+PASS text1.x.baseVal[2] is undefined.
+
+PASS text1.rotate.baseVal.getItem(0).value is 90
+PASS text1.rotate.baseVal[0].value is 90
+PASS text1.rotate.baseVal.getItem(1).value is 180
+PASS text1.rotate.baseVal[1].value is 180
+PASS text1.rotate.baseVal.getItem(2).value is 270
+PASS text1.rotate.baseVal[2].value is 270
+PASS text1.rotate.baseVal.getItem(3) threw exception IndexSizeError: The index is not in the allowed range..
+PASS text1.rotate.baseVal[3] is undefined.
+
+Test item setter
+PASS text1.x.baseVal[0] = length1 is length1
+PASS text1.x.baseVal[1] = length2 is length2
+PASS text1.x.baseVal.getItem(0).value is 40
+PASS text1.x.baseVal[0].value is 40
+PASS text1.x.baseVal.getItem(1).value is 80
+PASS text1.x.baseVal[1].value is 80
+PASS text1.x.baseVal[1] = 0 threw exception TypeError: Type error.
+PASS text1.x.baseVal[1] = 'aString' threw exception TypeError: Type error.
+PASS text1.x.baseVal[1] = null threw exception TypeError: Type error.
+PASS text1.x.baseVal[2] = length2 threw exception IndexSizeError: The index is not in the allowed range..
+
+PASS text1.rotate.baseVal[0] = number1 is number1
+PASS text1.rotate.baseVal[1] = number2 is number2
+PASS text1.rotate.baseVal[2] = number3 is number3
+PASS text1.rotate.baseVal.getItem(0).value is 45
+PASS text1.rotate.baseVal[0].value is 45
+PASS text1.rotate.baseVal.getItem(1).value is 90
+PASS text1.rotate.baseVal[1].value is 90
+PASS text1.rotate.baseVal.getItem(2).value is 135
+PASS text1.rotate.baseVal[2].value is 135
+PASS text1.rotate.baseVal[2] = 0 threw exception TypeError: Type error.
+PASS text1.rotate.baseVal[2] = 'aString' threw exception TypeError: Type error.
+PASS text1.rotate.baseVal[2] = null threw exception TypeError: Type error.
+PASS text1.rotate.baseVal[3] = number3 threw exception IndexSizeError: The index is not in the allowed range..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access.xhtml (0 => 249191)
--- trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access.xhtml (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGLengthList-length-indexed-access.xhtml 2019-08-28 07:10:44 UTC (rev 249191)
@@ -0,0 +1,88 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script>window.enablePixelTesting = true;</script>
+<script src=""
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+ <text id="text1" x="50 100" rotate="90 180 270">ABC</text>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/_javascript_">
+<![CDATA[
+ description("This is a test of the 'length' attribute and the indexed property access of the SVGLengthList interface.");
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var svg = document.getElementById("svg");
+ var text1 = document.getElementById("text1");
+
+ var length1 = svg.createSVGLength();
+ var length2 = svg.createSVGLength();
+ var number1 = svg.createSVGNumber();
+ var number2 = svg.createSVGNumber();
+ var number3 = svg.createSVGNumber();
+ length1.value = 40;
+ length2.value = 80;
+ number1.value = 45;
+ number2.value = 90;
+ number3.value = 135;
+
+ debug("Test list length/numberOfItems");
+ shouldBe("text1.x.baseVal.length", "2");
+ shouldBe("text1.x.baseVal.numberOfItems", "2");
+ shouldBe("text1.rotate.baseVal.length", "3");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+
+ debug("");
+ debug("Test item getter");
+ shouldBe("text1.x.baseVal.getItem(0).value", "50");
+ shouldBe("text1.x.baseVal[0].value", "50");
+ shouldBe("text1.x.baseVal.getItem(1).value", "100");
+ shouldBe("text1.x.baseVal[1].value", "100");
+ shouldThrow("text1.x.baseVal.getItem(2)");
+ shouldBeUndefined("text1.x.baseVal[2]");
+ debug("");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "90");
+ shouldBe("text1.rotate.baseVal[0].value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "180");
+ shouldBe("text1.rotate.baseVal[1].value", "180");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270");
+ shouldBe("text1.rotate.baseVal[2].value", "270");
+ shouldThrow("text1.rotate.baseVal.getItem(3)");
+ shouldBeUndefined("text1.rotate.baseVal[3]");
+
+ debug("");
+ debug("Test item setter");
+ shouldBe("text1.x.baseVal[0] = length1", "length1");
+ shouldBe("text1.x.baseVal[1] = length2", "length2");
+ shouldBe("text1.x.baseVal.getItem(0).value", "40");
+ shouldBe("text1.x.baseVal[0].value", "40");
+ shouldBe("text1.x.baseVal.getItem(1).value", "80");
+ shouldBe("text1.x.baseVal[1].value", "80");
+ shouldThrow("text1.x.baseVal[1] = 0");
+ shouldThrow("text1.x.baseVal[1] = 'aString'");
+ shouldThrow("text1.x.baseVal[1] = null");
+ shouldThrow("text1.x.baseVal[2] = length2");
+ debug("");
+ shouldBe("text1.rotate.baseVal[0] = number1", "number1");
+ shouldBe("text1.rotate.baseVal[1] = number2", "number2");
+ shouldBe("text1.rotate.baseVal[2] = number3", "number3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "45");
+ shouldBe("text1.rotate.baseVal[0].value", "45");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "90");
+ shouldBe("text1.rotate.baseVal[1].value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "135");
+ shouldBe("text1.rotate.baseVal[2].value", "135");
+ shouldThrow("text1.rotate.baseVal[2] = 0");
+ shouldThrow("text1.rotate.baseVal[2] = 'aString'");
+ shouldThrow("text1.rotate.baseVal[2] = null");
+ shouldThrow("text1.rotate.baseVal[3] = number3");
+]]>
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt (249190 => 249191)
--- trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -9,10 +9,10 @@
PASS text1.rotate.animVal.numberOfItems is 3
Test uncommon arguments for initialize()
-PASS text1.rotate.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.initialize(30) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.initialize must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.initialize must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.initialize must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.initialize(null) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.initialize must be an instance of SVGNumber.
Test uncommon arguments for getItem()
PASS text1.rotate.baseVal.getItem(30) threw exception IndexSizeError: The index is not in the allowed range..
@@ -53,10 +53,10 @@
PASS text1.rotate.baseVal.getItem(1).value is 180
PASS text1.rotate.baseVal.getItem(2).value is 270
PASS text1.getAttribute('rotate') is "90 180 270"
-PASS text1.rotate.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
Set rotate='1 2 3 4' for text1
PASS text1.setAttribute('rotate', '1 2 3 4') is undefined.
@@ -72,10 +72,10 @@
PASS text1.rotate.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
PASS text1.rotate.baseVal.replaceItem(text1) threw exception TypeError: Not enough arguments.
PASS text1.rotate.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
-PASS text1.rotate.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.replaceItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.replaceItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.replaceItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.replaceItem must be an instance of SVGNumber.
PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 0) is text1.rotate.baseVal.getItem(0)
PASS text1.rotate.baseVal.numberOfItems is 4
PASS text1.rotate.baseVal.getItem(0).value is 1
@@ -119,10 +119,10 @@
PASS text1.getAttribute('rotate') is "4"
Test uncommon arguments for appendItem()
-PASS text1.rotate.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
-PASS text1.rotate.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.appendItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.appendItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.appendItem must be an instance of SVGNumber.
+PASS text1.rotate.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('newItem') to SVGNumberList.appendItem must be an instance of SVGNumber.
Testing animVal clear throws
PASS text1.rotate.animVal.clear() threw exception NoModificationAllowedError: The object can not be modified..
Added: trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access-expected.txt (0 => 249191)
--- trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -0,0 +1,57 @@
+This is a test of the 'length' attribute and the indexed property access of the SVGPathSegList interface.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Test list length/numberOfItems
+PASS path1.pathSegList.length is 3
+PASS path1.pathSegList.numberOfItems is 3
+PASS path2.pathSegList.length is 5
+PASS path2.pathSegList.numberOfItems is 5
+
+Test item getter
+PASS path1.pathSegList[0].toString() is "[object SVGPathSegMovetoAbs]"
+PASS path1.pathSegList[0].x is 0
+PASS path1.pathSegList[0].y is 0
+PASS path1.pathSegList[1].toString() is "[object SVGPathSegLinetoAbs]"
+PASS path1.pathSegList[1].x is 100
+PASS path1.pathSegList[1].y is 0
+PASS path1.pathSegList[2].toString() is "[object SVGPathSegLinetoAbs]"
+PASS path1.pathSegList[2].x is 100
+PASS path1.pathSegList[2].y is 100
+PASS path1.pathSegList[3] is undefined.
+
+PASS path2.pathSegList[0].toString() is "[object SVGPathSegMovetoAbs]"
+PASS path2.pathSegList[0].x is 0
+PASS path2.pathSegList[0].y is 0
+PASS path2.pathSegList[1].toString() is "[object SVGPathSegLinetoAbs]"
+PASS path2.pathSegList[1].x is 50
+PASS path2.pathSegList[1].y is 100
+PASS path2.pathSegList[2].toString() is "[object SVGPathSegLinetoHorizontalRel]"
+PASS path2.pathSegList[2].x is 100
+PASS path2.pathSegList[3].toString() is "[object SVGPathSegLinetoHorizontalRel]"
+PASS path2.pathSegList[3].x is 100
+PASS path2.pathSegList[4].toString() is "[object SVGPathSegLinetoVerticalRel]"
+PASS path2.pathSegList[4].y is 100
+PASS path2.pathSegList[5] is undefined.
+
+Test item setter
+PASS path1.pathSegList[2] = pathSeg1 is pathSeg1
+PASS path1.pathSegList[2].toString() is "[object SVGPathSegLinetoAbs]"
+PASS path1.pathSegList[2].x is 50
+PASS path1.pathSegList[2].y is 50
+PASS path1.pathSegList[2] = 0 threw exception TypeError: Type error.
+PASS path1.pathSegList[2] = 'aString' threw exception TypeError: Type error.
+PASS path1.pathSegList[2] = null threw exception TypeError: Type error.
+
+PASS path2.pathSegList[4] = pathSeg2 is pathSeg2
+PASS path2.pathSegList[4].toString() is "[object SVGPathSegLinetoVerticalAbs]"
+PASS path2.pathSegList[4].y is 50
+PASS path2.pathSegList[4] = 0 threw exception TypeError: Type error.
+PASS path2.pathSegList[4] = 'aString' threw exception TypeError: Type error.
+PASS path2.pathSegList[4] = null threw exception TypeError: Type error.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access.xhtml (0 => 249191)
--- trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access.xhtml (rev 0)
+++ trunk/LayoutTests/svg/dom/SVGPathSegList-length-indexed-access.xhtml 2019-08-28 07:10:44 UTC (rev 249191)
@@ -0,0 +1,84 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script>window.enablePixelTesting = true;</script>
+<script src=""
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="250" height="250">
+ <g transform="translate(10, 10)">
+ <path id="path1" d="M 0 0 L 100 0 L 100 100" fill="green"/>
+ <path transform="translate(110, 0)" id="path2" d="M 0 0 L 50 100 h 100 h 100 v 100" fill="green"/>
+ </g>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/_javascript_">
+<![CDATA[
+ description("This is a test of the 'length' attribute and the indexed property access of the SVGPathSegList interface.");
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var svg = document.getElementById("svg");
+ var path1 = document.getElementById("path1");
+ var path2 = document.getElementById("path2");
+
+ var pathSeg1 = path1.createSVGPathSegLinetoAbs(50, 50);
+ var pathSeg2 = path1.createSVGPathSegLinetoVerticalAbs(50);
+
+ debug("");
+ debug("Test list length/numberOfItems");
+ shouldBe("path1.pathSegList.length", "3");
+ shouldBe("path1.pathSegList.numberOfItems", "3");
+ shouldBe("path2.pathSegList.length", "5");
+ shouldBe("path2.pathSegList.numberOfItems", "5");
+
+ debug("");
+ debug("Test item getter");
+ shouldBeEqualToString("path1.pathSegList[0].toString()", "[object SVGPathSegMovetoAbs]");
+ shouldBe("path1.pathSegList[0].x", "0");
+ shouldBe("path1.pathSegList[0].y", "0");
+ shouldBeEqualToString("path1.pathSegList[1].toString()", "[object SVGPathSegLinetoAbs]");
+ shouldBe("path1.pathSegList[1].x", "100");
+ shouldBe("path1.pathSegList[1].y", "0");
+ shouldBeEqualToString("path1.pathSegList[2].toString()", "[object SVGPathSegLinetoAbs]");
+ shouldBe("path1.pathSegList[2].x", "100");
+ shouldBe("path1.pathSegList[2].y", "100");
+ shouldBeUndefined("path1.pathSegList[3]");
+ debug("");
+ shouldBeEqualToString("path2.pathSegList[0].toString()", "[object SVGPathSegMovetoAbs]");
+ shouldBe("path2.pathSegList[0].x", "0");
+ shouldBe("path2.pathSegList[0].y", "0");
+ shouldBeEqualToString("path2.pathSegList[1].toString()", "[object SVGPathSegLinetoAbs]");
+ shouldBe("path2.pathSegList[1].x", "50");
+ shouldBe("path2.pathSegList[1].y", "100");
+ shouldBeEqualToString("path2.pathSegList[2].toString()", "[object SVGPathSegLinetoHorizontalRel]");
+ shouldBe("path2.pathSegList[2].x", "100");
+ shouldBeEqualToString("path2.pathSegList[3].toString()", "[object SVGPathSegLinetoHorizontalRel]");
+ shouldBe("path2.pathSegList[3].x", "100");
+ shouldBeEqualToString("path2.pathSegList[4].toString()", "[object SVGPathSegLinetoVerticalRel]");
+ shouldBe("path2.pathSegList[4].y", "100");
+ shouldBeUndefined("path2.pathSegList[5]");
+
+ debug("");
+ debug("Test item setter");
+ shouldBe("path1.pathSegList[2] = pathSeg1", "pathSeg1");
+ shouldBeEqualToString("path1.pathSegList[2].toString()", "[object SVGPathSegLinetoAbs]");
+ shouldBe("path1.pathSegList[2].x", "50");
+ shouldBe("path1.pathSegList[2].y", "50");
+ shouldThrow("path1.pathSegList[2] = 0");
+ shouldThrow("path1.pathSegList[2] = 'aString'");
+ shouldThrow("path1.pathSegList[2] = null");
+ debug("");
+ shouldBe("path2.pathSegList[4] = pathSeg2", "pathSeg2");
+ shouldBeEqualToString("path2.pathSegList[4].toString()", "[object SVGPathSegLinetoVerticalAbs]");
+ shouldBe("path2.pathSegList[4].y", "50");
+ shouldThrow("path2.pathSegList[4] = 0");
+ shouldThrow("path2.pathSegList[4] = 'aString'");
+ shouldThrow("path2.pathSegList[4] = null");
+]]>
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt (249190 => 249191)
--- trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -20,9 +20,9 @@
PASS poly1.points.numberOfItems is 1
PASS dumpPoint(poly1.points.getItem(0)) is "x=200 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "200 100"
-PASS poly1.points.initialize(poly1) threw exception TypeError: Argument 1 ('item') to SVGPointList.initialize must be an instance of SVGPoint.
-PASS poly1.points.initialize(0) threw exception TypeError: Argument 1 ('item') to SVGPointList.initialize must be an instance of SVGPoint.
-PASS poly1.points.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGPointList.initialize must be an instance of SVGPoint.
+PASS poly1.points.initialize(poly1) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.initialize must be an instance of SVGPoint.
+PASS poly1.points.initialize(0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.initialize must be an instance of SVGPoint.
+PASS poly1.points.initialize('aString') threw exception TypeError: Argument 1 ('newItem') to SVGPointList.initialize must be an instance of SVGPoint.
Reset points attribute to 0 0 100 0 100 100 0 100
PASS poly1.setAttribute('points', '0 0 100 0 100 100 0 100') is undefined.
@@ -75,19 +75,19 @@
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
-PASS poly1.points.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
-PASS poly1.points.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
-PASS poly1.points.insertItemBefore(poly1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
-PASS poly1.points.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
+PASS poly1.points.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
+PASS poly1.points.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
+PASS poly1.points.insertItemBefore(poly1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
+PASS poly1.points.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
Test uncommon arguments for replaceItem()
PASS poly1.points.replaceItem(30) threw exception TypeError: Not enough arguments.
PASS poly1.points.replaceItem('aString') threw exception TypeError: Not enough arguments.
PASS poly1.points.replaceItem(poly1) threw exception TypeError: Not enough arguments.
-PASS poly1.points.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
-PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
-PASS poly1.points.replaceItem(poly1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
-PASS poly1.points.replaceItem(1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
+PASS poly1.points.replaceItem(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.replaceItem must be an instance of SVGPoint.
+PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.replaceItem must be an instance of SVGPoint.
+PASS poly1.points.replaceItem(poly1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.replaceItem must be an instance of SVGPoint.
+PASS poly1.points.replaceItem(1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.replaceItem must be an instance of SVGPoint.
Test uncommon arguments for replaceItem() and xml-dom synchronization
PASS poly1.points.numberOfItems is 4
@@ -143,10 +143,10 @@
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 100"
Test uncommon arguments for appendItem()
-PASS poly1.points.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
-PASS poly1.points.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
-PASS poly1.points.appendItem(poly1) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
-PASS poly1.points.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
+PASS poly1.points.appendItem(30) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.appendItem must be an instance of SVGPoint.
+PASS poly1.points.appendItem('aString') threw exception TypeError: Argument 1 ('newItem') to SVGPointList.appendItem must be an instance of SVGPoint.
+PASS poly1.points.appendItem(poly1) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.appendItem must be an instance of SVGPoint.
+PASS poly1.points.appendItem(null) threw exception TypeError: Argument 1 ('newItem') to SVGPointList.appendItem must be an instance of SVGPoint.
PASS dumpPoint(poly1.points.appendItem(point)) is "x=200 y=100"
PASS poly1.points.numberOfItems is 2
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
Modified: trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt (249190 => 249191)
--- trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt 2019-08-28 07:10:44 UTC (rev 249191)
@@ -10,10 +10,10 @@
PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
Test uncommon arguments for initialize()
-PASS circle1.transform.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.initialize(circle1) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.initialize(30) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.initialize must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.initialize must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.initialize(circle1) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.initialize must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.initialize(null) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.initialize must be an instance of SVGTransform.
Test uncommon arguments for getItem()
PASS circle1.transform.baseVal.getItem(30) threw exception IndexSizeError: The index is not in the allowed range..
@@ -50,10 +50,10 @@
PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10)"
-PASS circle1.transform.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.insertItemBefore(circle1, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.insertItemBefore(circle1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
Test overlapping edge cases for removeItem()
PASS circle1.setAttribute('transform', 'scale(2 2) translate(10 10)') is undefined.
@@ -76,10 +76,10 @@
PASS circle1.transform.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
PASS circle1.transform.baseVal.replaceItem(circle1) threw exception TypeError: Not enough arguments.
PASS circle1.transform.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
-PASS circle1.transform.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.replaceItem(circle1, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.replaceItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.replaceItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.replaceItem(circle1, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.replaceItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.replaceItem must be an instance of SVGTransform.
PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 0) is circle1.transform.baseVal.getItem(0)
PASS circle1.transform.baseVal.numberOfItems is 4
PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
@@ -127,10 +127,10 @@
PASS circle1.getAttribute('transform') is "skewX(45)"
Test uncommon arguments for appendItem()
-PASS circle1.transform.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.appendItem(circle1) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
-PASS circle1.transform.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.appendItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.appendItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.appendItem(circle1) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.appendItem must be an instance of SVGTransform.
+PASS circle1.transform.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('newItem') to SVGTransformList.appendItem must be an instance of SVGTransform.
Testing animVal clear throws
PASS circle1.transform.animVal.clear() threw exception NoModificationAllowedError: The object can not be modified..
Modified: trunk/Source/WebCore/ChangeLog (249190 => 249191)
--- trunk/Source/WebCore/ChangeLog 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/ChangeLog 2019-08-28 07:10:44 UTC (rev 249191)
@@ -1,3 +1,29 @@
+2019-08-28 Said Abou-Hallawa <[email protected]>
+
+ SVG2: Add length, item getter and item setter to all SVG lists
+ https://bugs.webkit.org/show_bug.cgi?id=199526
+
+ Reviewed by Simon Fraser.
+
+ -- Implement the SVG2 specs for SVG lists:
+ https://svgwg.org/svg2-draft/types.html#TermListInterface.
+
+ -- Match the arguments' names in the IDL files with the specs.
+
+ Tests: svg/dom/SVGLengthList-length-indexed-access.xhtml
+ svg/dom/SVGPathSegList-length-indexed-access.xhtml
+
+ * svg/SVGLengthList.idl:
+ * svg/SVGNumberList.idl:
+ * svg/SVGPathSegList.h:
+ * svg/SVGPathSegList.idl:
+ * svg/SVGPointList.idl:
+ * svg/SVGStringList.idl:
+ * svg/SVGTransformList.idl:
+ * svg/properties/SVGList.h:
+ (WebCore::SVGList::length const):
+ (WebCore::SVGList::setItem):
+
2019-08-27 John Wilander <[email protected]> and Fujii Hironori <[email protected]>
Make FrameLoader::open() set outgoing referrer properly
Modified: trunk/Source/WebCore/svg/SVGLengthList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGLengthList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGLengthList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -27,13 +27,15 @@
[
SkipVTableValidation
] interface SVGLengthList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
- [MayThrowException] SVGLength initialize(SVGLength item);
- [MayThrowException] SVGLength getItem(unsigned long index);
- [MayThrowException] SVGLength insertItemBefore(SVGLength item, unsigned long index);
- [MayThrowException] SVGLength replaceItem(SVGLength item, unsigned long index);
+ [MayThrowException] SVGLength initialize(SVGLength newItem);
+ [MayThrowException] getter SVGLength getItem(unsigned long index);
+ [MayThrowException] SVGLength insertItemBefore(SVGLength newItem, unsigned long index);
+ [MayThrowException] SVGLength replaceItem(SVGLength newItem, unsigned long index);
[MayThrowException] SVGLength removeItem(unsigned long index);
- [MayThrowException] SVGLength appendItem(SVGLength item);
+ [MayThrowException] SVGLength appendItem(SVGLength newItem);
+ [MayThrowException] setter void (unsigned long index, SVGLength newItem);
};
Modified: trunk/Source/WebCore/svg/SVGNumberList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGNumberList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGNumberList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -25,13 +25,15 @@
*/
interface SVGNumberList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
- [MayThrowException] SVGNumber initialize(SVGNumber item);
- [MayThrowException] SVGNumber getItem(unsigned long index);
- [MayThrowException] SVGNumber insertItemBefore(SVGNumber item, unsigned long index);
- [MayThrowException] SVGNumber replaceItem(SVGNumber item, unsigned long index);
+ [MayThrowException] SVGNumber initialize(SVGNumber newItem);
+ [MayThrowException] getter SVGNumber getItem(unsigned long index);
+ [MayThrowException] SVGNumber insertItemBefore(SVGNumber newItem, unsigned long index);
+ [MayThrowException] SVGNumber replaceItem(SVGNumber newItem, unsigned long index);
[MayThrowException] SVGNumber removeItem(unsigned long index);
- [MayThrowException] SVGNumber appendItem(SVGNumber item);
+ [MayThrowException] SVGNumber appendItem(SVGNumber newItem);
+ [MayThrowException] setter void (unsigned long index, SVGNumber newItem);
};
Modified: trunk/Source/WebCore/svg/SVGPathSegList.h (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGPathSegList.h 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGPathSegList.h 2019-08-28 07:10:44 UTC (rev 249191)
@@ -58,6 +58,9 @@
return *this;
}
+ // Override SVGList::length() because numberOfItems() isn't virtual.
+ unsigned length() const { return numberOfItems(); }
+
unsigned numberOfItems() const
{
const_cast<SVGPathSegList*>(this)->ensureItems();
@@ -111,6 +114,15 @@
return Base::appendItem(WTFMove(newItem));
}
+ // Override SVGList::setItem() because replaceItem() isn't virtual.
+ ExceptionOr<void> setItem(unsigned index, Ref<SVGPathSeg>&& newItem)
+ {
+ auto result = replaceItem(WTFMove(newItem), index);
+ if (result.hasException())
+ return result.releaseException();
+ return { };
+ }
+
const SVGPathByteStream& pathByteStream() const { return const_cast<SVGPathSegList*>(this)->pathByteStream(); }
SVGPathByteStream& pathByteStream()
{
Modified: trunk/Source/WebCore/svg/SVGPathSegList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGPathSegList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGPathSegList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -25,13 +25,15 @@
*/
interface SVGPathSegList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
[MayThrowException] SVGPathSeg initialize(SVGPathSeg newItem);
- [MayThrowException] SVGPathSeg getItem(unsigned long index);
+ [MayThrowException] getter SVGPathSeg getItem(unsigned long index);
[MayThrowException] SVGPathSeg insertItemBefore(SVGPathSeg newItem, unsigned long index);
[MayThrowException] SVGPathSeg replaceItem(SVGPathSeg newItem, unsigned long index);
[MayThrowException] SVGPathSeg removeItem(unsigned long index);
[MayThrowException] SVGPathSeg appendItem(SVGPathSeg newItem);
+ [MayThrowException] setter void (unsigned long index, SVGPathSeg newItem);
};
Modified: trunk/Source/WebCore/svg/SVGPointList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGPointList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGPointList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -24,13 +24,15 @@
*/
interface SVGPointList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
- [MayThrowException] SVGPoint initialize(SVGPoint item);
- [MayThrowException] SVGPoint getItem(unsigned long index);
- [MayThrowException] SVGPoint insertItemBefore(SVGPoint item, unsigned long index);
- [MayThrowException] SVGPoint replaceItem(SVGPoint item, unsigned long index);
+ [MayThrowException] SVGPoint initialize(SVGPoint newItem);
+ [MayThrowException] getter SVGPoint getItem(unsigned long index);
+ [MayThrowException] SVGPoint insertItemBefore(SVGPoint newItem, unsigned long index);
+ [MayThrowException] SVGPoint replaceItem(SVGPoint newItem, unsigned long index);
[MayThrowException] SVGPoint removeItem(unsigned long index);
- [MayThrowException] SVGPoint appendItem(SVGPoint item);
+ [MayThrowException] SVGPoint appendItem(SVGPoint newItem);
+ [MayThrowException] setter void (unsigned long index, SVGPoint newItem);
};
Modified: trunk/Source/WebCore/svg/SVGStringList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGStringList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGStringList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -24,13 +24,15 @@
*/
interface SVGStringList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
- [MayThrowException] DOMString initialize(DOMString item);
- [MayThrowException] DOMString getItem(unsigned long index);
- [MayThrowException] DOMString insertItemBefore(DOMString item, unsigned long index);
- [MayThrowException] DOMString replaceItem(DOMString item, unsigned long index);
+ [MayThrowException] DOMString initialize(DOMString newItem);
+ [MayThrowException] getter DOMString getItem(unsigned long index);
+ [MayThrowException] DOMString insertItemBefore(DOMString newItem, unsigned long index);
+ [MayThrowException] DOMString replaceItem(DOMString newItem, unsigned long index);
[MayThrowException] DOMString removeItem(unsigned long index);
- [MayThrowException] DOMString appendItem(DOMString item);
+ [MayThrowException] DOMString appendItem(DOMString newItem);
+ [MayThrowException] setter void (unsigned long index, DOMString newItem);
};
Modified: trunk/Source/WebCore/svg/SVGTransformList.idl (249190 => 249191)
--- trunk/Source/WebCore/svg/SVGTransformList.idl 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/SVGTransformList.idl 2019-08-28 07:10:44 UTC (rev 249191)
@@ -25,15 +25,17 @@
*/
interface SVGTransformList {
+ readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;
[MayThrowException] void clear();
- [MayThrowException] SVGTransform initialize(SVGTransform item);
- [MayThrowException] SVGTransform getItem(unsigned long index);
- [MayThrowException] SVGTransform insertItemBefore(SVGTransform item, unsigned long index);
- [MayThrowException] SVGTransform replaceItem(SVGTransform item, unsigned long index);
+ [MayThrowException] SVGTransform initialize(SVGTransform newItem);
+ [MayThrowException] getter SVGTransform getItem(unsigned long index);
+ [MayThrowException] SVGTransform insertItemBefore(SVGTransform newItem, unsigned long index);
+ [MayThrowException] SVGTransform replaceItem(SVGTransform newItem, unsigned long index);
[MayThrowException] SVGTransform removeItem(unsigned long index);
- [MayThrowException] SVGTransform appendItem(SVGTransform item);
+ [MayThrowException] SVGTransform appendItem(SVGTransform newItem);
+ [MayThrowException] setter void (unsigned long index, SVGTransform newItem);
[MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
[MayThrowException] SVGTransform consolidate();
Modified: trunk/Source/WebCore/svg/properties/SVGList.h (249190 => 249191)
--- trunk/Source/WebCore/svg/properties/SVGList.h 2019-08-28 03:15:33 UTC (rev 249190)
+++ trunk/Source/WebCore/svg/properties/SVGList.h 2019-08-28 07:10:44 UTC (rev 249191)
@@ -33,6 +33,8 @@
template<typename ItemType>
class SVGList : public SVGProperty {
public:
+ unsigned length() const { return numberOfItems(); }
+
unsigned numberOfItems() const
{
return m_items.size();
@@ -127,6 +129,14 @@
return item;
}
+ ExceptionOr<void> setItem(unsigned index, ItemType&& newItem)
+ {
+ auto result = replaceItem(WTFMove(newItem), index);
+ if (result.hasException())
+ return result.releaseException();
+ return { };
+ }
+
// Parsers and animators need to have a direct access to the items.
Vector<ItemType>& items() { return m_items; }
const Vector<ItemType>& items() const { return m_items; }