gfx/layers/apz/test/mochitest/helper_scroll_tables_perspective.html
author James Teh <jteh@mozilla.com>
Wed, 01 Feb 2023 05:02:01 +0000
changeset 651150 dd0fdd1daa69783be36acd5c50544f3694eaa8f9
parent 568166 73824cc3c66a3aa170d3b0c688e7dee58d06f1d7
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: https://phabricator.services.mozilla.com/D168346

<!DOCTYPE html>
<head>
  <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 subframe = document.getElementById("content-wrapper");

  // scroll over the middle of the subframe, to make sure it scrolls,
  // not the page
  var scrollPos = subframe.scrollTop;
  await promiseMoveMouseAndScrollWheelOver(subframe, 100, 100);
  ok(subframe.scrollTop > scrollPos, "subframe scrolled after wheeling over it");
}

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);

  </script>
  <style>
    html {
      perspective:1000px;
      overflow: hidden;
    }
    #fullscreen-wrapper {
      display:table;
      visibility:hidden;
      width:100%;
      height:100%;
      position:fixed;
      top:0;
      left:0;
      overflow:hidden;
      z-index:9999;
      perspective:1000px;
    }
    #content-wrapper {
      overflow-y:auto;
      height: 100vh;
    }
    #content-content {
      min-height: 10000px;
    }
  </style>
</head>
<body>
    <div id="fullscreen-wrapper">
      <div></div>
    </div>
    <div id="content-wrapper">
      <div id="content-content">
        A<br>
        B<br>
        C<br>
        D<br>
        E<br>
        f<br>
        g<br>
        h<br>
        i<br>
        j<br>
      </div>
    </div>
</body>