| <!DOCTYPE html> |
| <!-- |
| This test verifies that a fixed position element inside an iframe paints when |
| it comes into view due to the iframe increasing in size. |
| |
| If this test passes, you should see a green square. |
| --> |
| <html> |
| <head> |
| <style> |
| #iframe-containing-fixed-position-element { |
| background: red; |
| width: 100px; |
| height: 0; |
| border: 0; |
| } |
| </style> |
| <script src="../../resources/run-after-layout-and-paint.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| |
| if (window.internals) |
| window.internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| |
| function runTest() |
| { |
| // Initially, the fixed position element in the iframe will not |
| // paint because the iframe has zero height. |
| runAfterLayoutAndPaint(function() { |
| // Give the iframe a non-zero height. The fixed position element |
| // inside the iframe should paint now. |
| var iframeElement = document.getElementById("iframe-containing-fixed-position-element"); |
| iframeElement.style.height = "100px"; |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <iframe id="iframe-containing-fixed-position-element" src="resources/subframe-with-fixed-position-element.html"></iframe> |
| </body> |
| </html> |