1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
6 #test1 { padding:
10px; display: none; }
11 <div id=
"tests_container">
13 <div id=
"test0" style=
"display: none"></div>
14 <div id=
"test1"></div>
15 <div id=
"test2" style=
"padding: 10px; display: none;"></div>
16 <table id=
"test_table" cellpadding=
"10">
18 <td id=
"test3" style=
"display: none">FOO
</td>
19 <td id=
"test4">BAR
</td>
23 <div style=
"position: relative; width: 100px; height: 100px">
24 <div id=
"test5" style=
"padding: 10%; width: 50px; height: 50px">BAR
</div>
27 <div style=
"position: relative; width: 100px; height: 100px">
28 <div id=
"test6" style=
"display: none; padding: 10%; width: 50px; height: 50px">BAR
</div>
31 <div style=
"display: none; position: relative; width: 100px; height: 100px">
32 <div id=
"test7" style=
"padding: 10%; width: 50px; height: 50px">BAR
</div>
38 var test0
= document
.getElementById("test0");
39 var test1
= document
.getElementById("test1");
40 var test2
= document
.getElementById("test2");
41 var test3
= document
.getElementById("test3");
42 var test4
= document
.getElementById("test4");
43 var test5
= document
.getElementById("test5");
44 var test6
= document
.getElementById("test6");
45 var test7
= document
.getElementById("test7");
47 shouldBeEqualToString("window.getComputedStyle(test0, null).paddingTop", "0px");
48 shouldBeEqualToString("window.getComputedStyle(test1, null).paddingTop", "10px");
49 shouldBeEqualToString("window.getComputedStyle(test2, null).paddingTop", "10px");
50 shouldBeEqualToString("window.getComputedStyle(test3, null).paddingTop", "10px");
51 shouldBeEqualToString("window.getComputedStyle(test4, null).paddingTop", "10px");
52 shouldBeEqualToString("window.getComputedStyle(test5, null).paddingTop", "10px");
53 shouldBeEqualToString("window.getComputedStyle(test6, null).paddingTop", "10%");
54 shouldBeEqualToString("window.getComputedStyle(test7, null).paddingTop", "10%");
56 // clean up after ourselves
57 var tests_container
= document
.getElementById("tests_container");
58 tests_container
.parentNode
.removeChild(tests_container
);