Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / getComputedStyle / getComputedStyle-background-position.html
blobad16e5f02cd14d0bbf10581fa343ddfd31439c5f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 #backgroundPositionZeroSingle { background-position: 0; }
6 #backgroundPositionZeroPair { background-position: 0 0; }
7 #backgroundPositionSingle { background-position: 15px; }
8 #backgroundPositionPair { background-position: 10px 20px; }
9 </style>
10 <script type="text/javascript">
11 function log(msg)
13 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
16 function subTest(ob, prop)
18 log(' ' + prop);
19 log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
22 function test(id, single, pair)
24 log('background-position: ' + single + ';');
25 var ob = document.getElementById(id + 'Single');
26 subTest(ob, 'background-position');
27 subTest(ob, 'background-position-x');
28 subTest(ob, 'background-position-y');
30 log('background-position: ' + pair + ';');
31 ob = document.getElementById(id + 'Pair');
32 subTest(ob, 'background-position');
33 subTest(ob, 'background-position-x');
34 subTest(ob, 'background-position-y');
37 function runTests()
39 if (window.testRunner)
40 testRunner.dumpAsText();
42 test('backgroundPositionZero', '0', '0 0');
44 log('');
46 test('backgroundPosition', '15px', '10px 20px');
48 log('');
50 log('No background-position set');
51 var ob = document.getElementById('testBackgroundPositionInit');
52 subTest(ob, 'background-position');
53 subTest(ob, 'background-position-x');
54 subTest(ob, 'background-position-y');
56 </script>
57 </head>
58 <body onload="runTests();">
59 <p>Test calling getPropertyValue on computed styles for background-position properties.</p>
60 <pre id="console"></pre>
62 <div id="backgroundPositionZeroSingle"></div>
63 <div id="backgroundPositionZeroPair"></div>
64 <div id="backgroundPositionSingle"></div>
65 <div id="backgroundPositionPair"></div>
67 <div id="testBackgroundPositionInit"></div>
68 </body>
69 </html>