OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .outer { | 5 .outer { |
6 width: 500px; | 6 width: 500px; |
7 height: 300px; | 7 height: 300px; |
8 border: 1px solid black; | 8 border: 1px solid black; |
9 } | 9 } |
10 | 10 |
11 #abs_container { | |
12 position: relative; | |
13 } | |
14 | |
15 .testbox { | 11 .testbox { |
16 color: white; | 12 color: white; |
17 font: 24px 'Lucida Grande'; | 13 font: 24px 'Lucida Grande'; |
18 background: green; | 14 background: green; |
19 border: 1em solid black; | 15 border: 1em solid black; |
20 } | 16 } |
21 | 17 |
22 #fixed { | 18 #fixed { |
23 line-height: 30px; | 19 line-height: 30px; |
24 width: 150px; | 20 width: 150px; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 width: 30%; | 61 width: 30%; |
66 height: 20%; | 62 height: 20%; |
67 margin-top: 3em; | 63 margin-top: 3em; |
68 /* margin-right/margin-bottom omitted */ | 64 /* margin-right/margin-bottom omitted */ |
69 margin-left: auto; | 65 margin-left: auto; |
70 padding-top: 40px; | 66 padding-top: 40px; |
71 padding-right: 10%; | 67 padding-right: 10%; |
72 padding-bottom: 1em; | 68 padding-bottom: 1em; |
73 padding-left: auto; | 69 padding-left: auto; |
74 } | 70 } |
75 | |
76 #rel_positioned { | |
77 position: relative; | |
78 line-height: 30px; | |
79 width: 150px; | |
80 height: 100px; | |
81 left: 10px; | |
82 top: 15px; | |
83 margin-top: 15px; | |
84 margin-right: 30px; | |
85 margin-bottom: 20px; | |
86 margin-left: 10px; | |
87 padding: 20px; | |
88 } | |
89 | |
90 #abs_positioned { | |
91 position: absolute; | |
92 line-height: 30px; | |
93 width: 150px; | |
94 height: 100px; | |
95 right: 10px; | |
96 bottom: 15px; | |
97 margin-top: 15px; | |
98 margin-right: 30px; | |
99 margin-bottom: 20px; | |
100 margin-left: 10px; | |
101 padding: 20px; | |
102 } | |
103 | |
104 </style> | 71 </style> |
105 | 72 |
106 <script> | 73 <script> |
107 var resolvedValueStyles = [ | 74 var resolvedValueStyles = [ |
108 'line-height', | 75 'line-height', |
109 'width', | 76 'width', |
110 'height', | 77 'height', |
111 'top', | |
112 'right', | |
113 'bottom', | |
114 'left', | |
115 'margin-top', | 78 'margin-top', |
116 'margin-right', | 79 'margin-right', |
117 'margin-bottom', | 80 'margin-bottom', |
118 'margin-left', | 81 'margin-left', |
119 'padding-top', | 82 'padding-top', |
120 'padding-right', | 83 'padding-right', |
121 'padding-bottom', | 84 'padding-bottom', |
122 'padding-left' | 85 'padding-left' |
123 ]; | 86 ]; |
124 | 87 |
(...skipping 29 matching lines...) Expand all Loading... |
154 | 117 |
155 function runTests() { | 118 function runTests() { |
156 if (window.testRunner) | 119 if (window.testRunner) |
157 testRunner.dumpAsText(); | 120 testRunner.dumpAsText(); |
158 | 121 |
159 test('fixed'); | 122 test('fixed'); |
160 test('percents'); | 123 test('percents'); |
161 test('ems'); | 124 test('ems'); |
162 test('auto'); | 125 test('auto'); |
163 test('mixed'); | 126 test('mixed'); |
164 test('rel_positioned'); | |
165 test('abs_positioned'); | |
166 } | 127 } |
167 </script> | 128 </script> |
168 </head> | 129 </head> |
169 | 130 |
170 <body onload="runTests();"> | 131 <body onload="runTests();"> |
171 <p> | 132 <p> |
172 Test calling getPropertyValue on computed styles that return "resolved"
values.<br /> | 133 Test calling getPropertyValue on computed styles that return "resolved"
values.<br /> |
173 See <a href="http://dev.w3.org/csswg/cssom/#resolved-values">http://dev.
w3.org/csswg/cssom/#resolved-values</a> for more information. | 134 See <a href="http://dev.w3.org/csswg/cssom/#resolved-values">http://dev.
w3.org/csswg/cssom/#resolved-values</a> for more information. |
174 </p> | 135 </p> |
175 <pre id="console"></pre> | 136 <pre id="console"></pre> |
176 | 137 |
177 <div class="outer"> | 138 <div class="outer"> |
178 <div class="testbox" id="fixed">Fixed</div> | 139 <div class="testbox" id="fixed">Fixed</div> |
179 </div> | 140 </div> |
180 <div class="outer"> | 141 <div class="outer"> |
181 <div class="testbox" id="percents">Percents</div> | 142 <div class="testbox" id="percents">Percents</div> |
182 </div> | 143 </div> |
183 <div class="outer"> | 144 <div class="outer"> |
184 <div class="testbox" id="ems">EMs</div> | 145 <div class="testbox" id="ems">EMs</div> |
185 </div> | 146 </div> |
186 <div class="outer"> | 147 <div class="outer"> |
187 <div class="testbox" id="auto">Auto</div> | 148 <div class="testbox" id="auto">Auto</div> |
188 </div> | 149 </div> |
189 <div class="outer"> | 150 <div class="outer"> |
190 <div class="testbox" id="mixed">Mixed</div> | 151 <div class="testbox" id="mixed">Mixed</div> |
191 </div> | 152 </div> |
192 <div class="outer"> | |
193 <div class="testbox" id="rel_positioned">Relative Positioned</div> | |
194 </div> | |
195 <div class="outer" id="abs_container"> | |
196 <div class="testbox" id="abs_positioned">Absolute Positioned</div> | |
197 </div> | |
198 </body> | 153 </body> |
199 </html> | 154 </html> |
OLD | NEW |