Skip to content

Say the held lf-shot frame reads short only in Playwright's headless Firefox - #6400

Merged
leaf-agent merged 2 commits into
mainfrom
agent-a072cc9ba00c64d59
Nov 18, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
agent-a072cc9ba00c64d59

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Corrects the claim #6195 left in shot.css, that Firefox gives a pseudo-element's scrollbar gutter a classic scrollbar's width even where its scrollbars overlay. The shortfall #6195 measured (held frame 12px short, 3px at 640) comes from Playwright: its Firefox, when headless, adds a user-agent sheet with * { scrollbar-width: none !important } (hidden-scrollbars.css, loaded in Juggler.js when headless). * misses pseudo-elements, so the drawn stage gets no gutter while the held ::after gets the classic 12px a side that headless Linux Firefox reports. Headed Linux Firefox under Xvfb holds exactly with classic bars (24 / 24px gutters) and with overlay bars (0 / 0), as do Chromium on Linux (30 / 30) and every engine on macOS. The comment now states the condition (same computed scrollbar-width) and the Playwright case. Only the comment changes.

Worth knowing beyond the diff: #6195's note that it regressed Firefox came from the same sheet, so it changed nothing a Firefox reader sees. Windows Firefox is unmeasured. The commit message has the per-engine table.

Asked for by max-sixty, who hasn't read it yet. #6195's test passes in Chromium on macOS and Linux; its body, run in Firefox and WebKit on both, gives the numbers above.

This was written by Claude Code on behalf of max-sixty

…Firefox

The comment #6195 added to shot.css said Firefox gives a pseudo-element's scrollbar gutter a classic scrollbar's width even where its scrollbars overlay. Firefox does no such thing. Playwright's Firefox, when headless, registers a user-agent sheet holding `* { scrollbar-width: none !important }` (`juggler/content/hidden-scrollbars.css`, loaded by `juggler/components/Juggler.js` when `nsIGfxInfo.isHeadless`). `*` matches elements and not pseudo-elements, so the drawn stage computes `scrollbar-width: none` and gets no gutter, while the held gutter-only `::after` computes `auto` and gets the platform's: 12px a side where scrollbars are classic, which headless Linux Firefox reports. A reader's Firefox loads no such sheet, and there the box and the stage get the same gutter, classic or overlay. The comment now says that.

Measured with #6195's test body (held and drawn `lf-shot` heights at 430, 450, 455, 465, 480 and 640px) and a plain-page probe of the same gutter-only box as `::after` and as a `<div>`, Playwright 1.65 (Chromium 158, Firefox 159, WebKit 27.2):

| engine, platform | box / stage gutter (px) | held minus drawn (px) |
|---|---|---|
| Firefox, Linux headless (Playwright image, arm64) | 24 / 0 | -12 at five widths, -3 at 640 |
| Firefox, Linux headless, `ui.useOverlayScrollbars=1` | 0 / 0 | 0 |
| Firefox, Linux headed under Xvfb, classic GTK bars | 24 / 24 | 0 |
| Firefox, Linux headed under Xvfb, overlay bars | 0 / 0 | 0 |
| Firefox, macOS headless (overlay) | 0 / 0 | 0 |
| Firefox, macOS headless, `ui.useOverlayScrollbars=0` | 30 / 0 | -15 at five widths, -6 at 640 |
| Chromium headless shell, Linux | 30 / 30 | 0 |
| Chromium and WebKit, macOS; WebKit, Linux | 0 / 0 | 0 |

Headless, the `<div>` computes `scrollbar-width: none` and the `::after` `auto`; headed, both compute `auto`. Turning off `layout.css.fake-webkit-scrollbar.enabled` or `widget.gtk.overlay-scrollbars.enabled` changes nothing headless, and neither does reframing the page. Setting the `::after` to `scrollbar-width: inherit` makes the held height exact under headless Playwright Firefox and changes nothing headed.

The CSS before #6195 also holds exactly in headed Linux Firefox with classic bars, so #6195 changed nothing a Firefox reader sees; its note that it regressed Firefox came from the headless sheet. Windows Firefox is unmeasured.
@leaf-agent
leaf-agent merged commit 30b2d01 into main Nov 18, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the agent-a072cc9ba00c64d59 branch November 18, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants