helper_hittest_bug1119497.html (1323B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>A hit testing test for the scenario in bug 1119497</title> 5 <script type="application/javascript" src="apz_test_utils.js"></script> 6 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 7 <script src="/tests/SimpleTest/paint_listener.js"></script> 8 <meta name="viewport" content="width=device-width"/> 9 <style> 10 #scrollbox { 11 width: 200px; 12 height: 200px; 13 overflow: auto; 14 } 15 #scrolled { 16 width: 400px; 17 height: 400px; 18 } 19 #cover { 20 width: 300px; 21 height: 300px; 22 position: fixed; 23 left: 0px; 24 top: 0px; 25 } 26 </style> 27 </head> 28 <body> 29 <div id="scrollbox"> 30 <div id="scrolled"></div> 31 </div> 32 <div id="cover"></div> 33 </body> 34 <script type="application/javascript"> 35 36 async function test() { 37 var config = getHitTestConfig(); 38 var utils = config.utils; 39 40 // Check that hit-testing on an element that's not scrolled by 41 // anything ("cover") hits the root scroller. 42 checkHitResult(hitTest({x: 50, y: 50}), 43 APZHitResultFlags.VISIBLE, 44 utils.getViewId(document.scrollingElement), 45 utils.getLayersId(), 46 "root scroller"); 47 } 48 49 waitUntilApzStable() 50 .then(test) 51 .then(subtestDone, subtestFailed); 52 53 </script> 54 </html>