author James Teh <>
Wed, 01 Feb 2023 05:02:01 +0000
changeset 651150 dd0fdd1daa69783be36acd5c50544f3694eaa8f9
parent 616557 918ef225713fa9fc188f42355a6cd4a2bfb3b64c
permissions -rw-r--r--
Bug 1813980: Check IsDoc before Parent in RemoteAccessibleBase::ApplyCrossDocOffset. r=morgan We call this function on every ancestor when calculating bounds. RemoteParent() currently requires a hash lookup, so it's more efficient to early return for !IsDoc() first. This is a micro-optimisation, but it might have some impact given that we call this on every ancestor, especially when hit testing, where we call Bounds() a lot. As a bit of drive-by cleanup, use RemoteParent() rather than calling Parent() and IsRemote/AsRemote(). Differential Revision:

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width; initial-scale=1.0">
  <title>Touch-action on a zero-opacity element</title>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script type="application/javascript">
async function test() {
  var target = document.getElementById("target");

  let touchEndPromise = promiseTouchEnd(document.body);

  // drag the page up to scroll down by 50px
  ok(await synthesizeNativeTouchDrag(target, 10, 100, 0, -50),
      "Synthesized native vertical drag, waiting for touch-end event...");
  await touchEndPromise;

  await promiseOnlyApzControllerFlushed();

  is(window.scrollX, 0, "X scroll offset didn't change");
  is(window.scrollY, 0, "Y scroll offset didn't change");

.then(subtestDone, subtestFailed);

<body style="border: solid 1px green">
  <div id="spacer" style="height: 2000px">
    Inside the black border is a zero-opacity touch-action none.
    <div id="border" style="border: solid 1px black">
        <div style="opacity: 0; height: 300px;">
            <div style="transform:translate(0px)">
                <div id="target" style="height: 300px; touch-action: none">this text shouldn't be visible</div>