OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 #container { |
| 6 will-change: contents; |
| 7 position: absolute; |
| 8 z-index: 0; |
| 9 left: 200px; |
| 10 top: 100px; |
| 11 width: 100px; |
| 12 height: 100px; |
| 13 background-color: blue; |
| 14 } |
| 15 |
| 16 #willChangeOpacity { |
| 17 position: absolute; |
| 18 left: 50px; |
| 19 top: 50px; |
| 20 width: 75px; |
| 21 height: 75px; |
| 22 background-color: green; |
| 23 will-change: opacity; |
| 24 } |
| 25 </style> |
| 26 <script type="text/javascript"> |
| 27 if (window.internals) { |
| 28 window.internals.settings.setAcceleratedCompositingForGpuRasterizationHint
Enabled(true); |
| 29 // Force an update of the compositing triggers. |
| 30 window.internals.layerTreeAsText(document); |
| 31 } |
| 32 |
| 33 if (window.testRunner) { |
| 34 testRunner.dumpAsText(); |
| 35 testRunner.waitUntilDone(); |
| 36 } |
| 37 |
| 38 function doTest() |
| 39 { |
| 40 if (window.internals) { |
| 41 window.internals.forceCompositingUpdate(document); |
| 42 } |
| 43 // Removing "will-change: contents" from the container div should |
| 44 // allow its child to composite. |
| 45 document.getElementById("container").style.willChange = "top"; |
| 46 if (window.testRunner) { |
| 47 document.getElementById("layertree").innerText = window.internals.layerT
reeAsText(document); |
| 48 testRunner.notifyDone(); |
| 49 } |
| 50 } |
| 51 |
| 52 window.addEventListener('load', doTest, false); |
| 53 </script> |
| 54 </head> |
| 55 |
| 56 <body> |
| 57 <div id="container"> |
| 58 <div id="willChangeOpacity"></div> |
| 59 </div> |
| 60 |
| 61 <pre id="layertree"></pre> |
| 62 </body> |
| 63 |
| 64 </html> |
OLD | NEW |