OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <style> | 5 <style> |
6 .fixed { | 6 .fixed { |
7 position: fixed; | 7 position: fixed; |
8 width: 10px; | 8 width: 10px; |
9 height: 10px; | 9 height: 10px; |
10 top: -100px; | 10 top: -100px; |
11 background-color: silver; | 11 background-color: silver; |
12 } | 12 } |
13 </style> | 13 </style> |
14 | 14 |
15 <script type="text/javascript"> | 15 <script type="text/javascript"> |
16 if (window.testRunner && window.internals) { | 16 if (window.testRunner && window.internals) { |
17 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
18 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true); | 18 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true); |
19 internals.settings.setFixedPositionCreatesStackingContext(true); | |
20 | 19 |
21 addEventListener("load", function() { | 20 addEventListener("load", function() { |
22 var fixed = document.createElement("div"); | 21 var fixed = document.createElement("div"); |
23 document.body.appendChild(fixed); | 22 document.body.appendChild(fixed); |
24 document.body.offsetHeight; | 23 document.body.offsetHeight; |
25 fixed.className = "fixed"; | 24 fixed.className = "fixed"; |
26 var mainThreadScrollingReasons = internals.mainThreadScrollingReasons(do
cument); | 25 var mainThreadScrollingReasons = internals.mainThreadScrollingReasons(do
cument); |
27 document.getElementById("result").innerText = !mainThreadScrollingReason
s ? "PASS" : "FAIL: " + mainThreadScrollingReasons; | 26 document.getElementById("result").innerText = !mainThreadScrollingReason
s ? "PASS" : "FAIL: " + mainThreadScrollingReasons; |
28 testRunner.notifyDone(); | 27 testRunner.notifyDone(); |
29 }, false); | 28 }, false); |
30 } | 29 } |
31 </script> | 30 </script> |
32 </head> | 31 </head> |
33 | 32 |
34 <!-- Fixed position elements may skip compositing without a scrollable | 33 <!-- Fixed position elements may skip compositing without a scrollable |
35 ancestor. To make sure this test covers the intended scenario, we force the | 34 ancestor. To make sure this test covers the intended scenario, we force the |
36 body element to be tall, so that the FrameView is scrolling. --> | 35 body element to be tall, so that the FrameView is scrolling. --> |
37 <body style="height: 4000px;"> | 36 <body style="height: 4000px;"> |
38 <pre id="result"></pre> | 37 <pre id="result"></pre> |
39 </body> | 38 </body> |
40 </html> | 39 </html> |
41 | 40 |
OLD | NEW |