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

Side by Side Diff: LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml

Issue 1177303004: Updated SVGListPropertyHelper as per SVG2 Spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed presubmit error Created 5 years, 6 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="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="250" height="250"> 7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="250" height="250">
8 <g transform="translate(10, 10)"> 8 <g transform="translate(10, 10)">
9 <path id="path1" d="M 0 0 L 100 0 L 100 100" fill="green"/> 9 <path id="path1" d="M 0 0 L 100 0 L 100 100" fill="green"/>
10 <path transform="translate(110, 0)" id="path2" d="M 0 0 L 50 100 h 100 h 100 v 100" fill="green"/> 10 <path transform="translate(110, 0)" id="path2" d="M 0 0 L 50 100 h 100 h 100 v 100" fill="green"/>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 48 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]");
49 shouldBe("path2.pathSegList.getItem(3).x", "100"); 49 shouldBe("path2.pathSegList.getItem(3).x", "100");
50 shouldBeEqualToString("path2.pathSegList.getItem(4).toString()", "[object SV GPathSegLinetoVerticalRel]"); 50 shouldBeEqualToString("path2.pathSegList.getItem(4).toString()", "[object SV GPathSegLinetoVerticalRel]");
51 shouldBe("path2.pathSegList.getItem(4).y", "100"); 51 shouldBe("path2.pathSegList.getItem(4).y", "100");
52 52
53 debug(""); 53 debug("");
54 debug("Negate x value of fourth segment in path2"); 54 debug("Negate x value of fourth segment in path2");
55 shouldBe("path2.pathSegList.getItem(3).x = -path2.pathSegList.getItem(3).x", "-100"); 55 shouldBe("path2.pathSegList.getItem(3).x = -path2.pathSegList.getItem(3).x", "-100");
56 56
57 debug("") 57 debug("")
58 debug("Swap segment four and five of path2 - now should look like a rectangl e"); 58 debug("Append second item from path1 to path2 list");
59 shouldBeEqualToString("path2.pathSegList.appendItem(path2.pathSegList.getIte m(3)).toString()", "[object SVGPathSegLinetoHorizontalRel]"); 59 shouldBeEqualToString("path2.pathSegList.appendItem(path2.pathSegList.getIte m(3)).toString()", "[object SVGPathSegLinetoHorizontalRel]");
60 60 shouldBe("path2.pathSegList.numberOfItems", "6");
61 shouldBeEqualToString("path2.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]");
62 shouldBe("path2.pathSegList.getItem(0).x", "0");
63 shouldBe("path2.pathSegList.getItem(0).y", "0");
64 shouldBeEqualToString("path2.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]");
65 shouldBe("path2.pathSegList.getItem(1).x", "50");
66 shouldBe("path2.pathSegList.getItem(1).y", "100");
67 shouldBeEqualToString("path2.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoHorizontalRel]");
68 shouldBe("path2.pathSegList.getItem(2).x", "100");
69 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]");
70 shouldBe("path2.pathSegList.getItem(3).x", "-100");
71 shouldBeEqualToString("path2.pathSegList.getItem(4).toString()", "[object SV GPathSegLinetoVerticalRel]");
72 shouldBe("path2.pathSegList.getItem(4).y", "100");
73 shouldBeEqualToString("path2.pathSegList.getItem(5).toString()", "[object SV GPathSegLinetoHorizontalRel]");
74 shouldBe("path2.pathSegList.getItem(5).x", "-100");
75
61 debug(""); 76 debug("");
62 debug("Append second item from path2 to path1 list"); 77 debug("Append second item from path2 to path1 list");
63 shouldBeEqualToString("path1.pathSegList.appendItem(path2.pathSegList.getIte m(1)).toString()", "[object SVGPathSegLinetoAbs]"); 78 shouldBeEqualToString("path1.pathSegList.appendItem(path2.pathSegList.getIte m(1)).toString()", "[object SVGPathSegLinetoAbs]");
64 79
65 debug(""); 80 debug("");
66 debug("Change last item of path1 list, that came from path2 list, assure it' s updating path1"); 81 debug("Change last item of path1 list, that came from path2 list, assure it' s updating path1");
67 shouldBe("path1.pathSegList.getItem(3).x -= 50", "0"); 82 shouldBe("path1.pathSegList.getItem(3).x -= 50", "0");
68 83
69 debug(""); 84 debug("");
85 debug("Reset points attribute to M 0 0 L 100 0 v 100");
86 shouldBeUndefined("path2.setAttribute('d', 'M 0 0 L 100 0 v 100')");
87
88 debug("")
89 debug("Append fourth item from path1 to path2 list - now should look like a rectangle");
90 shouldBeEqualToString("path2.pathSegList.appendItem(path1.pathSegList.getIte m(3)).toString()", "[object SVGPathSegLinetoAbs]");
91
92 debug("");
70 debug("Check final 'pathSegList' value of path1"); 93 debug("Check final 'pathSegList' value of path1");
71 shouldBe("path1.pathSegList.numberOfItems", "4"); 94 shouldBe("path1.pathSegList.numberOfItems", "4");
72 shouldBeEqualToString("path1.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]"); 95 shouldBeEqualToString("path1.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]");
73 shouldBe("path1.pathSegList.getItem(0).x", "0"); 96 shouldBe("path1.pathSegList.getItem(0).x", "0");
74 shouldBe("path1.pathSegList.getItem(0).y", "0"); 97 shouldBe("path1.pathSegList.getItem(0).y", "0");
75 shouldBeEqualToString("path1.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]"); 98 shouldBeEqualToString("path1.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]");
76 shouldBe("path1.pathSegList.getItem(1).x", "100"); 99 shouldBe("path1.pathSegList.getItem(1).x", "100");
77 shouldBe("path1.pathSegList.getItem(1).y", "0"); 100 shouldBe("path1.pathSegList.getItem(1).y", "0");
78 shouldBeEqualToString("path1.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoAbs]"); 101 shouldBeEqualToString("path1.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoAbs]");
79 shouldBe("path1.pathSegList.getItem(2).x", "100"); 102 shouldBe("path1.pathSegList.getItem(2).x", "100");
80 shouldBe("path1.pathSegList.getItem(2).y", "100"); 103 shouldBe("path1.pathSegList.getItem(2).y", "100");
81 shouldBeEqualToString("path1.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoAbs]"); 104 shouldBeEqualToString("path1.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoAbs]");
82 shouldBe("path1.pathSegList.getItem(3).x", "0"); 105 shouldBe("path1.pathSegList.getItem(3).x", "0");
83 shouldBe("path1.pathSegList.getItem(3).y", "100"); 106 shouldBe("path1.pathSegList.getItem(3).y", "100");
84 107
85 debug(""); 108 debug("");
86 debug("Check final 'pathSegList' value of path2"); 109 debug("Check final 'pathSegList' value of path2");
87 shouldBe("path2.pathSegList.numberOfItems", "4"); 110 shouldBe("path2.pathSegList.numberOfItems", "4");
88 shouldBeEqualToString("path2.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]"); 111 shouldBeEqualToString("path2.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]");
89 shouldBe("path2.pathSegList.getItem(0).x", "0"); 112 shouldBe("path2.pathSegList.getItem(0).x", "0");
90 shouldBe("path2.pathSegList.getItem(0).y", "0"); 113 shouldBe("path2.pathSegList.getItem(0).y", "0");
91 shouldBeEqualToString("path2.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 114 shouldBeEqualToString("path2.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]");
92 shouldBe("path2.pathSegList.getItem(1).x", "100"); 115 shouldBe("path2.pathSegList.getItem(1).x", "100");
116 shouldBe("path1.pathSegList.getItem(1).y", "0");
93 shouldBeEqualToString("path2.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoVerticalRel]"); 117 shouldBeEqualToString("path2.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoVerticalRel]");
94 shouldBe("path2.pathSegList.getItem(2).y", "100"); 118 shouldBe("path2.pathSegList.getItem(2).y", "100");
95 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 119 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoAbs]");
96 shouldBe("path2.pathSegList.getItem(3).x", "-100"); 120 shouldBe("path2.pathSegList.getItem(3).x", "0");
121 shouldBe("path1.pathSegList.getItem(3).y", "100");
97 122
98 ]]> 123 ]]>
99 </script> 124 </script>
100 </body> 125 </body>
101 </html> 126 </html>
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/SVGNumberList-basics-expected.txt ('k') | LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698