| OLD | NEW |
| 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="25"> ABC </text> | 8 <text id="text1" x="500 1000 1500" y="25"> ABC </text> |
| 9 <text id="text2" x="50 500" y="50"> ABC </text> | 9 <text id="text2" x="50 500" y="50"> ABC </text> |
| 10 <text id="text3" x="50 500 50" y="75">ABC</text> | 10 <text id="text3" x="50 500 50" y="75">ABC</text> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 shouldBe("text1.x.baseVal.initialize(newLength)", "newLength"); | 64 shouldBe("text1.x.baseVal.initialize(newLength)", "newLength"); |
| 65 shouldBe("text1.x.baseVal.getItem(0)", "newLength"); | 65 shouldBe("text1.x.baseVal.getItem(0)", "newLength"); |
| 66 | 66 |
| 67 debug(""); | 67 debug(""); |
| 68 debug("Take the second x item '500' of the second text element, store it in
'itemInAnotherList' change it to '50'"); | 68 debug("Take the second x item '500' of the second text element, store it in
'itemInAnotherList' change it to '50'"); |
| 69 shouldBe("text2.x.baseVal.getItem(1).value", "500"); | 69 shouldBe("text2.x.baseVal.getItem(1).value", "500"); |
| 70 var itemInAnotherList = text2.x.baseVal.getItem(1); | 70 var itemInAnotherList = text2.x.baseVal.getItem(1); |
| 71 itemInAnotherList.value = 50; | 71 itemInAnotherList.value = 50; |
| 72 shouldBe("text2.x.baseVal.getItem(1).value", "50"); | 72 shouldBe("text2.x.baseVal.getItem(1).value", "50"); |
| 73 | 73 |
| 74 // Spec: If the inserted item is already in a list, it is removed from its p
revious list before it is inserted into this list. | 74 // SVG2-Draft Spec: If newItem is already in a list, then a new object is cr
eated with the same values as newItem and this item is inserted into the list. |
| 75 // The inserted item is the item itself and not a copy. | 75 // Otherwise, newItem itself is inserted into the list.. |
| 76 debug(""); | 76 debug(""); |
| 77 debug("Override the third text elements x list with the item x=50 from the s
econd text element, where it should be removed afterwards"); | 77 debug("Override the third text elements x list with the item x=50 from the s
econd text element, where it should not be removed afterwards"); |
| 78 shouldBe("text3.x.baseVal.initialize(itemInAnotherList)", "itemInAnotherList
"); | 78 shouldBe("text3.x.baseVal.initialize(itemInAnotherList)", "itemInAnotherList
"); |
| 79 shouldBe("text3.x.baseVal.getItem(0).value", "50"); | 79 shouldBe("text3.x.baseVal.getItem(0).value", "50"); |
| 80 shouldBe("text2.x.baseVal.getItem(0).value", "50"); | 80 shouldBe("text2.x.baseVal.getItem(0).value", "50"); |
| 81 shouldThrow("text2.x.baseVal.getItem(1)"); | 81 shouldNotThrow("text2.x.baseVal.getItem(1)"); |
| 82 | 82 |
| 83 debug("") | 83 debug("") |
| 84 debug("Assure that the 'itemInAnotherList' item is still live anymore, set v
alue to 999 then back to 50"); | 84 debug("Assure that the 'itemInAnotherList' item is still live anymore, set v
alue to 999 then back to 50"); |
| 85 shouldBe("itemInAnotherList.value = 999;", "999"); | 85 shouldBe("itemInAnotherList.value = 999;", "999"); |
| 86 shouldBe("itemInAnotherList.value", "999"); | 86 shouldBe("itemInAnotherList.value", "999"); |
| 87 shouldBe("text3.x.baseVal.getItem(0).value", "999"); | 87 shouldBe("text3.x.baseVal.getItem(0).value", "50"); |
| 88 shouldBe("itemInAnotherList.value = 50;", "50"); | 88 shouldBe("itemInAnotherList.value = 50;", "50"); |
| 89 shouldBe("itemInAnotherList.value", "50"); | 89 shouldBe("itemInAnotherList.value", "50"); |
| 90 shouldBe("text3.x.baseVal.getItem(0).value", "50"); | 90 shouldBe("text3.x.baseVal.getItem(0).value", "50"); |
| 91 | 91 |
| 92 debug(""); | 92 debug(""); |
| 93 debug("Move item from text3 to text4"); | 93 debug("Copy item from text3 to text4"); |
| 94 shouldBe("text4.x.baseVal.initialize(text3.x.baseVal.getItem(0))", "itemInAn
otherList"); | 94 shouldBe("text4.x.baseVal.initialize(text3.x.baseVal.getItem(0))", "itemInAn
otherList"); |
| 95 shouldBe("text4.x.baseVal.getItem(0).value", "50"); | 95 shouldBe("text4.x.baseVal.getItem(0).value", "50"); |
| 96 shouldThrow("text3.x.baseVal.getItem(0)"); | 96 shouldNotThrow("text3.x.baseVal.getItem(0)"); |
| 97 | 97 |
| 98 debug(""); | 98 debug(""); |
| 99 debug("Initialize text3 using setAttribute('x', '50')"); | 99 debug("Initialize text2 using setAttribute('x', '50')"); |
| 100 text3.setAttribute("x", "50"); | 100 text2.setAttribute("x", "50"); |
| 101 shouldBe("text3.x.baseVal.getItem(0).value", "50"); | 101 shouldBe("text2.x.baseVal.getItem(0).value", "50"); |
| 102 | 102 |
| 103 debug(""); | 103 debug(""); |
| 104 debug("Final check whether the lists all look like expected"); | 104 debug("Final check whether the lists all look like expected"); |
| 105 shouldBe("text1.x.baseVal.getItem(0).value", "50"); | 105 shouldBe("text1.x.baseVal.getItem(0).value", "50"); |
| 106 shouldBe("text2.x.baseVal.getItem(0).value", "50"); | 106 shouldBe("text2.x.baseVal.getItem(0).value", "50"); |
| 107 shouldBe("text3.x.baseVal.getItem(0).value", "50"); | 107 shouldBe("text3.x.baseVal.getItem(0).value", "50"); |
| 108 shouldBe("text4.x.baseVal.getItem(0).value", "50"); | 108 shouldBe("text4.x.baseVal.getItem(0).value", "50"); |
| 109 shouldBe("text1.x.baseVal.numberOfItems", "1"); | 109 shouldBe("text1.x.baseVal.numberOfItems", "1"); |
| 110 shouldBe("text2.x.baseVal.numberOfItems", "1"); | 110 shouldBe("text2.x.baseVal.numberOfItems", "1"); |
| 111 shouldBe("text3.x.baseVal.numberOfItems", "1"); | 111 shouldBe("text3.x.baseVal.numberOfItems", "1"); |
| 112 shouldBe("text4.x.baseVal.numberOfItems", "1"); | 112 shouldBe("text4.x.baseVal.numberOfItems", "1"); |
| 113 shouldThrow("text1.x.baseVal.getItem(1)"); | 113 shouldThrow("text1.x.baseVal.getItem(1)"); |
| 114 shouldThrow("text2.x.baseVal.getItem(1)"); | 114 shouldThrow("text2.x.baseVal.getItem(1)"); |
| 115 shouldThrow("text3.x.baseVal.getItem(1)"); | 115 shouldThrow("text3.x.baseVal.getItem(1)"); |
| 116 shouldThrow("text4.x.baseVal.getItem(1)"); | 116 shouldThrow("text4.x.baseVal.getItem(1)"); |
| 117 | 117 |
| 118 debug(""); | 118 debug(""); |
| 119 debug("The test passes if you only see 'PASS' messages, and all five text el
ements on top look the same"); | 119 debug("The test passes if you only see 'PASS' messages, and all five text el
ements on top look the same"); |
| 120 debug(""); | 120 debug(""); |
| 121 | 121 |
| 122 ]]> | 122 ]]> |
| 123 </script> | 123 </script> |
| 124 </body> | 124 </body> |
| 125 </html> | 125 </html> |
| OLD | NEW |