Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>Ensure an empty clip area on the top level document doesn't interfere OOPIFs hit-test</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script src="helper_fission_utils.js"></script>
  <script src="apz_test_utils.js"></script>
  <script src="apz_test_native_event_utils.js"></script>
  <script>
async function test() {
  const iframe = document.getElementById("testframe");
  await setupCrossOriginIFrame(iframe, "helper_fission_plain.html");
  const remoteType = await SpecialPowers.spawn(iframe, [], async () => {
    return await SpecialPowers.spawnChrome([], () => {
      return windowGlobalParent.domProcess.remoteType;
    });
  });
  if (remoteType === "web") {
    is(SpecialPowers.effectiveIsolationStrategy(), SpecialPowers.ISOLATION_STRATEGY.IsolateHighValue);
    ok(true, "Skipping this test since the document on example.com got loaded in the same content process");
    return;
  }
  const oopifScrollerIds = await SpecialPowers.spawn(iframe, [], () => {
    const utils = SpecialPowers.getDOMWindowUtils(content.window);
    const result = {
      layersId: utils.getLayersId(),
      viewId: utils.getViewId(content.document.scrollingElement)
    };
    dump(`OOPIF computed IDs ${JSON.stringify(result)}\n`);
    return result;
  });
  checkHitResult(await hitTestOOPIF(centerOf(iframe), iframe),
                 APZHitResultFlags.VISIBLE,
                 oopifScrollerIds.viewId,
                 oopifScrollerIds.layersId,
                 "Hit testing on OOPIF covered by an empty clipped element");
}
if (!SpecialPowers.Services.appinfo.fissionAutostart) {
  ok(true, "This test doesn't need to run with disabling Fission");
  subtestDone();
} else {
  waitUntilApzStable()
    .then(test)
    .then(subtestDone, subtestFailed);
}
  </script>
</head>
<body>
<style>
html, body {
  margin: 0;
}
iframe {
  position: absolute;
  width: 300px;
  height: 200px;
}
#clip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  clip-path: polygon(0px 0px, 100% 0px, 100% 0%, 0px 0%);
  opacity: 0;
}
</style>
<div id="clip"></div>
<iframe id="testframe"></iframe>
</body>
</html>