| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <style> | |
| 5 .shouldCompositeAndHaveGpuHint { | |
| 6 position: absolute; | |
| 7 width: 50px; | |
| 8 height: 50px; | |
| 9 background-color: green; | |
| 10 } | |
| 11 | |
| 12 .shouldCompositeButNotHaveGpuHint { | |
| 13 position: absolute; | |
| 14 width: 50px; | |
| 15 height: 50px; | |
| 16 background-color: blue; | |
| 17 } | |
| 18 | |
| 19 .shouldNotComposite { | |
| 20 position: absolute; | |
| 21 width: 50px; | |
| 22 height: 50px; | |
| 23 background-color: red; | |
| 24 } | |
| 25 | |
| 26 #willChangeAuto { | |
| 27 will-change: auto; | |
| 28 top: 0px; | |
| 29 left: 0px; | |
| 30 } | |
| 31 | |
| 32 #willChangeZIndex { | |
| 33 will-change: z-index; | |
| 34 top: 0px; | |
| 35 left: 60px; | |
| 36 } | |
| 37 | |
| 38 #willChangeOpacity { | |
| 39 will-change: opacity; | |
| 40 top: 0px; | |
| 41 left: 120px; | |
| 42 } | |
| 43 | |
| 44 #willChangeContents { | |
| 45 will-change: contents; | |
| 46 top: 60px; | |
| 47 left: 0px; | |
| 48 } | |
| 49 | |
| 50 #willChangeWidth { | |
| 51 will-change: width; | |
| 52 top: 60px; | |
| 53 left: 60px; | |
| 54 } | |
| 55 | |
| 56 #willChangeHeight { | |
| 57 will-change: height; | |
| 58 top: 60px; | |
| 59 left: 120px; | |
| 60 } | |
| 61 | |
| 62 #willChangeBackgroundColor { | |
| 63 will-change: background-color; | |
| 64 top: 120px; | |
| 65 left: 0px; | |
| 66 } | |
| 67 | |
| 68 #willChangeBackgroundPosition { | |
| 69 will-change: background-position; | |
| 70 top: 120px; | |
| 71 left: 60px; | |
| 72 } | |
| 73 | |
| 74 #willChangeCombination { | |
| 75 will-change: z-index, width, position; | |
| 76 top: 120px; | |
| 77 left: 120px; | |
| 78 } | |
| 79 </style> | |
| 80 | |
| 81 <script> | |
| 82 if (window.internals) { | |
| 83 window.internals.settings.setAcceleratedCompositingForGpuRasterizationHint
Enabled(true); | |
| 84 // Force an update of the compositing triggers. | |
| 85 window.internals.layerTreeAsText(document); | |
| 86 } | |
| 87 | |
| 88 if (window.testRunner) { | |
| 89 testRunner.dumpAsText(); | |
| 90 testRunner.waitUntilDone(); | |
| 91 } | |
| 92 | |
| 93 window.addEventListener('load', function() { | |
| 94 if (window.testRunner) { | |
| 95 document.getElementById("layertree").innerText = window.internals.layerT
reeAsText(document); | |
| 96 testRunner.notifyDone(); | |
| 97 } | |
| 98 }, false); | |
| 99 </script> | |
| 100 </head> | |
| 101 <body> | |
| 102 <div id="willChangeAuto" class="shouldNotComposite"></div> | |
| 103 <div id="willChangeZIndex" class="shouldNotComposite"></div> | |
| 104 <div id="willChangeOpacity" class="shouldCompositeButNotHaveGpuHint"></div> | |
| 105 <div id="willChangeContents" class="shouldCompositeAndHaveGpuHint"></div> | |
| 106 <div id="willChangeWidth" class="shouldCompositeAndHaveGpuHint"></div> | |
| 107 <div id="willChangeHeight" class="shouldCompositeAndHaveGpuHint"></div> | |
| 108 <div id="willChangeBackgroundColor" class="shouldCompositeAndHaveGpuHint"></di
v> | |
| 109 <div id="willChangeBackgroundPosition" class="shouldCompositeAndHaveGpuHint"><
/div> | |
| 110 <div id="willChangeCombination" class="shouldCompositeAndHaveGpuHint"></div> | |
| 111 | |
| 112 <pre id="layertree"></pre> | |
| 113 </body> | |
| 114 </html> | |
| OLD | NEW |