helper_hittest_bug1257288.html (1778B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>A hit testing test for the scenario in bug 1257288</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 html { 11 background: radial-gradient(circle at 80px 450px, blue 5px, transparent 0) gray no-repeat; 12 height: 100%; 13 } 14 15 #scrollbox { 16 border: 1px solid black; 17 width: 400px; 18 height: 400px; 19 margin: 20px; 20 overflow: auto; 21 background-color: white; 22 } 23 24 #scrolled { 25 padding-top: 300px; 26 padding-bottom: 300px; 27 } 28 29 #clip { 30 overflow: hidden; 31 margin: 10px; 32 } 33 34 #transform { 35 background-color: red; 36 width: 200px; 37 height: 200px; 38 will-change: transform; 39 transform: rotate(45deg); 40 position: relative; 41 left: -100px; 42 } 43 </style> 44 </head> 45 <body> 46 <div id="scrollbox"> 47 <div id="scrolled"> 48 <div id="clip"> 49 <div id="transform"></div> 50 </div> 51 </div> 52 </div> 53 </body> 54 <script type="application/javascript"> 55 56 async function test() { 57 var config = getHitTestConfig(); 58 var utils = config.utils; 59 60 // Check that hit-testing on the blue circle (located at (80, 450)) 61 // hits the root, not the subframe. 62 checkHitResult(hitTest({x: 80, y: 450}), 63 APZHitResultFlags.VISIBLE, 64 utils.getViewId(document.scrollingElement), 65 utils.getLayersId(), 66 "root scroller should be hit, not subframe"); 67 } 68 69 waitUntilApzStable() 70 .then(test) 71 .then(subtestDone, subtestFailed); 72 73 </script> 74 </html>