Index: LayoutTests/svg/dom/SVGLengthList-basics.xhtml |
=================================================================== |
--- LayoutTests/svg/dom/SVGLengthList-basics.xhtml (revision 143078) |
+++ LayoutTests/svg/dom/SVGLengthList-basics.xhtml (working copy) |
@@ -14,6 +14,9 @@ |
<![CDATA[ |
description("This is a test of the simple SVGLengthList API parts."); |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
var text1 = document.getElementById("text1"); |
// Spec: The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. |
@@ -82,6 +85,19 @@ |
debug(""); |
debug("Set x='1 2 3 4' for text1"); |
shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); |
+ |
+ debug(""); |
+ debug("Test edge cases for insertItemBefore()"); |
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); |
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(3)"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 3 4 2"); |
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "3 1 4 2"); |
+ |
+ debug(""); |
+ debug("Set x='1 2 3 4' for text1"); |
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); |
shouldBe("text1.x.baseVal.numberOfItems", "4"); |
shouldBe("text1.x.baseVal.getItem(0).value", "1"); |
shouldBe("text1.x.baseVal.getItem(1).value", "2"); |
@@ -101,27 +117,40 @@ |
shouldThrow("text1.x.baseVal.replaceItem(null, 0)"); |
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0)", "text1.x.baseVal.getItem(0)"); |
- shouldBe("text1.x.baseVal.numberOfItems", "3"); |
+ shouldBe("text1.x.baseVal.numberOfItems", "4"); |
shouldBe("text1.x.baseVal.getItem(0).value", "1"); |
- shouldBe("text1.x.baseVal.getItem(1).value", "3"); |
- shouldBe("text1.x.baseVal.getItem(2).value", "4"); |
- shouldBeEqualToString("text1.getAttribute('x')", "1 3 4"); |
+ shouldBe("text1.x.baseVal.getItem(1).value", "2"); |
+ shouldBe("text1.x.baseVal.getItem(2).value", "3"); |
+ shouldBe("text1.x.baseVal.getItem(3).value", "4"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); |
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 'aString')", "text1.x.baseVal.getItem(0)"); |
- shouldBe("text1.x.baseVal.numberOfItems", "2"); |
+ shouldBe("text1.x.baseVal.numberOfItems", "4"); |
shouldBe("text1.x.baseVal.getItem(0).value", "1"); |
- shouldBe("text1.x.baseVal.getItem(1).value", "4"); |
- shouldBeEqualToString("text1.getAttribute('x')", "1 4"); |
+ shouldBe("text1.x.baseVal.getItem(1).value", "2"); |
+ shouldBe("text1.x.baseVal.getItem(2).value", "3"); |
+ shouldBe("text1.x.baseVal.getItem(3).value", "4"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); |
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), text1)", "text1.x.baseVal.getItem(0)"); |
- shouldBe("text1.x.baseVal.numberOfItems", "1"); |
- shouldBeEqualToString("text1.getAttribute('x')", "1"); |
+ shouldBe("text1.x.baseVal.numberOfItems", "4"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); |
- shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), null)"); |
- shouldBe("text1.x.baseVal.numberOfItems", "0"); |
- shouldBeEqualToString("text1.getAttribute('x')", ""); |
+ debug(""); |
+ debug("Set x='1 2 3 4' for text1"); |
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); |
debug(""); |
+ debug("Test edge cases for replaceItem()"); |
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)"); |
+ shouldBe("text1.x.baseVal.numberOfItems", "4"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); |
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text1.x.baseVal.getItem(2)"); |
+ shouldBe("text1.x.baseVal.numberOfItems", "3"); |
+ shouldBeEqualToString("text1.getAttribute('x')", "1 3 2"); |
+ shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4)"); |
+ |
+ debug(""); |
debug("Set x='1 2 3 4' for text1"); |
shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); |