helper_fission_empty_clip.html (2357B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width,initial-scale=1"> 6 <title>Ensure an empty clip area on the top level document doesn't interfere OOPIFs hit-test</title> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <script src="/tests/SimpleTest/paint_listener.js"></script> 9 <script src="helper_fission_utils.js"></script> 10 <script src="apz_test_utils.js"></script> 11 <script src="apz_test_native_event_utils.js"></script> 12 <script> 13 async function test() { 14 const iframe = document.getElementById("testframe"); 15 await setupCrossOriginIFrame(iframe, "helper_fission_plain.html"); 16 const remoteType = await SpecialPowers.spawn(iframe, [], async () => { 17 return await SpecialPowers.spawnChrome([], () => { 18 return windowGlobalParent.domProcess.remoteType; 19 }); 20 }); 21 if (remoteType === "web") { 22 is(SpecialPowers.effectiveIsolationStrategy(), SpecialPowers.ISOLATION_STRATEGY.IsolateHighValue); 23 ok(true, "Skipping this test since the document on example.com got loaded in the same content process"); 24 return; 25 } 26 27 const oopifScrollerIds = await SpecialPowers.spawn(iframe, [], () => { 28 const utils = SpecialPowers.getDOMWindowUtils(content.window); 29 const result = { 30 layersId: utils.getLayersId(), 31 viewId: utils.getViewId(content.document.scrollingElement) 32 }; 33 dump(`OOPIF computed IDs ${JSON.stringify(result)}\n`); 34 return result; 35 }); 36 37 checkHitResult(await hitTestOOPIF(centerOf(iframe), iframe), 38 APZHitResultFlags.VISIBLE, 39 oopifScrollerIds.viewId, 40 oopifScrollerIds.layersId, 41 "Hit testing on OOPIF covered by an empty clipped element"); 42 } 43 44 if (!SpecialPowers.Services.appinfo.fissionAutostart) { 45 ok(true, "This test doesn't need to run with disabling Fission"); 46 subtestDone(); 47 } else { 48 waitUntilApzStable() 49 .then(test) 50 .then(subtestDone, subtestFailed); 51 } 52 </script> 53 </head> 54 <body> 55 <style> 56 html, body { 57 margin: 0; 58 } 59 60 iframe { 61 position: absolute; 62 width: 300px; 63 height: 200px; 64 } 65 66 #clip { 67 position: absolute; 68 top: 0; 69 left: 0; 70 width: 100%; 71 height: 100%; 72 z-index: 100; 73 clip-path: polygon(0px 0px, 100% 0px, 100% 0%, 0px 0%); 74 opacity: 0; 75 } 76 </style> 77 <div id="clip"></div> 78 <iframe id="testframe"></iframe> 79 </body> 80 </html>