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

<?xml version="1.0" encoding="UTF-8"?>
     Any copyright is dedicated to the Public Domain.
     This reference case is the same as the testcase, but with an explicit <div>
     around each run of content that we expect to turn into an anonymous
     grid item (to ensure that the whitespace is included).
<html xmlns="">
    <title>CSS Reftest Reference</title>
    <link rel="author" title="Daniel Holbert" href=""/>
    <link rel="stylesheet" type="text/css" href="support/ahem.css" />
      div.a, div.b, div.grid { height: 100px; }
      div.grid {
        white-space: pre;
        border: 1px dashed blue;
        width: 200px;
        display: grid;
        justify-content: space-around;
      div.a {
        width: 30px;
        background: lightgreen;
      div.b {
        width: 20px;
        background: lightblue;
    <!-- spaces around inline content at the beginning of grid -->
    <div class="grid"><div>  abc</div><div class="a"/></div>
    <div class="grid"><div>abc   </div><div class="a"/></div>
    <div class="grid"><div>  abc   </div><div class="a"/></div>

    <!-- spaces around inline content at the end of grid -->
    <div class="grid"><div class="a"/><div>  abc</div></div>
    <div class="grid"><div class="a"/><div>abc   </div></div>
    <div class="grid"><div class="a"/><div>  abc   </div></div>

    <!-- whitespace around inline content in between grid items -->
    <div class="grid"><div class="a"/><div>  abc</div><div class="b"/></div>
    <div class="grid"><div class="a"/><div>abc   </div><div class="b"/></div>
    <div class="grid"><div class="a"/><div>  abc   </div><div class="b"/></div>