author James Teh <>
Wed, 01 Feb 2023 05:02:01 +0000
changeset 651150 dd0fdd1daa69783be36acd5c50544f3694eaa8f9
parent 593933 23f67b8ae851967149707e9150268242beff9ae4
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:

<!DOCTYPE html>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hit-testing of fixed background image</title>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
      body {
        height: 100vh;
        margin: 0px;
        padding: 0px;
        overflow-x: hidden;
      .bg-gradient {
        background: linear-gradient(white, green) fixed;
        height: 1000px;
        width: 100%;
    <div class="bg-gradient"></div>
    <div style="height: 1000px; background-color: green;"></div>
<script type="application/javascript">

async function test() {
  var config = getHitTestConfig();
  var utils = config.utils;

  var body = document.querySelector("body");
  utils.setDisplayPortForElement(0, 0, 800, 2000, body, 1);
  await promiseApzFlushedRepaints();

  var target = document.querySelector(".bg-gradient");
                 "fixed bg image");

.then(subtestDone, subtestFailed);