helper_hittest_bug1715187.html (2036B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=2100"/> 6 <title>Check hittesting fission oop iframe with transform and pinch zoom works bug 1715187</title> 7 <script src="apz_test_native_event_utils.js"></script> 8 <script src="apz_test_utils.js"></script> 9 <script src="/tests/SimpleTest/paint_listener.js"></script> 10 <script> 11 12 async function test() { 13 let initial_resolution = await getResolution(); 14 ok(initial_resolution > 0, 15 "The initial_resolution is " + initial_resolution + ", which is some sane value"); 16 17 // Zoom in 18 SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0*initial_resolution); 19 await promiseApzFlushedRepaints(); 20 21 let resolution = await getResolution(); 22 ok(resolution > 1.5*initial_resolution, 23 "The resolution is " + resolution + ", after zooming in"); 24 25 26 let clickPromise = new Promise(resolve => { 27 window.addEventListener("message", event => { 28 if (event.data == "gotclick") { 29 ok(true, "got click"); 30 resolve(); 31 } 32 }) 33 }); 34 35 36 let thetarget = document.getElementById("theiframe"); 37 await synthesizeNativeMouseEventWithAPZ({ type: "click", target: thetarget, offsetX: 5, offsetY: 5 }); 38 info("sent click"); 39 40 await clickPromise; 41 42 ok(true, "must have got click"); 43 44 // Restore 45 SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(initial_resolution); 46 await promiseApzFlushedRepaints(); 47 48 resolution = await getResolution(); 49 ok(resolution == initial_resolution, 50 "The resolution is " + resolution + ", after restoring"); 51 } 52 53 waitUntilApzStable() 54 .then(test) 55 .then(subtestDone, subtestFailed); 56 57 </script> 58 <style> 59 body { 60 padding-left: 200px; 61 } 62 </style> 63 </head> 64 <body> 65 <div style="position: absolute; left: 350px; width: 400px; height: 400px; transform: scale(2,1)"> 66 <iframe id="theiframe" style="border: 1px;" frameborder="1" src="http://example.org/tests/gfx/layers/apz/test/mochitest/helper_hittest_bug1715187_oopif.html"></iframe> 67 </div> 68 </body> 69 </html>