helper_scroll_inactive_zindex.html (1518B)
1 <head> 2 <meta name="viewport" content="width=device-width; initial-scale=1.0"> 3 <title>Wheel-scrolling over inactive subframe with z-index</title> 4 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 5 <script type="application/javascript" src="apz_test_utils.js"></script> 6 <script src="/tests/SimpleTest/paint_listener.js"></script> 7 <script type="application/javascript"> 8 9 async function test() { 10 var subframe = document.getElementById("scroll"); 11 12 // scroll over the middle of the subframe, and make sure that it scrolls, 13 // not the page 14 var scrollPos = subframe.scrollTop; 15 await promiseMoveMouseAndScrollWheelOver(subframe, 100, 100); 16 dump("after scroll, subframe.scrollTop = " + subframe.scrollTop + "\n"); 17 ok(subframe.scrollTop > scrollPos, "subframe scrolled after wheeling over it"); 18 } 19 20 waitUntilApzStable() 21 .then(test) 22 .then(subtestDone, subtestFailed); 23 24 </script> 25 <style> 26 #scroll { 27 width: 200px; 28 height: 200px; 29 overflow: scroll; 30 } 31 #scrolled { 32 width: 200px; 33 height: 1000px; /* so the subframe has room to scroll */ 34 z-index: 2; 35 background: linear-gradient(red, blue); /* so you can see it scroll */ 36 transform: translateZ(0px); /* to force active layers */ 37 will-change: transform; /* to force active layers */ 38 } 39 </style> 40 </head> 41 <body> 42 <div id="scroll"> 43 <div id="scrolled"></div> 44 </div> 45 <div style="height: 5000px;"></div><!-- So the page is scrollable as well --> 46 </body>