Repository navigation
Say the held lf-shot frame reads short only in Playwright's headless Firefox - #6400
Merged
Merged
Conversation
…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
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inJuggler.jswhen headless).*misses pseudo-elements, so the drawn stage gets no gutter while the held::aftergets 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 computedscrollbar-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.