test_bug1253683.html (2255B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1253683 5 --> 6 <head> 7 <title>Test to ensure non-scrollable frames don't get layerized</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <script src="/tests/SimpleTest/paint_listener.js"></script> 11 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 12 <script type="application/javascript" src="apz_test_utils.js"></script> 13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 14 </head> 15 <body> 16 <p id="display"></p> 17 <div id="container" style="height: 500px; overflow:scroll"> 18 <pre id="no_layer" style="background-color: #f5f5f5; margin: 15px; padding: 15px; margin-top: 100px; border: 1px solid #eee; overflow:scroll">sample code here</pre> 19 <div style="height: 5000px">spacer to make the 'container' div the root scrollable element</div> 20 </div> 21 <pre id="test"> 22 <script type="application/javascript"> 23 24 async function test() { 25 var container = document.getElementById("container"); 26 var no_layer = document.getElementById("no_layer"); 27 28 // Check initial state 29 is(container.scrollTop, 0, "Initial scrollY should be 0"); 30 ok(!isLayerized("no_layer"), "initially 'no_layer' should not be layerized"); 31 32 // Scrolling over outer1 should layerize outer1, but not inner1. 33 await promiseMoveMouseAndScrollWheelOver(no_layer, 10, 10, true); 34 await promiseAllPaintsDone(); 35 await promiseOnlyApzControllerFlushed(); 36 37 ok(container.scrollTop > 0, "We should have scrolled the body"); 38 ok(!isLayerized("no_layer"), "no_layer should still not be layerized"); 39 } 40 41 if (isApzEnabled()) { 42 SimpleTest.waitForExplicitFinish(); 43 44 // Turn off displayport expiry so that we don't miss failures where the 45 // displayport is set and expired before we check for layerization. 46 // Also enable APZ test logging, since we use that data to determine whether 47 // a scroll frame was layerized. 48 pushPrefs([["apz.displayport_expiry_ms", 0], 49 ["apz.test.logging_enabled", true]]) 50 .then(waitUntilApzStable) 51 .then(forceLayerTreeToCompositor) 52 .then(test) 53 .then(SimpleTest.finish, SimpleTest.finishWithFailure); 54 } 55 56 </script> 57 </pre> 58 </body> 59 </html>