Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: LayoutTests/svg/dom/SVGTransformList-basics.xhtml

Issue 12288020: Merge 142759 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html xmlns="http://www.w3.org/1999/xhtml"> 1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head> 2 <head>
3 <script>window.enablePixelTesting = true;</script> 3 <script>window.enablePixelTesting = true;</script>
4 <script src="../../fast/js/resources/js-test-pre.js"></script> 4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> 7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
8 <circle id="circle1" cx="40" cy="40" r="40" fill="green" transform="scale(2, 2) translate(10 10)"/> 8 <circle id="circle1" cx="40" cy="40" r="40" fill="green" transform="scale(2, 2) translate(10 10)"/>
9 </svg> 9 </svg>
10 10
11 <p id="description"></p> 11 <p id="description"></p>
12 <div id="console"></div> 12 <div id="console"></div>
13 <script type="text/javascript"> 13 <script type="text/javascript">
14 <![CDATA[ 14 <![CDATA[
15 description("This is a test of the simple SVGTransformList API parts."); 15 description("This is a test of the simple SVGTransformList API parts.");
16 16
17 if (window.testRunner)
18 testRunner.dumpAsText();
19
17 function dumpMatrix(matrix) { 20 function dumpMatrix(matrix) {
18 return "[" + matrix.a.toFixed(1) 21 return "[" + matrix.a.toFixed(1)
19 + " " + matrix.b.toFixed(1) 22 + " " + matrix.b.toFixed(1)
20 + " " + matrix.c.toFixed(1) 23 + " " + matrix.c.toFixed(1)
21 + " " + matrix.d.toFixed(1) 24 + " " + matrix.d.toFixed(1)
22 + " " + matrix.e.toFixed(1) 25 + " " + matrix.e.toFixed(1)
23 + " " + matrix.f.toFixed(1) 26 + " " + matrix.f.toFixed(1)
24 + "]"; 27 + "]";
25 } 28 }
26 29
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 shouldThrow("circle1.transform.baseVal.replaceItem(30)"); 117 shouldThrow("circle1.transform.baseVal.replaceItem(30)");
115 shouldThrow("circle1.transform.baseVal.replaceItem('aString')"); 118 shouldThrow("circle1.transform.baseVal.replaceItem('aString')");
116 shouldThrow("circle1.transform.baseVal.replaceItem(circle1)"); 119 shouldThrow("circle1.transform.baseVal.replaceItem(circle1)");
117 shouldThrow("circle1.transform.baseVal.replaceItem(null)"); 120 shouldThrow("circle1.transform.baseVal.replaceItem(null)");
118 shouldThrow("circle1.transform.baseVal.replaceItem(30, 0)"); 121 shouldThrow("circle1.transform.baseVal.replaceItem(30, 0)");
119 shouldThrow("circle1.transform.baseVal.replaceItem('aString', 0)"); 122 shouldThrow("circle1.transform.baseVal.replaceItem('aString', 0)");
120 shouldThrow("circle1.transform.baseVal.replaceItem(circle1, 0)"); 123 shouldThrow("circle1.transform.baseVal.replaceItem(circle1, 0)");
121 shouldThrow("circle1.transform.baseVal.replaceItem(null, 0)"); 124 shouldThrow("circle1.transform.baseVal.replaceItem(null, 0)");
122 125
123 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), 0)", "circle1.transform.baseVal.getItem(0)"); 126 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), 0)", "circle1.transform.baseVal.getItem(0)");
124 shouldBe("circle1.transform.baseVal.numberOfItems", "3"); 127 shouldBe("circle1.transform.baseVal.numberOfItems", "4");
125 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"); 128 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
126 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); 129 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
127 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"); 130 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
128 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) trans late(10 10) skewX(45)"); 131 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(3))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
132 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) scale (2 2) translate(10 10) skewX(45)");
129 133
130 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), 'aString')", "circle1.transform.baseVal.getItem(0)"); 134 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), 'aString')", "circle1.transform.baseVal.getItem(0)");
131 shouldBe("circle1.transform.baseVal.numberOfItems", "2"); 135 shouldBe("circle1.transform.baseVal.numberOfItems", "4");
132 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"); 136 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
133 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"); 137 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
134 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) skewX (45)"); 138 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
139 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(3))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
140 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) scale (2 2) translate(10 10) skewX(45)");
135 141
136 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), circle1)", "circle1.transform.baseVal.getItem(0)"); 142 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), circle1)", "circle1.transform.baseVal.getItem(0)");
137 shouldBe("circle1.transform.baseVal.numberOfItems", "1"); 143 shouldBe("circle1.transform.baseVal.numberOfItems", "4");
138 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"); 144 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
139 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90)"); 145 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
146 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
147 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(3))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
148 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) scale (2 2) translate(10 10) skewX(45)");
140 149
141 shouldThrow("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal .getItem(0), null)"); 150 shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.ge tItem(0), null)", "circle1.transform.baseVal.getItem(0)");
142 shouldBe("circle1.transform.baseVal.numberOfItems", "0"); 151 shouldBe("circle1.transform.baseVal.numberOfItems", "4");
143 shouldBeEqualToString("circle1.getAttribute('transform')", ""); 152 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) scale (2 2) translate(10 10) skewX(45)");
144 153
145 debug(""); 154 debug("");
146 debug("Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1"); 155 debug("Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1");
147 shouldBeUndefined("circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)')"); 156 shouldBeUndefined("circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)')");
148 157
149 debug(""); 158 debug("");
150 debug("Test uncommon arguments for removeItem()"); 159 debug("Test uncommon arguments for removeItem()");
151 shouldThrow("circle1.transform.baseVal.removeItem(30)"); 160 shouldThrow("circle1.transform.baseVal.removeItem(30)");
152 161
153 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(0) )", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"); 162 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(0) )", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.appendItem(tr ansform))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]"); 198 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.appendItem(tr ansform))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]");
190 shouldBe("circle1.transform.baseVal.numberOfItems", "1"); 199 shouldBe("circle1.transform.baseVal.numberOfItems", "1");
191 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]"); 200 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]");
192 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(45 50 100 )"); 201 shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(45 50 100 )");
193 202
194 ]]> 203 ]]>
195 </script> 204 </script>
196 <script src="../../fast/js/resources/js-test-post.js"></script> 205 <script src="../../fast/js/resources/js-test-post.js"></script>
197 </body> 206 </body>
198 </html> 207 </html>
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/SVGPointList-basics-expected.txt ('k') | LayoutTests/svg/dom/SVGTransformList-basics-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698