| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 This test verifies that a fixed position element inside an iframe paints when | 3 This test verifies that a fixed position element inside an iframe paints when |
| 4 it comes into view due to the iframe increasing in size. | 4 it comes into view due to the iframe increasing in size. |
| 5 | 5 |
| 6 If this test passes, you should see a green square. | 6 If this test passes, you should see a green square. |
| 7 --> | 7 --> |
| 8 <html> | 8 <html> |
| 9 <head> | 9 <head> |
| 10 <style> | 10 <style> |
| 11 #iframe-containing-fixed-position-element { | 11 #iframe-containing-fixed-position-element { |
| 12 background: red; | 12 background: red; |
| 13 width: 100px; | 13 width: 100px; |
| 14 height: 0; | 14 height: 0; |
| 15 border: 0; | 15 border: 0; |
| 16 } | 16 } |
| 17 </style> | 17 </style> |
| 18 <script src="../../resources/run-after-display.js"></script> |
| 18 <script> | 19 <script> |
| 19 if (window.testRunner) | 20 if (window.testRunner) |
| 20 testRunner.waitUntilDone(); | 21 testRunner.waitUntilDone(); |
| 21 | 22 |
| 22 if (window.internals) { | 23 if (window.internals) { |
| 23 window.internals.settings.setAcceleratedCompositingForFixedPositionE
nabled(true); | 24 window.internals.settings.setAcceleratedCompositingForFixedPositionE
nabled(true); |
| 24 window.internals.settings.setFixedPositionCreatesStackingContext(tru
e); | 25 window.internals.settings.setFixedPositionCreatesStackingContext(tru
e); |
| 25 } | 26 } |
| 26 | 27 |
| 27 function runTest() | 28 function runTest() |
| 28 { | 29 { |
| 29 // Initially, the fixed position element in the iframe will not | 30 // Initially, the fixed position element in the iframe will not |
| 30 // paint because the iframe has zero height. | 31 // paint because the iframe has zero height. |
| 31 if (window.testRunner) | 32 runAfterDisplay(function() { |
| 32 testRunner.display(); | 33 // Give the iframe a non-zero height. The fixed position element |
| 34 // inside the iframe should paint now. |
| 35 var iframeElement = document.getElementById("iframe-containing-f
ixed-position-element"); |
| 36 iframeElement.style.height = "100px"; |
| 33 | 37 |
| 34 // Give the iframe a non-zero height. The fixed position element | 38 if (window.testRunner) |
| 35 // inside the iframe should paint now. | 39 testRunner.notifyDone(); |
| 36 var iframeElement = document.getElementById("iframe-containing-fixed
-position-element"); | 40 }); |
| 37 iframeElement.style.height = "100px"; | |
| 38 | |
| 39 if (window.testRunner) { | |
| 40 testRunner.display(); | |
| 41 testRunner.notifyDone(); | |
| 42 } | |
| 43 } | 41 } |
| 44 </script> | 42 </script> |
| 45 </head> | 43 </head> |
| 46 <body onload="runTest()"> | 44 <body onload="runTest()"> |
| 47 <iframe id="iframe-containing-fixed-position-element" src="resources/subfram
e-with-fixed-position-element.html"></iframe> | 45 <iframe id="iframe-containing-fixed-position-element" src="resources/subfram
e-with-fixed-position-element.html"></iframe> |
| 48 </body> | 46 </body> |
| 49 </html> | 47 </html> |
| OLD | NEW |