jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- Tests that overflow controls are repainted after compositing is disabled. There should be three green squares and no visible overflow controls --> |
| 3 | <style> |
| 4 | .composited { |
| 5 | -webkit-transform:translateZ(0); |
| 6 | } |
| 7 | |
| 8 | .container { |
| 9 | width: 100px; |
| 10 | height:100px; |
| 11 | position:absolute; |
| 12 | background-color: green; |
| 13 | overflow:auto; |
| 14 | border: 0px; |
| 15 | } |
| 16 | |
| 17 | </style> |
| 18 | <body onload="test()"> |
| 19 | <iframe id="vertical" class="composited container" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe> |
| 20 | <iframe id="horizontal" class="composited container" style="left: 150px" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe> |
| 21 | <iframe id="both" class="composited container" style="left: 300px" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe> |
| 22 | </body> |
| 23 | <script> |
| 24 | function finishTest() { |
| 25 | document.getElementById("vertical").contentDocument.body.classList.remove("tall"); // topmost iframe loses a vertical scrollbar |
| 26 | document.getElementById("horizontal").contentDocument.body.classList.remove("wide"); // middle iframe loses a horizontal scrollbar |
| 27 | document.getElementById("both").contentDocument.body.classList.remove("wide"); // bottom iframe loses both |
| 28 | document.getElementById("both").contentDocument.body.classList.remove("tall"); // bottom iframe loses both |
| 29 | } |
| 30 | |
| 31 | function test() { |
| 32 | document.getElementById("vertical").contentDocument.body.classList.add("tall"); // topmost iframe starts with a vertical scrollbar |
| 33 | document.getElementById("horizontal").contentDocument.body.classList.add("wide"); // middle iframe starts with a horizontal scrollbar |
| 34 | document.getElementById("both").contentDocument.body.classList.add("wide"); // bottom iframe starts with both |
| 35 | document.getElementById("both").contentDocument.body.classList.add("tall"); // vertical and horizontal scrollbars |
| 36 | if (window.layoutTestController) { |
| 37 | layoutTestController.dumpAsText(true); |
| 38 | layoutTestController.display(); // Paint once with all overflow controls visible. |
| 39 | finishTest(); |
| 40 | } else |
| 41 | window.setTimeout(finishTest, 5000); |
| 42 | } |
| 43 | </script> |