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

Side by Side Diff: LayoutTests/svg/dom/SVGPathSegList-replaceItem.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 100 L 100 0 L 100 100 v 100 L 0 100" fil l="green"/> 9 <path id="path1" d="M 0 0 L 100 100 L 100 0 L 100 100 v 100 L 0 100" fil l="green"/>
10 <path transform="translate(110, 0)" id="path2" d="M 0 0 h 100 L 200 100 h -100" fill="green"/> 10 <path transform="translate(110, 0)" id="path2" d="M 0 0 h 100 L 200 100 h -100" fill="green"/>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 shouldBe("path2.pathSegList.getItem(2).y", "100"); 55 shouldBe("path2.pathSegList.getItem(2).y", "100");
56 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 56 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]");
57 shouldBe("path2.pathSegList.getItem(3).x", "-100"); 57 shouldBe("path2.pathSegList.getItem(3).x", "-100");
58 58
59 debug(""); 59 debug("");
60 debug("Replace second item with third item of path1"); 60 debug("Replace second item with third item of path1");
61 shouldBeEqualToString("path1.pathSegList.replaceItem(path1.pathSegList.getIt em(2), 1).toString()", "[object SVGPathSegLinetoAbs]"); 61 shouldBeEqualToString("path1.pathSegList.replaceItem(path1.pathSegList.getIt em(2), 1).toString()", "[object SVGPathSegLinetoAbs]");
62 62
63 debug(""); 63 debug("");
64 debug("Replace third item of path2 with fourth item of path1"); 64 debug("Replace third item of path2 with fourth item of path1");
65 shouldBeEqualToString("path2.pathSegList.replaceItem(path1.pathSegList.getIt em(3), 2).toString()", "[object SVGPathSegLinetoVerticalRel]"); 65 shouldBeEqualToString("path2.pathSegList.replaceItem(path1.pathSegList.getIt em(4), 2).toString()", "[object SVGPathSegLinetoVerticalRel]");
66 66
67 debug(""); 67 debug("");
68 debug("Reset points attribute to M 0 0 L 100 0 v 100");
69 shouldBeUndefined("path1.setAttribute('d', 'M 0 0 L 100 0 v 100 h 100')");
70
71 debug("");
72 debug("Replace fourth item of path1 with third item of path2");
73 shouldBeEqualToString("path1.pathSegList.replaceItem(path2.pathSegList.getIt em(3), 3).toString()", "[object SVGPathSegLinetoHorizontalRel]");
74
75 debug("");
68 debug("Check final 'pathSegList' value of path1"); 76 debug("Check final 'pathSegList' value of path1");
69 shouldBe("path1.pathSegList.numberOfItems", "4"); 77 shouldBe("path1.pathSegList.numberOfItems", "4");
70 shouldBeEqualToString("path1.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]"); 78 shouldBeEqualToString("path1.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]");
71 shouldBe("path1.pathSegList.getItem(0).x", "0"); 79 shouldBe("path1.pathSegList.getItem(0).x", "0");
72 shouldBe("path1.pathSegList.getItem(0).y", "0"); 80 shouldBe("path1.pathSegList.getItem(0).y", "0");
73 shouldBeEqualToString("path1.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]"); 81 shouldBeEqualToString("path1.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoAbs]");
74 shouldBe("path1.pathSegList.getItem(1).x", "100"); 82 shouldBe("path1.pathSegList.getItem(1).x", "100");
75 shouldBe("path1.pathSegList.getItem(1).y", "0"); 83 shouldBe("path1.pathSegList.getItem(1).y", "0");
76 shouldBeEqualToString("path1.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoAbs]"); 84 shouldBeEqualToString("path1.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoVerticalRel]");
77 shouldBe("path1.pathSegList.getItem(2).x", "100");
78 shouldBe("path1.pathSegList.getItem(2).y", "100"); 85 shouldBe("path1.pathSegList.getItem(2).y", "100");
79 shouldBeEqualToString("path1.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoAbs]"); 86 shouldBeEqualToString("path1.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]");
80 shouldBe("path1.pathSegList.getItem(3).x", "0"); 87 shouldBe("path1.pathSegList.getItem(3).x", "-100");
81 shouldBe("path1.pathSegList.getItem(3).y", "100");
82 88
83 debug(""); 89 debug("");
84 debug("Check final 'pathSegList' value of path2"); 90 debug("Check final 'pathSegList' value of path2");
85 shouldBe("path2.pathSegList.numberOfItems", "4"); 91 shouldBe("path2.pathSegList.numberOfItems", "4");
86 shouldBeEqualToString("path2.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]"); 92 shouldBeEqualToString("path2.pathSegList.getItem(0).toString()", "[object SV GPathSegMovetoAbs]");
87 shouldBe("path2.pathSegList.getItem(0).x", "0"); 93 shouldBe("path2.pathSegList.getItem(0).x", "0");
88 shouldBe("path2.pathSegList.getItem(0).y", "0"); 94 shouldBe("path2.pathSegList.getItem(0).y", "0");
89 shouldBeEqualToString("path2.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 95 shouldBeEqualToString("path2.pathSegList.getItem(1).toString()", "[object SV GPathSegLinetoHorizontalRel]");
90 shouldBe("path2.pathSegList.getItem(1).x", "100"); 96 shouldBe("path2.pathSegList.getItem(1).x", "100");
91 shouldBeEqualToString("path2.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoVerticalRel]"); 97 shouldBeEqualToString("path2.pathSegList.getItem(2).toString()", "[object SV GPathSegLinetoVerticalRel]");
92 shouldBe("path2.pathSegList.getItem(2).y", "100"); 98 shouldBe("path2.pathSegList.getItem(2).y", "100");
93 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]"); 99 shouldBeEqualToString("path2.pathSegList.getItem(3).toString()", "[object SV GPathSegLinetoHorizontalRel]");
94 shouldBe("path2.pathSegList.getItem(3).x", "-100"); 100 shouldBe("path2.pathSegList.getItem(3).x", "-100");
95 101
96 ]]> 102 ]]>
97 </script> 103 </script>
98 </body> 104 </body>
99 </html> 105 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698