helper_overscroll_behavior_bug1425573.html (1401B)
1 <head> 2 <meta name="viewport" content="width=device-width; initial-scale=1.0"> 3 <title>Wheel-scrolling over inactive subframe with overscroll-behavior</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 the page 13 // does not scroll. 14 var waitForScroll = false; // don't wait for a scroll event, it will never come 15 await promiseMoveMouseAndScrollWheelOver(subframe, 100, 100, waitForScroll); 16 ok(window.scrollY == 0, "overscroll-behavior was respected"); 17 } 18 19 waitUntilApzStable() 20 .then(test) 21 .then(subtestDone, subtestFailed); 22 23 </script> 24 <style> 25 #scroll { 26 width: 200px; 27 height: 200px; 28 overflow: scroll; 29 overscroll-behavior: contain; 30 } 31 #scrolled { 32 width: 200px; 33 height: 1000px; /* so the subframe has room to scroll */ 34 background: linear-gradient(red, blue); /* so you can see it scroll */ 35 } 36 </style> 37 </head> 38 <body> 39 <div id="scroll"> 40 <div id="scrolled"></div> 41 </div> 42 <div style="height: 5000px;"></div><!-- So the page is scrollable as well --> 43 </body> 44 </head>