OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .transform { | 5 .transform { |
6 width: 100px; | 6 width: 100px; |
7 height: 30px; | 7 height: 30px; |
8 -webkit-transform: translateZ(0); | 8 -webkit-transform: translateZ(0); |
9 } | 9 } |
10 .fixed { | 10 .fixed { |
11 position: fixed; | 11 position: fixed; |
12 left: 10px; | 12 left: 10px; |
13 top: 10px; | 13 top: 10px; |
14 } | 14 } |
15 </style> | 15 </style> |
16 | 16 |
17 <script type="text/javascript"> | 17 <script type="text/javascript"> |
18 if (window.internals) { | 18 if (window.internals) |
19 window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled
(true); | 19 window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled
(true); |
20 window.internals.settings.setFixedPositionCreatesStackingContext(true); | |
21 } | |
22 | 20 |
23 if (window.testRunner) { | 21 if (window.testRunner) { |
24 testRunner.dumpAsText(); | 22 testRunner.dumpAsText(); |
25 | 23 |
26 window.addEventListener("load", function() { | 24 window.addEventListener("load", function() { |
27 document.getElementById("layerTree").innerText = window.internals.layerT
reeAsText(document); | 25 document.getElementById("layerTree").innerText = window.internals.layerT
reeAsText(document); |
28 document.getElementById("mainThreadScrollingReasons").innerText = window
.internals.mainThreadScrollingReasons(document); | 26 document.getElementById("mainThreadScrollingReasons").innerText = window
.internals.mainThreadScrollingReasons(document); |
29 }, false); | 27 }, false); |
30 } | 28 } |
31 </script> | 29 </script> |
32 </head> | 30 </head> |
33 | 31 |
34 <body> | 32 <body> |
35 <div class="transform"> | 33 <div class="transform"> |
36 <!-- This element should neither be composited nor force main thread scrolli
ng. --> | 34 <!-- This element should neither be composited nor force main thread scrolli
ng. --> |
37 <div class="fixed">TEST</div> | 35 <div class="fixed">TEST</div> |
38 </div> | 36 </div> |
39 | 37 |
40 <pre id="layerTree"></pre> | 38 <pre id="layerTree"></pre> |
41 <pre id="mainThreadScrollingReasons"></pre> | 39 <pre id="mainThreadScrollingReasons"></pre> |
42 </body> | 40 </body> |
43 </html> | 41 </html> |
OLD | NEW |