Skip to content

Keep a scrolled page's overlay scrollbar shown in stills and probe's Chromium - #5270

Merged
max-sixty merged 3 commits into
mainfrom
agent-a039bc1479c6d2936
Nov 4, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-a039bc1479c6d2936

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

On a Mac, Chromium draws overlay scrollbars: a scroll shows the bar, which holds for half a second and then fades out over a quarter of a second. Stills and probe open their pages in Playwright's Chromium shell with its scrollbars shown, so a still of a state that scrolls caught the bar at whatever point of its fade the screenshot landed, which depended on the machine's load. On main against itself under taskpolicy -b, stills read plan-execution as changed by 7,368 px: its base still had no bar and its head a bar mid-fade, the same count a run reported for plan-card-keyboard. Unthrottled, both arms of plan-card-keyboard drew the whole bar in four runs of four; under taskpolicy -b, neither did.

browser.launch now disables Chromium's ScrollbarAnimations feature, which Chromium keeps so that web platform tests' screenshots can't flake on their timing: a bar a scroll shows stays shown at full opacity until the pointer passes over it and leaves. Every capture after a scroll draws the same bar, as a reader sees it while scrolling, and a state that never scrolls draws none. A classic bar, as on Linux, never faded and is unchanged. A probe recording now keeps the bar shown after a scroll, where a reader would see it fade.

Chromium keeps only the last of a repeated switch, and Playwright passes its own --disable-features, so a second one would silently re-enable everything Playwright disables, paint holding and the redirect handling its request interception relies on among them. launch reads Playwright's switch from a shell it launches first (CDP reads the command line only under --enable-automation), and launches the real one with that switch extended. The extra launch takes about 70 ms.

Playwright's Firefox and WebKit draw no scrollbar at all on a Mac after a scroll, Firefox even with layout.testing.overlay-scrollbars.always-visible, so there is nothing to settle there. Stills on the iOS simulator captures only states without input, and those never scroll.

Checked

  • The bar's opacity, sampled every ~20 ms after a scroll in a bare shell: on main it holds for 0.5 s and is gone by 0.75 s after a wheel, script or key scroll; with the feature disabled it holds for the whole 3 s.
  • A probe journey screenshotting plan-card-keyboard at 0, 0.3, 0.6, 0.9, 1.5 and 2.5 s after its input: main's Chromium drew the bar through 0.9 s and none from 1.5 s; this branch's drew it at every time from the end of the scroll.
  • leaf-dev stills --state plan-card-keyboard --state plan-execution --state markdown-preview-scrolled against main: all three unchanged in each of three unthrottled Chromium runs, two Chromium runs under taskpolicy -b, and two runs each in Firefox and WebKit. Every Chromium still drew the bar.

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

…Chromium

On a Mac, Chromium draws overlay scrollbars: a scroll shows the bar, which holds for half a second and then fades out over a quarter of a second. Stills and probe open their pages in Playwright's Chromium shell with its scrollbars shown, so a still of a state that scrolls caught the bar at whatever point of its fade the screenshot landed, which depended on the machine's load. On main against itself under `taskpolicy -b`, stills read `plan-execution` as changed by 7,368 px: its base still had no bar and its head a bar mid-fade, the same count a run reported for `plan-card-keyboard`. Unthrottled, both arms of `plan-card-keyboard` drew the whole bar in four runs of four; under `taskpolicy -b`, neither did.

`browser.launch` now disables Chromium's `ScrollbarAnimations` feature, as web platform tests do for the same reason: a bar a scroll shows stays shown at full opacity. Every capture after a scroll draws the same bar, as a reader sees it while scrolling, and a state that never scrolls draws none. A classic bar, as on Linux, never faded and is unchanged. A probe recording now keeps the bar shown after a scroll, where a reader would see it fade.

Chromium keeps only the last of a repeated switch, and Playwright passes its own `--disable-features`, so a second one would silently re-enable everything Playwright disables, paint holding and the redirect handling its request interception relies on among them. `launch` reads Playwright's switch from a shell it launches first (CDP reads the command line only under `--enable-automation`), and launches the real one with that switch extended. The extra launch takes about 70 ms.

