OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 #backgroundPositionZeroSingle { background-position: 0; } | 5 #backgroundPositionZeroSingle { background-position: 0; } |
6 #backgroundPositionZeroPair { background-position: 0 0; } | 6 #backgroundPositionZeroPair { background-position: 0 0; } |
7 #backgroundPositionSingle { background-position: 15px; } | 7 #backgroundPositionSingle { background-position: 15px; } |
8 #backgroundPositionPair { background-position: 10px 20px; } | 8 #backgroundPositionPair { background-position: 10px 20px; } |
9 </style> | 9 </style> |
10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
11 function log(msg) | 11 function log(msg) |
12 { | 12 { |
13 document.getElementById('console').appendChild(document.createTextNo
de(msg + '\n')); | 13 document.getElementById('console').appendChild(document.createTextNo
de(msg + '\n')); |
14 } | 14 } |
15 | 15 |
16 function subTest(ob, prop) | 16 function subTest(ob, prop) |
17 { | 17 { |
18 log(' ' + prop); | 18 log(' ' + prop); |
19 log(' getPropertyValue: ' + document.defaultView.getComputedSt
yle(ob, null).getPropertyValue(prop)); | 19 log(' getPropertyValue: ' + document.defaultView.getComputedSt
yle(ob, null).getPropertyValue(prop)); |
20 log(' getPropertyCSSValue: ' + document.defaultView.getComputedSt
yle(ob, null).getPropertyCSSValue(prop)); | |
21 } | 20 } |
22 | 21 |
23 function test(id, single, pair) | 22 function test(id, single, pair) |
24 { | 23 { |
25 log('background-position: ' + single + ';'); | 24 log('background-position: ' + single + ';'); |
26 var ob = document.getElementById(id + 'Single'); | 25 var ob = document.getElementById(id + 'Single'); |
27 subTest(ob, 'background-position'); | 26 subTest(ob, 'background-position'); |
28 subTest(ob, 'background-position-x'); | 27 subTest(ob, 'background-position-x'); |
29 subTest(ob, 'background-position-y'); | 28 subTest(ob, 'background-position-y'); |
30 | 29 |
(...skipping 30 matching lines...) Expand all Loading... |
61 <pre id="console"></pre> | 60 <pre id="console"></pre> |
62 | 61 |
63 <div id="backgroundPositionZeroSingle"></div> | 62 <div id="backgroundPositionZeroSingle"></div> |
64 <div id="backgroundPositionZeroPair"></div> | 63 <div id="backgroundPositionZeroPair"></div> |
65 <div id="backgroundPositionSingle"></div> | 64 <div id="backgroundPositionSingle"></div> |
66 <div id="backgroundPositionPair"></div> | 65 <div id="backgroundPositionPair"></div> |
67 | 66 |
68 <div id="testBackgroundPositionInit"></div> | 67 <div id="testBackgroundPositionInit"></div> |
69 </body> | 68 </body> |
70 </html> | 69 </html> |
OLD | NEW |