| OLD | NEW |
| (Empty) |
| 1 description("HTMLInputElement size attribute test"); | |
| 2 | |
| 3 function sizeAttributeEffect(value) | |
| 4 { | |
| 5 var element = document.createElement("input"); | |
| 6 element.setAttribute("size", value); | |
| 7 return element.size; | |
| 8 } | |
| 9 | |
| 10 shouldBe('document.createElement("input").size', '20'); | |
| 11 | |
| 12 shouldBe('sizeAttributeEffect("")', '20'); | |
| 13 | |
| 14 shouldBe('sizeAttributeEffect("1")', '1'); | |
| 15 shouldBe('sizeAttributeEffect("2")', '2'); | |
| 16 shouldBe('sizeAttributeEffect("10")', '10'); | |
| 17 | |
| 18 shouldBe('sizeAttributeEffect("0")', '20'); | |
| 19 | |
| 20 shouldBe('sizeAttributeEffect("-1")', '20'); | |
| 21 | |
| 22 shouldBe('sizeAttributeEffect("1x")', '1'); | |
| 23 shouldBe('sizeAttributeEffect("1.")', '1'); | |
| 24 shouldBe('sizeAttributeEffect("1.9")', '1'); | |
| 25 shouldBe('sizeAttributeEffect("2x")', '2'); | |
| 26 shouldBe('sizeAttributeEffect("2.")', '2'); | |
| 27 shouldBe('sizeAttributeEffect("2.9")', '2'); | |
| 28 | |
| 29 shouldBe('sizeAttributeEffect("a")', '20'); | |
| 30 shouldBe('sizeAttributeEffect("\v7")', '20'); | |
| 31 shouldBe('sizeAttributeEffect(" 7")', '7'); | |
| 32 | |
| 33 var arabicIndicDigitOne = String.fromCharCode(0x661); | |
| 34 shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', '20'); | |
| 35 shouldBe('sizeAttributeEffect("2" + arabicIndicDigitOne)', '2'); | |
| 36 | |
| 37 shouldBe('sizeAttributeEffect("2147483647")', '2147483647'); | |
| 38 shouldBe('sizeAttributeEffect("2147483648")', '20'); | |
| 39 shouldBe('sizeAttributeEffect("4294967295")', '20'); | |
| 40 shouldBe('sizeAttributeEffect("4294967296")', '20'); | |
| OLD | NEW |