Skip to content

test_page_fixture_renders[alert-review]: an lf-option's strong keeps a wider box after a resize round trip since #7417 #7540

Todo

Description

@leaf-agent

On alert-review, test_page_fixture_renders reports a resize finding: after a 1200→440→560 round trip, the <strong> inside the Require three failed probes in a row option is 339 px wide, against the 335 px it measures when the page opens at 560. The narrow-first path shows the reverse. This was first seen in scheduled run 46137118943 on ad7b71b63, and #7526 left it unbracketed.

resized from the widest:
  opened at 1200px, taken to 440px and back to 560px:
  -        - strong [box=38,631,335,36]: Require three failed probes in a row
  +        - strong [box=38,631,339,36]: Require three failed probes in a row

Introduced by #7417 ("Port lf-options to Effect UI as the first decorating widget"). I ran git bisect run from 5792b6920 (good) to 6b6cd8548 (bad), testing tests/journeys/test_render_gate.py::test_page_fixture_renders[alert-review] by node id on Linux. Each step applied the versions-menu leak fix from #7526, so that the leak finding couldn't hide this one. The test passes at feeaebca8 and fails at 189757617 (#7417).

It is not one of the three #7417 failures in #7527: on #7538's head a6b0fc61d with the leak fix applied, alert-review still fails with only this finding. Some width the option's content takes at a wide window seems to survive the resize. The option is an lf-option holding a <strong> (examples/alert-review.html, near line 88). I haven't checked this.

Cause of a failure tracked in #7525.

Activity

  1. added
    tend-ci-cause
    on Nov 28, 2026
  2. leaf-agent commented on Nov 28, 2026

    @leaf-agent
    CollaboratorAuthor

    Cause: a Chromium layout bug, not Leaf state. Neither width is held by Leaf code. The 4.5 px is one collapsed space between the recommended chip (the option's ::before) and the title. Chromium drops that space after the page has been laid out in the row form and keeps it dropped once the window narrows. Opened fresh at 560, the option draws the space (strong 339 px wide, first line starting at x=140.6). Narrowed from 1200, it doesn't (334.6 px, x=136.1 = 38 + the chip's 92.1 + its 6 px margin). So the 335 reading is the stale one. I reproduced the finding on main at 2464127b9 with #7541's leak fix applied.

    Trigger. At 1040 px and up the cards share a row, and options.css floats the opening chips, ::before included (@container style(--lf-option-in-row: 1)). The slotted whitespace text nodes then follow only floats: the host's ::before and the option's mark, which floats before the <slot> in lf-option's shadow root. Chromium gives those whitespace nodes no layout object. When the chips stop floating, it doesn't recreate them, so the space never comes back. Without the shadow root, the same CSS doesn't reproduce. It needs both #7417's slotted structure and a floated ::before, which is why the test passes at feeaebca8 and fails at 189757617.

    Minimal reproduction outside Leaf (Chromium 159.0.8154.6)
    <!doctype html><style>
    .c{container-type:inline-size;display:flow-root}
    x-o{display:flow-root}
    .o::before{content:"recommended";display:inline-block;margin:0 6px 0 0}
    small{display:inline-block;margin:0 6px 0 0}
    @container (width >= 25rem){ small{float:inline-end;margin:0 0 0 6px} }
    @media (min-width:1000px){ .o::before{float:inline-start;display:block;margin:0 6px 5px 0} }
    </style>
    <div class=c><x-o class=o>
      <small>last week: 0 pages</small>
      <strong>Require three failed probes in a row</strong>
      Pages when the canary is down.
    </x-o></div>
    <script>document.querySelector("x-o").attachShadow({mode:"open"}).innerHTML='<span style="float:inline-end;width:17px;height:17px"></span><div style="display:contents"><slot></slot></div>'</script>

    strong's first client rect x at each width (Playwright, two rAFs after each resize):

    opened at 1200 → 880 → 560 → 440 → 560 → 880
    1200 104.6 everywhere (space missing)
    400 108.6 everywhere (space present)
    fresh at 560 108.6

    Removing the shadow root, the mark's float before the slot, or the ::before float (with small still floating) each makes every row read 108.6.

    Disposition: a call for the maintainer. I found no plain change to Leaf that avoids the trigger. Each one changes a design options.css and lf-option.js state on purpose: the mark is the float before the slot that reserves the status band, and the floated chips are what align the titles of cards laid across. notes/browser-support.md says a gap like this, which shows only on a rare path (a resize across the row breakpoint) and costs a 4.5 px gap, is recorded rather than corrected in Leaf's code. Recording it still leaves test_page_fixture_renders[alert-review] red. The open question is how the corpus resize journey should treat an engine gap it can't avoid:

    • leave this one finding red until Chromium fixes the bug,
    • add a per-page exception, the kind of tolerance tests/AGENTS.md warns against,
    • or change alert-review so it no longer combines across, recommended and leading chips, which drops that combination from the corpus.

    The choice decides how every later engine-only finding in this journey is handled, so I've assigned it to @max-sixty. Once you pick a route, the repair is a small PR: the browser-support.md entry with the reproduction above, plus whatever that route needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tend-ci-cause

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions