helper_hittest_bug1730606-3.html (1512B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>A hit testing test involving a scenario with a scale transform</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 body, html { 11 margin: 0; 12 padding: 0; 13 width: 100%; 14 height: 100%; 15 } 16 #layer1 { 17 position: absolute; 18 top: 0px; 19 left: 0px; 20 width: 100px; 21 height: 100px; 22 background: red; 23 overflow: scroll; 24 transform: scale(2.0); 25 transform-origin: 0 0; 26 } 27 </style> 28 </head> 29 <body> 30 <!-- Neither the root nor layer1 actually have room to scroll --> 31 <div id="layer1"></div> 32 </body> 33 <script type="application/javascript"> 34 35 async function test() { 36 var config = getHitTestConfig(); 37 var utils = config.utils; 38 39 // Force an APZC for layer1 in spite of it having no scroll range. 40 utils.setDisplayPortForElement(0, 0, 100, 100, layer1, 1); 41 await promiseApzFlushedRepaints(); 42 43 // Hit an area on layer1 that would be on the root if layer1 weren't transformed. 44 checkHitResult(hitTest({x: 150, y: 150}), 45 APZHitResultFlags.VISIBLE, 46 utils.getViewId(layer1), 47 utils.getLayersId(), 48 "layer1"); 49 } 50 51 waitUntilApzStable() 52 .then(test) 53 .then(subtestDone, subtestFailed); 54 55 </script> 56 </html>