1 description("HTMLTableElement cellpadding attribute test");
3 function cellPaddingAttributeEffect(value)
5 var table = document.createElement("table");
6 table.setAttribute("cellpadding", value);
7 var cell = document.createElement("td");
8 table.appendChild(cell);
9 document.body.appendChild(table);
10 var computedStyle = getComputedStyle(cell, "");
11 var result = computedStyle.paddingTop;
12 document.body.removeChild(table);
16 shouldBe('cellPaddingAttributeEffect("")', '"1px"');
18 shouldBe('cellPaddingAttributeEffect("1")', '"1px"');
19 shouldBe('cellPaddingAttributeEffect("2")', '"2px"');
20 shouldBe('cellPaddingAttributeEffect("10")', '"10px"');
22 shouldBe('cellPaddingAttributeEffect("0")', '"0px"');
24 shouldBe('cellPaddingAttributeEffect("-1")', '"0px"');
26 shouldBe('cellPaddingAttributeEffect("1x")', '"1px"');
27 shouldBe('cellPaddingAttributeEffect("1.")', '"1px"');
28 shouldBe('cellPaddingAttributeEffect("1.9")', '"1px"');
29 shouldBe('cellPaddingAttributeEffect("2x")', '"2px"');
30 shouldBe('cellPaddingAttributeEffect("2.")', '"2px"');
31 shouldBe('cellPaddingAttributeEffect("2.9")', '"2px"');
33 shouldBe('cellPaddingAttributeEffect("a")', '"0px"');
35 var arabicIndicDigitOne = String.fromCharCode(0x661);
36 shouldBe('cellPaddingAttributeEffect(arabicIndicDigitOne)', '"0px"');
37 shouldBe('cellPaddingAttributeEffect("2" + arabicIndicDigitOne)', '"2px"');