OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 #container { |
| 6 will-change: contents; |
| 7 z-index: 0; |
| 8 position: absolute; |
| 9 top: 0px; |
| 10 left: 0px; |
| 11 } |
| 12 |
| 13 .shouldNotComposite { |
| 14 position: absolute; |
| 15 width: 50px; |
| 16 height: 50px; |
| 17 background-color: blue; |
| 18 } |
| 19 |
| 20 #willChangeOpacity { |
| 21 will-change: opacity; |
| 22 top: 0px; |
| 23 left: 0px; |
| 24 } |
| 25 |
| 26 #willChangeContents { |
| 27 will-change: contents; |
| 28 top: 0px; |
| 29 left: 60px; |
| 30 } |
| 31 |
| 32 #willChangeTop { |
| 33 will-change: top; |
| 34 top: 0px; |
| 35 left: 120px; |
| 36 } |
| 37 |
| 38 #willChangeTransform { |
| 39 will-change: -webkit-transform; |
| 40 top: 60px; |
| 41 left: 0px; |
| 42 } |
| 43 |
| 44 #animateOpacity { |
| 45 |
| 46 top: 60px; |
| 47 left: 60px; |
| 48 -webkit-animation: fade-in-out 0.1s linear infinite alternate; |
| 49 } |
| 50 |
| 51 @-webkit-keyframes fade-in-out { from { opacity: 0.3; } to { opacity: 0.9; }
} |
| 52 |
| 53 </style> |
| 54 |
| 55 <script> |
| 56 if (window.internals) { |
| 57 window.internals.settings.setAcceleratedCompositingForGpuRasterizationHint
Enabled(true); |
| 58 window.internals.settings.setAcceleratedCompositingForAnimationEnabled(tru
e); |
| 59 // Force an update of the compositing triggers. |
| 60 window.internals.forceCompositingUpdate(document); |
| 61 } |
| 62 |
| 63 if (window.testRunner) { |
| 64 testRunner.dumpAsText(); |
| 65 testRunner.waitUntilDone(); |
| 66 } |
| 67 |
| 68 function animationEventListener() { |
| 69 if (window.testRunner) { |
| 70 document.getElementById("layertree").innerText = window.internals.layerT
reeAsText(document); |
| 71 testRunner.notifyDone(); |
| 72 } |
| 73 } |
| 74 |
| 75 window.addEventListener('load', function() { |
| 76 document.getElementById("animateOpacity").addEventListener('webkitAnimatio
nIteration', animationEventListener); |
| 77 }, false); |
| 78 </script> |
| 79 </head> |
| 80 <body> |
| 81 <div id="container"> |
| 82 <div id="willChangeOpacity" class="shouldNotComposite"> |
| 83 <div id="willChangeTransform" class="shouldNotComposite"></div> |
| 84 </div> |
| 85 <div id="willChangeContents" class="shouldNotComposite"></div> |
| 86 <div id="willChangeTop" class="shouldNotComposite"></div> |
| 87 <div id="animateOpacity" class="shouldNotComposite"></div> |
| 88 </div> |
| 89 |
| 90 <pre id="layertree"></pre> |
| 91 </body> |
| 92 </html> |
OLD | NEW |