tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / dom / HTMLTableElement / script-tests / cellpadding-attribute.js
1 description("HTMLTableElement cellpadding attribute test");
2
3 function cellPaddingAttributeEffect(value)
4 {
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);
13     return result;
14 }
15
16 shouldBe('cellPaddingAttributeEffect("")', '"1px"');
17
18 shouldBe('cellPaddingAttributeEffect("1")', '"1px"');
19 shouldBe('cellPaddingAttributeEffect("2")', '"2px"');
20 shouldBe('cellPaddingAttributeEffect("10")', '"10px"');
21
22 shouldBe('cellPaddingAttributeEffect("0")', '"0px"');
23
24 shouldBe('cellPaddingAttributeEffect("-1")', '"0px"');
25
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"');
32
33 shouldBe('cellPaddingAttributeEffect("a")', '"0px"');
34
35 var arabicIndicDigitOne = String.fromCharCode(0x661);
36 shouldBe('cellPaddingAttributeEffect(arabicIndicDigitOne)', '"0px"');
37 shouldBe('cellPaddingAttributeEffect("2" + arabicIndicDigitOne)', '"2px"');