Move /platform/ios-simulator/accessibility tests to accessibility/ios-simulator/
[WebKit-https.git] / LayoutTests / tiled-drawing / background-transparency-toggle.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5     <style>
6         body {
7             background-color: white;
8         }
9         
10         body.transparent {
11             background-color: rgba(0, 0, 0, 0.2);
12         }
13     </style>
14     <script>
15         if (window.testRunner) {
16             testRunner.dumpAsText();
17             testRunner.waitUntilDone();
18         }
19
20         function documentLoaded()
21         {
22             window.setTimeout(doTest, 0);
23         }
24         
25         function appendLayerDump()
26         {
27             if (window.internals)
28                 document.getElementById('output').textContent += window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
29         }
30
31         function doTest()
32         {
33             if (window.internals)
34                 internals.setViewBaseBackgroundColor('transparent');
35             appendLayerDump();
36
37             document.body.classList.add('transparent');
38             appendLayerDump();
39
40             document.body.classList.remove('transparent');
41             appendLayerDump();
42
43             if (window.internals)
44                 internals.setViewBaseBackgroundColor('white');
45
46             document.body.classList.add('transparent');
47             appendLayerDump();
48
49             if (window.testRunner)
50                 testRunner.notifyDone();
51         }
52
53         window.addEventListener('load', documentLoaded, false);
54     </script>
55 </head>
56 <body>
57
58 <p>Page tiles should be transparent if the body's background has alpha.</p>
59 <div id="test"></div>
60 <pre id="output"></pre>
61
62 </body>
63 </html>