OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <script> | |
8 description("HTMLTableElement cellpadding attribute test"); | |
9 | |
10 function cellPaddingAttributeEffect(value) | |
11 { | |
12 var table = document.createElement("table"); | |
13 table.setAttribute("cellpadding", value); | |
14 var cell = document.createElement("td"); | |
15 table.appendChild(cell); | |
16 document.body.appendChild(table); | |
17 var computedStyle = getComputedStyle(cell, ""); | |
18 var result = computedStyle.paddingTop; | |
19 document.body.removeChild(table); | |
20 return result; | |
21 } | |
22 | |
23 shouldBe('cellPaddingAttributeEffect("")', '"1px"'); | |
24 | |
25 shouldBe('cellPaddingAttributeEffect("1")', '"1px"'); | |
26 shouldBe('cellPaddingAttributeEffect("2")', '"2px"'); | |
27 shouldBe('cellPaddingAttributeEffect("10")', '"10px"'); | |
28 | |
29 shouldBe('cellPaddingAttributeEffect("0")', '"0px"'); | |
30 | |
31 shouldBe('cellPaddingAttributeEffect("-1")', '"0px"'); | |
32 | |
33 shouldBe('cellPaddingAttributeEffect("1x")', '"1px"'); | |
34 shouldBe('cellPaddingAttributeEffect("1.")', '"1px"'); | |
35 shouldBe('cellPaddingAttributeEffect("1.9")', '"1px"'); | |
36 shouldBe('cellPaddingAttributeEffect("2x")', '"2px"'); | |
37 shouldBe('cellPaddingAttributeEffect("2.")', '"2px"'); | |
38 shouldBe('cellPaddingAttributeEffect("2.9")', '"2px"'); | |
39 | |
40 shouldBe('cellPaddingAttributeEffect("a")', '"0px"'); | |
41 | |
42 var arabicIndicDigitOne = String.fromCharCode(0x661); | |
43 shouldBe('cellPaddingAttributeEffect(arabicIndicDigitOne)', '"0px"'); | |
44 shouldBe('cellPaddingAttributeEffect("2" + arabicIndicDigitOne)', '"2px"'); | |
45 </script> | |
46 </body> | |
47 </html> | |
OLD | NEW |