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

Side by Side Diff: LayoutTests/svg/dom/SVGLengthList-insertItemBefore.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="200" height="200"> 7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
8 <text id="text1" x="500 1000 1500" y="50"> ABC </text> 8 <text id="text1" x="500 1000 1500" y="50"> ABC </text>
9 <text id="reference" x="50 100 150" y="100"> ABC </text> 9 <text id="reference" x="50 100 150" y="100"> ABC </text>
10 </svg> 10 </svg>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 2)", "newLength3"); 89 shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 2)", "newLength3");
90 shouldBe("text1.x.baseVal.numberOfItems", "6"); 90 shouldBe("text1.x.baseVal.numberOfItems", "6");
91 shouldBe("text1.x.baseVal.getItem(0).value", "100"); 91 shouldBe("text1.x.baseVal.getItem(0).value", "100");
92 shouldBe("text1.x.baseVal.getItem(1).value", "500"); 92 shouldBe("text1.x.baseVal.getItem(1).value", "500");
93 shouldBe("text1.x.baseVal.getItem(2).value", "150"); 93 shouldBe("text1.x.baseVal.getItem(2).value", "150");
94 shouldBe("text1.x.baseVal.getItem(3).value", "1000"); 94 shouldBe("text1.x.baseVal.getItem(3).value", "1000");
95 shouldBe("text1.x.baseVal.getItem(4).value", "1500"); 95 shouldBe("text1.x.baseVal.getItem(4).value", "1500");
96 shouldBe("text1.x.baseVal.getItem(5).value", "50"); 96 shouldBe("text1.x.baseVal.getItem(5).value", "50");
97 shouldThrow("text1.x.baseVal.getItem(6)"); 97 shouldThrow("text1.x.baseVal.getItem(6)");
98 98
99 // Spec: If newItem is already in a list, it is removed from its previous li st before it is inserted into this list. 99 // Spec: If newItem is already in a list, then a new object is created with the same values as newItem and this item is inserted into the list.
100 // Spec: If the item is already in this list, note that the index of the ite m to insert before is before the removal of the item. 100 // Otherwise, newItem itself is inserted into the list..
101 debug(""); 101 debug("");
102 debug("Insert item 'newLength3' at position=1, between '100' and '500', remo ve it from the old position=2 afterwards."); 102 debug("Insert item 'newLength3' at position=1, between '100' and '500', shou ld not remove it from the old position=2 afterwards.");
103 shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 1)", "newLength3"); 103 shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 1)", "newLength3");
104 shouldBe("text1.x.baseVal.numberOfItems", "6"); 104 shouldBe("text1.x.baseVal.numberOfItems", "7");
105 shouldBe("text1.x.baseVal.getItem(0).value", "100"); 105 shouldBe("text1.x.baseVal.getItem(0).value", "100");
106 shouldBe("text1.x.baseVal.getItem(1).value", "150"); 106 shouldBe("text1.x.baseVal.getItem(1).value", "150");
107 shouldBe("text1.x.baseVal.getItem(2).value", "500"); 107 shouldBe("text1.x.baseVal.getItem(2).value", "500");
108 shouldBe("text1.x.baseVal.getItem(3).value", "1000"); 108 shouldBe("text1.x.baseVal.getItem(3).value", "150");
109 shouldBe("text1.x.baseVal.getItem(4).value", "1500"); 109 shouldBe("text1.x.baseVal.getItem(4).value", "1000");
110 shouldBe("text1.x.baseVal.getItem(5).value", "50"); 110 shouldBe("text1.x.baseVal.getItem(5).value", "1500");
111 shouldThrow("text1.x.baseVal.getItem(6)"); 111 shouldBe("text1.x.baseVal.getItem(6).value", "50");
112 shouldThrow("text1.x.baseVal.getItem(7)");
112 113
113 debug(""); 114 debug("");
114 debug("Insert item 'newLength3' at position=0, before '100', remove it from the old position=5 afterwards."); 115 debug("Insert item 'newLength1' at position=0, before '100', should not remo ve it from the old position=6 afterwards.");
115 shouldBe("text1.x.baseVal.insertItemBefore(newLength1, 0)", "newLength1"); 116 shouldBe("text1.x.baseVal.insertItemBefore(newLength1, 0)", "newLength1");
116 shouldBe("text1.x.baseVal.numberOfItems", "6"); 117 shouldBe("text1.x.baseVal.numberOfItems", "8");
117 shouldBe("text1.x.baseVal.getItem(0).value", "50"); 118 shouldBe("text1.x.baseVal.getItem(0).value", "50");
118 shouldBe("text1.x.baseVal.getItem(1).value", "100"); 119 shouldBe("text1.x.baseVal.getItem(1).value", "100");
119 shouldBe("text1.x.baseVal.getItem(2).value", "150"); 120 shouldBe("text1.x.baseVal.getItem(2).value", "150");
120 shouldBe("text1.x.baseVal.getItem(3).value", "500"); 121 shouldBe("text1.x.baseVal.getItem(3).value", "500");
121 shouldBe("text1.x.baseVal.getItem(4).value", "1000"); 122 shouldBe("text1.x.baseVal.getItem(4).value", "150");
122 shouldBe("text1.x.baseVal.getItem(5).value", "1500"); 123 shouldBe("text1.x.baseVal.getItem(5).value", "1000");
123 shouldThrow("text1.x.baseVal.getItem(6)"); 124 shouldBe("text1.x.baseVal.getItem(6).value", "1500");
125 shouldBe("text1.x.baseVal.getItem(7).value", "50");
126 shouldThrow("text1.x.baseVal.getItem(8)");
124 127
125 debug(""); 128 debug("");
126 debug("The test passes if you only see 'PASS' messages, and both text elemen ts on top look the same"); 129 debug("The test passes if you only see 'PASS' messages, and both text elemen ts on top look the same");
127 debug(""); 130 debug("");
128 131
129 ]]> 132 ]]>
130 </script> 133 </script>
131 </body> 134 </body>
132 </html> 135 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698