Skip to content

Move to Playwright 1.65, and spell position-visibility's anchor-visible as each engine reads it - #5803

Merged
max-sixty merged 5 commits into
mainfrom
grind/anchor-visible-spelling
Nov 10, 2026
Merged

max-sixty merged 5 commits into
mainfrom
grind/anchor-visible-spelling

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

This moves the suite to Playwright 1.65.0 and changes how Leaf spells position-visibility: anchors-visible, which Playwright's new Chromium warns about. The CSS working group renamed the value to anchor-visible. Chromium 158 warns in the console wherever it parses the old plural, and page check --render reports that warning as a finding against the page. So once Chrome 158 reaches stable, every agent's render check would report a finding against Leaf's own stylesheet. Firefox 159 still reads only the plural, so neither spelling works on its own.

--lf-anchor-visible (browser/styles/tokens.css) holds the value: the plural by default, and the singular where @supports reads it. The four places that hide a box once its anchor is out of sight now read it: the preview, the reaction palette, the response options and the target paint boxes. A custom property's value is parsed only where a declaration uses it, so Chromium never parses the plural and Firefox never the singular. Writing both declarations, or putting the plural in a @supports not block, still warns in Chromium 158, because it parses the rule either way. notes/browser-support.md records the gap and gives the check that says when Firefox reads the singular, after which the property can go.

Engine anchors-visible anchor-visible
Chromium headless shell 158.0.8127.18 (Playwright 1.65.0) read, with a console warning read
Google Chrome 157.0.8103.50, installed read read
WebKit 27.2 (Playwright build 2388) read read
Firefox 159.0 (Playwright 1.65.0) read refused

Two private Playwright names that Leaf's tools reach into changed in 1.65, and ty fails on them: playwright._impl._fetch is now playwright._impl.fetch (test_public_api.py), and SyncBase._sync names its argument awaitable (leaf-dev suite-profile's wrapper).

The Playwright move is here because only its Chromium shows the warning. On #5530's CI run, which already moved to 1.65.0, this warning caused every failure: 1 failed and 9 errors in tests/smoke, out of 3,264 that passed. #5530 then only needs its harness change and the dev group's floor.

Checked:

  • leaf-dev probe feature-gallery in Chromium 158, Firefox 159 and WebKit 27.2. The root property and the computed position-visibility of the preview, the response options and an inline paint box are anchor-visible, anchors-visible and anchor-visible respectively, and the console is empty.
  • The three smoke tests that failed on Judge every Firefox frame's watches on Playwright 1.65, and fail a frame whose judgement never completes #5530 (test_a_host_draws_each_widget_as_a_leaf_page_does, test_a_shipped_page_passes_the_real_browser_gate, test_ship_review_obligations_are_directly_answerable) pass on Chromium 158.
  • pre-commit on the changed files, ty on all files, and test_closing_an_output_observer_during_its_body_read_keeps_the_browser_usable.

No test was added. Two tries with a focus preview couldn't tell the spellings apart. When the window scrolls, the preview leaves the window with its target. When a scroller hides the target, the preview doesn't stay where the window had room for it. The comment at the property says why each engine needs its spelling.

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

