helper_scroll_inactive_perspective.html (1490B)
1 <head> 2 <meta name="viewport" content="width=device-width; initial-scale=1.0"> 3 <title>Wheel-scrolling over inactive subframe with perspective</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, to make sure 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 perspective: 400px; 31 } 32 #scrolled { 33 width: 200px; 34 height: 1000px; /* so the subframe has room to scroll */ 35 background: linear-gradient(red, blue); /* so you can see it scroll */ 36 transform: translateZ(0px); /* so the perspective makes it to the display list */ 37 } 38 </style> 39 </head> 40 <body> 41 <div id="scroll"> 42 <div id="scrolled"></div> 43 </div> 44 <div style="height: 5000px;"></div><!-- So the page is scrollable as well --> 45 </body>