Playwright's Firefox and WebKit draw no scrollbar at all on a Mac after a scroll, Firefox even with `layout.testing.overlay-scrollbars.always-visible`, so there is nothing to settle there. Stills on the iOS simulator captures only states without input, and those never scroll.

## Checked

- The bar's opacity, sampled every ~20 ms after a scroll in a bare shell: on main it holds for 0.5 s and is gone by 0.75 s after a wheel, script or key scroll; with the feature disabled it holds for the whole 3 s.
- A probe journey screenshotting `plan-card-keyboard` at 0, 0.3, 0.6, 0.9, 1.5 and 2.5 s after its input: main's Chromium drew the bar through 0.9 s and none from 1.5 s; this branch's drew it at every time from the end of the scroll.
- `leaf-dev stills --state plan-card-keyboard --state plan-execution --state markdown-preview-scrolled` against main: all three unchanged in each of three unthrottled Chromium runs, two Chromium runs under `taskpolicy -b`, and two runs each in Firefox and WebKit. Every Chromium still drew the bar.
leaf-agent
leaf-agent previously approved these changes Nov 4, 2026
@max-sixty
max-sixty merged commit cbc6562 into main Nov 4, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-a039bc1479c6d2936 branch November 4, 2026 01:39
leaf-agent pushed a commit that referenced this pull request Nov 4, 2026
On identical runtimes, stills read `plan-card-reply`, `triage-composer`
and `triage-composer-empty` as changed by 68 px in 5 of 12 captures on
main under `taskpolicy -b`: the composer's caret blinked, and each arm
caught it in its own phase. Playwright hides a caret by colouring each
field it can reach transparent, but the composer draws its caret inside
the text field's closed shadow root, which set the caret's colour
itself.

Stills and probe now take their screenshots through
`browser.screenshot`, whose docstring states the rule both follow: a
capture holds each animation the browser draws of its own accord in one
state. For the shot it adds a style that draws every caret steadily
where the engine can stop its blink (`caret-animation: manual`, which
Playwright's Chromium supports) and hides every caret where it can't:
Playwright's WebKit fades its caret in and out, and its Firefox draws
none headless. The overlay scrollbar that #5270 keeps shown through
`launch` is the docstring's other case; `launch`'s own docstring now
points there.

Both declarations are inherited. For the hide to reach the composer's
caret in WebKit, the text field takes the caret's colour from its host:
`:host` sets `caret-color: currentColor` and the editor inherits it. The
caret keeps the ink of the words it stands in (computed values compared
in Chromium, Firefox and WebKit), and a rule on the field now colours
its caret, as one on a textarea does.

What stills shows changes in two ways. In Chromium every focused field's
caret is drawn, where Playwright used to hide all but the composer's; in
WebKit and Firefox none is. Against a base from before this change,
WebKit draws the base's composer caret and hides the head's, so those
states read as changed there until the base includes this commit.

Checked on identical runtimes unless noted:

- Chromium against main under `taskpolicy -b`: 0 of 12 captures of the
three states changed, against 5 of 12 for main against itself. The caret
is drawn in both arms.
- Ten screenshots 250 ms apart of each of the three states: with
Playwright's default screenshot, Chromium drew 2 distinct images and
WebKit 3 to 5; through `screenshot`, 1 each. Firefox drew 1 either way.
- WebKit with both arms on this change: 0 of 12 changed. Against main,
all 9 changed, by the base's caret alone.
- Firefox against main: 0 of 9 changed.
- Ten screenshots 250 ms apart of every state in the catalogue, through
`screenshot`: one image each for 247 of 249 states in Chromium, 242 in
WebKit and 235 in Firefox; the rest failed to reach their state or
varied. Focus rings, spellcheck marks and scrolled states held still.
What still varied is not an animation the capture's style can hold. In
every engine, `image-preview` changed when PhotoSwipe dropped its
placeholder, about a second after the page reported settled. In Firefox
and WebKit, three states each lost a hover look 250 to 500 ms after
settling: the button or link under the resting pointer, after the click
or scroll that left it there (`film-inspector` and `activity-feed` in
both, `screenshot-options` in Firefox, `authored-timeline-keyboard` in
WebKit).

> _This was written by Claude Code on behalf of max-sixty_
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