On 1.64.1 the frames Playwright's Firefox loses fail judge_watches by name; 1.65.0 ships Firefox r1572 with the upstream fix (microsoft/playwright#43494). The feature-gallery Firefox console test passes in 22 s.
Chromium 158 warns on the plural anchors-visible, which page check --render reports against the page, and Firefox 159 reads only the plural. --lf-anchor-visible (tokens.css) carries the singular where @supports reads it; a custom property's value is parsed only where it is used, so neither engine meets the spelling it doesn't take.
leaf-agent
leaf-agent previously approved these changes Nov 10, 2026
@max-sixty
max-sixty merged commit 1f7cc6c into main Nov 10, 2026
6 checks passed
@max-sixty
max-sixty deleted the grind/anchor-visible-spelling branch November 10, 2026 20:27
max-sixty added a commit that referenced this pull request Nov 10, 2026
…ame whose judgement never completes (#5530)

#5803 moved the suite to Playwright 1.65.0, whose Firefox build no
longer loses frames. This raises the dev group's Playwright floor to
1.65, since on 1.64.1 the frames Playwright loses would now fail their
test (measured below). The `[project]` dependency serves Chrome only and
stays at 1.64.

`judge_watches` asked each Firefox child frame `wait_for_function("() =>
true")` with the 120 s suite deadline, and read the timeout as
"Playwright lost this frame, nothing to judge". Each lost frame cost the
full deadline. The feature gallery's Firefox console test took 1,614 s
on [daily run
42014155473](https://github.com/max-sixty/leaf/actions/runs/42014155473),
1.1x under the per-test limit. This PR removes that probe
(`_reachable`). Every frame is judged the same way in every engine,
through one bounded `wait_for_function` that starts the drain on its
first reading and returns when the drain completes. When that deadline
expires, the test fails with a note naming the frame, rather than
skipping the frame. No wait left in `judge_watches` decides a result by
expiring (`tests/AGENTS.md`, "Functional results do not depend on
execution speed"; #5522).

## Why frames were lost

The frames are lost by Playwright's Firefox (Juggler), not by Leaf.
Juggler learns that a frame's navigation has started from an observer
whose subject is the frame's docShell, passed as a bare `nsISupports`.
Its `FrameTree` read `docShell.browsingContext` without
`QueryInterface(Ci.nsIDocShell)`. In one run, the lookup found the frame
for the early navigations and returned nothing for the later ones, and
those navigation starts were dropped. When the new document's element is
inserted, Juggler finds no pending navigation, so it never commits the
document, never creates its execution context and never runs init
scripts there. Firefox itself loads the document normally, and the
sample becomes ready.

Why the unqueried read works at first is inferred, not observed:
XPConnect reuses an earlier reflector of the docShell that was queried
for `nsIDocShell`, until garbage collection frees it. Pages of window
samples trigger the loss: 18 `window` samples lost 2 to 11 frames per
run, and 12 plain samples lost none.

Upstream fixed it in Firefox r1564
([microsoft/playwright#43494](microsoft/playwright#43494),
`const docShell = subject.QueryInterface(Ci.nsIDocShell)`). Playwright
1.65.0 ships r1572.

Evidence:
- A copy of Juggler patched to log its observer printed `frame=null`
without the `QueryInterface`, and the right frame with it, for every
lost navigation. A second observer on the same topic fired for all 18
loads.
- A plain Playwright page with 12 sandboxed iframes navigated in batches
of three lost none.

## Before and after

The feature-gallery Firefox console test on this Mac, `-n 0 -p
no:randomly`:

| Harness | Firefox | Time | Child frames |
|---|---|---|---|
| main | r1555 (Playwright 1.64.1) | 1,213 s | 10 of 18 timed out at 120
s each; 8 answered in 0.01 s |
| main | r1572 (Playwright 1.65.0) | 14 s | 18 answered |
| this PR | r1572 | 17 s | all judged; slowest 0.03 s |
| this PR on Playwright 1.65.0 | r1572 | 22 s | passes |
| this PR | r1555 | fails after 136 s | `Timeout 120000ms exceeded`,
"judging the watches in about:blank" |

The r1572 rows drive the downloaded r1572 build from this tree's
Playwright 1.64.1 client through `executable_path`.

## Control

`test_words_in_a_firefox_frame_its_page_hides_fail_when_judged` types
words into an opaque Firefox frame, as a sample's is, and then the page
hides the frame. A hidden frame paints nothing, so only the judgement
reports the loss. With Firefox child frames skipped in
`_judge_frame_watches`, the test fails with no finding.

`test_health_judgement_releases_a_frame_removed_inside_its_evaluation`
now watches the one `wait_for_function` call, since judgement no longer
calls `evaluate`. The comment in `input_work_watch.js` no longer cites
lost Firefox frames as the reason a port message carries its source as
an extra field. A worker, which runs no init script, still reads past
that field.

## Checks

- `tests/journeys/test_render_gate.py -k firefox_console_warnings`: all
48 corpus pages pass on r1572 (44.75 s, `-n 3`).
- `tests/browser/test_render_shift_watch.py -k "frame or deadline"` with
`test_a_wait_takes_the_suites_deadline`: 20 passed.
- `tests/browser/test_render_words_watch.py -k frame`: 4 passed.
- `dev/tests/browser/test_browser_diagnostics.py`: 7 passed.
- `pre-commit run --files` on the changed files.

- On Playwright 1.65.0's own client, after merging main: the
feature-gallery Firefox console test (22 s, `-n 0`), the hidden-frame
control and `-k health_judgement` pass.

Not verified locally: Linux, and the Firefox browser tests outside the
corpus console sweep and the control; the pull request's `test` job runs
them.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 11, 2026
…y as JSON, for Playwright 1.65 (#5824)

Playwright 1.65 (#5803) broke three tests on main in two ways, both on
the test side. Each test fails on current main and passes with this
change.

- **Locator arguments.** Playwright 1.65's Python serializer now refuses
a Locator inside an `arg` (`Attempting to serialize unexpected value at
position "[0]": <Locator …>`). `scroll_settled` takes a selector string,
and two callers passed it a Locator:
`test_executable_revision_keeps_a_reader_who_scrolled_away_from_their_reply`
and the journey `test_refused_reply_retains_its_live_foot[nested-end]`.
Both now pass their scroller's selector, so the wait reads the scroller
they meant to wait on.
- **Compact JSON from `route.fulfill(json=...)`.** The recorded body is
now `{"error":"Release unavailable"}`, without the space `json.dumps`
adds. `test_sample_release_failure_records_the_retired_allocation[json]`
now compares that body to the fulfilled value as parsed JSON. The
behavior it protects, that a failed release records the server's body,
is unchanged. The teardown error in the same test (an unconsumed 503)
followed from the failed assertion, which stopped the test before it
consumed the 503.

The browser test failed in every push run on main from
[42905655276](https://github.com/max-sixty/leaf/actions/runs/42905655276)
(`a369d1f4c`) on. That is the first push run after #5803, and the
journey runs only nightly.

The same journey's `[margin]` case also fails under Playwright 1.65, on
main and on this head alike. This change doesn't touch that case, and it
has a different cause: the shift-watch allowance no longer recognises
the margin card's moved reply field. #5829 tracks it.

Refs #3985 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 11, 2026
… refused reply returns its room (#5831)

The refused-reply journey's `[margin]` case expected the wrong thing to
move. #5770 deliberately made a margin card hold its top through a send.
So when a refused reply's turn is removed, the head row stays put and
the reply box rises into the freed room, 101px here. Before #5770 the
card held its foot, and the whole card's ground moved down 80px. The
test's `carried_by_card` allowance still matched only
`div.lf-box-ground.lf-margin-preview-ground`. The ground no longer
shifts, so Chrome doesn't list it beside the move, and the allowance
refused the reply field's move.

This replaces the ground in the allowance with the reply box
(`div.lf-thread-reply`), so the accepted set doesn't grow. A new
assertion, for the margin case only, checks that the card's close button
in the head row keeps its top. That is the behavior #5770 meant to
protect, and the reply-box prefix alone wouldn't catch it regressing.

The failure isn't Playwright 1.65's doing:

- On current `main` the margin case fails the same way under Playwright
1.64 (Chromium 156) as under 1.65.
- `git bisect run` under 1.64, from `e6756ad43` (pass) to `ce2d27f9b`
(fail), lands on 77ef660 (#5770).
- At `e6756ad43` under 1.65, the test failed only on Chromium 158's
`position-visibility: anchors-visible` deprecation warning, which #5803
fixed.

Verification: all four `test_refused_reply_retains_its_live_foot` cases
pass locally on this branch under Playwright 1.65. The margin case
failed before this change. On the runtime just before #5770, the new
head assertion fails by 80px. Ruff check and format pass.

Closes #5829 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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