OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <style> | |
5 #container { | |
6 will-change: top; | |
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. | |
Ian Vollick
2014/04/14 17:02:45
This is hacky. If forceCompositingUpdate doesn't w
ajuma
2014/04/14 18:09:34
Switched this to forceCompositingUpdate. See also
| |
30 window.internals.layerTreeAsText(document); | |
31 } | |
32 | |
33 if (window.testRunner) { | |
34 testRunner.dumpAsText(); | |
35 testRunner.waitUntilDone(); | |
Ian Vollick
2014/04/14 17:02:45
No need for wait until done (or notify done), I do
ajuma
2014/04/14 18:09:34
Done.
| |
36 } | |
37 | |
38 function doTest() | |
39 { | |
40 if (window.internals) { | |
41 window.internals.forceCompositingUpdate(document); | |
42 } | |
43 // Adding "will-change: contents" to the container div should | |
44 // stop its child from compositing. | |
45 document.getElementById("container").style.willChange = "contents"; | |
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 |