blob: fb30d8ceb58ad8eafae621096929663705f95a0b [file] [log] [blame]
hyatt@apple.comcd9e4092008-01-18 21:56:31 +00001<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
mark.lam@apple.com104d9932013-09-07 22:20:15 +00004<script src="../../resources/js-test-pre.js"></script>
hyatt@apple.comcd9e4092008-01-18 21:56:31 +00005<style>
6 #test1 { padding: 10px; display: none; }
7</style>
8</head>
9<body>
hyatt@apple.comcd9e4092008-01-18 21:56:31 +000010
11<div id="tests_container">
12
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">
17 <tr>
18 <td id="test3" style="display: none">FOO</td>
19 <td id="test4">BAR</td>
20 <tr>
21</table>
22
23<div style="position: relative; width: 100px; height: 100px">
24 <div id="test5" style="padding: 10%; width: 50px; height: 50px">BAR</div>
25</div>
26
27<div style="position: relative; width: 100px; height: 100px">
28 <div id="test6" style="display: none; padding: 10%; width: 50px; height: 50px">BAR</div>
29</div>
30
31<div style="display: none; position: relative; width: 100px; height: 100px">
32 <div id="test7" style="padding: 10%; width: 50px; height: 50px">BAR</div>
33</div>
34
35</div>
36
37<script>
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");
46
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%");
55
56 // clean up after ourselves
57 var tests_container = document.getElementById("tests_container");
58 tests_container.parentNode.removeChild(tests_container);
hyatt@apple.comcd9e4092008-01-18 21:56:31 +000059</script>
mark.lam@apple.com104d9932013-09-07 22:20:15 +000060<script src="../../resources/js-test-post.js"></script>
hyatt@apple.comcd9e4092008-01-18 21:56:31 +000061</body>
62</html>