| OLD | NEW |
| (Empty) |
| 1 description( | |
| 2 "This tests the HTMLImageElement border property." | |
| 3 ); | |
| 4 | |
| 5 function imageBorderWidth(borderValue, style) | |
| 6 { | |
| 7 var image = document.createElement("img"); | |
| 8 if (borderValue !== undefined) | |
| 9 image.setAttribute("border", borderValue); | |
| 10 image.setAttribute("style", style); | |
| 11 image.setAttribute("width", "0"); | |
| 12 document.body.appendChild(image); | |
| 13 var borderBoxWidth = image.offsetWidth; | |
| 14 document.body.removeChild(image); | |
| 15 return borderBoxWidth / 2; | |
| 16 } | |
| 17 | |
| 18 shouldBe("imageBorderWidth()", "0"); | |
| 19 shouldBe("imageBorderWidth(null)", "0"); | |
| 20 shouldBe("imageBorderWidth('')", "0"); | |
| 21 shouldBe("imageBorderWidth(0)", "0"); | |
| 22 shouldBe("imageBorderWidth('x')", "0"); | |
| 23 shouldBe("imageBorderWidth(undefined, 'border-width: 20px')", "0"); | |
| 24 | |
| 25 shouldBe("imageBorderWidth(null, 'border-width: 20px')", "20"); | |
| 26 shouldBe("imageBorderWidth('', 'border-width: 20px')", "20"); | |
| 27 shouldBe("imageBorderWidth('x', 'border-width: 20px')", "20"); | |
| 28 shouldBe("imageBorderWidth(0, 'border-width: 20px')", "20"); | |
| 29 | |
| 30 shouldBe("imageBorderWidth(10)", "10"); | |
| 31 shouldBe("imageBorderWidth(' 10')", "10"); | |
| 32 shouldBe("imageBorderWidth('10 ')", "10"); | |
| 33 shouldBe("imageBorderWidth(' 10 ')", "10"); | |
| 34 shouldBe("imageBorderWidth('10q')", "10"); | |
| 35 shouldBe("imageBorderWidth(' 10q')", "10"); | |
| 36 shouldBe("imageBorderWidth('10q ')", "10"); | |
| 37 shouldBe("imageBorderWidth(' 10q ')", "10"); | |
| OLD | NEW |