Skip to content

test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame: a pointed target's box misses the first returned frame since Playwright 1.65.2 (Chrome 159) #6539

Closed

Description

@leaf-agent

Two cases of tests/browser/test_render_send_placement.py::test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame fail on main, starting with run 44579262848 on b7ac350f1: [document-target] and [code-target]. Its other cases, [pane-selection], [combined-selection] and [content-selection], still pass.

The deciding assertion is the first returned frame's attachment (assert (None is not None) at first_box is not None). On the wheel back, the first compositor frame that shows the passage again has no comment box. The box appears attached one frame later:

[document-target] AssertionError: (-191.0, [(399.6, 208.8), (None, None), (None, None), (None, None), (399.6, None), (399.6, 208.8), ...])
[code-target]     AssertionError: (-16.0, [(235.2, 220.79999999999998), (None, None), (None, None), (None, None), (None, None), (235.2, None), ...])

Each pair reads (passage top, box top) from Chrome's trace screenshots.

Cause: #6530's Playwright bump from 1.65.0 to 1.65.2. It moves the headless shell from build 1254 (Chrome 158.0.8127.18) to 1255 (Chrome for Testing 159.0.8154.6). Between this run and the last one where the test passed (d193863da), every other commit changes only tests. I ran all five cases locally:

Both failing cases are the Alt-click target route, and the selection routes pass. Under the new Chrome, the returning box therefore misses the first visible frame only when it is attached to a pointed target. It is not yet established whether this is a Leaf regression that users on Chrome 159 would see, or a change in what the trace's screenshot frames capture. The failed run's wheel-return-* evidence directories hold the compositor trace, frames and mutation history, and they reproduce locally under .tmp/test-results/.

Cause of a failure tracked in #6418.

Activity

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

    @leaf-agent
    CollaboratorAuthor

    This is a Chromium 159 regression, not a Leaf one. A plain HTML page with no Leaf code shows the same dropped frame: a position: fixed box anchored to a paragraph (position-anchor, position-visibility: always) is missing from the first compositor frame that shows the paragraph again after a wheel away and back. The same page passes on headless shell 1254 (Chrome 158) and fails on 1255 (Chrome 159), in the same trace-screenshot reading the Leaf test uses. Leaf has no fix to make, so whether this test's red ends on our side is a call for @max-sixty, and I've assigned it.

    The issue body needs two corrections:

    • The failure follows the region, not the route. With the parameters swapped locally, document-selection fails the same way and pane-target passes. Today's matrix pairs target with exactly the two failing regions (document and code), which is why it looked like a route effect.
    • The box isn't detached. It is missing from that frame. In the first returning frame of document-target, the field's caret and send arrow are drawn exactly where the next frame draws them, but the box's surface, words and outline aren't. With an unfiltered MutationObserver, nothing in the DOM changes during the return. The box is placed purely by CSS anchoring, so no Leaf script runs in that window.

    Things I tried that don't change the result: hiding the target paint stand, will-change: transform on the box, and a shorter (700 px) or longer (1600 px) wheel.

    Still unknown: whether headed Chrome 159, which users run, drops the frame too. I could only check the headless shell, because full Chromium 1255 won't launch in the CI sandbox.

    Decision needed (none of these is applied):

    1. Keep the test red until Chromium fixes it, and file the reduction below at crbug.com. I can't file there from this account.
    2. Pin Playwright back to 1.65.0 (headless shell 1254) until a fixed Chrome ships. CI goes green, but the next Playwright bump reintroduces the failure.
    3. Mark the two failing cases xfail(strict=True) on headless-shell builds ≥ 1255, linking the upstream bug. They then flip back to failing once Chrome fixes it.
    Reduction (no Leaf code)

    The SUBJECT_MARK and FOLLOWER_MARK colours, compositor_trace, frame_image, marked_tops and scroll_settled are the helpers in tests/browser/render_harness.py.

    <style>
    body { margin:0; font: 16px sans-serif; }
    #t { background: SUBJECT_MARK; anchor-name: --a; margin: 0 20px; }
    #box { position: fixed; position-anchor: --a; position-visibility: always;
      left: anchor(left); bottom: calc(anchor(top) + 16px); width: 400px; height: 80px;
      background: white; outline: 8px solid FOLLOWER_MARK; }
    </style>
    <h1>Plain</h1><div style="height:650px"></div>
    <p id="t">The export keeps each tenant in an archive.</p>
    <div style="height:1800px"></div>
    <div id="box"><textarea>Keep these words</textarea></div>

    Viewport 900×600, with the paragraph scrolled to y≈400. Under a benchmark compositor trace, wheel +1500, settle, then wheel -1500, settle. Each reading is (paragraph top, box top):

    Chrome 159 (1255): [(399.6, 295.2), (None, None), (None, None), (399.6, None), (399.6, 295.2), (399.6, 295.2)]
    Chrome 158 (1254): [(401.2, 296.4), (None, None), (None, None), (401.2, 296.4)]
    

    This holds with and without the textarea focused.

  3. max-sixty commented on Nov 23, 2026

    @max-sixty
    Owner

    Closing without filing a Chromium report. #6571 marks the wheel-return cases a strict xfail on Chrome ≥ 159 (tests/browser/test_render_send_placement.py), so they fail, as an unexpected pass, once Chrome draws the box in the first returned frame again.

    The regression is Chrome's. In a plain-HTML page with no Leaf code, a position: fixed box anchored to a paragraph is missing from the first frame that shows the paragraph again after a wheel return, and appears one frame later. Chromium 159 drops it in 3 of 3 runs, full and headless shell alike, and 157 and 158 in none. With position: absolute in place of fixed, 159 draws the box in every frame. Leaf's comment box, margin cards and previews are fixed and anchored, so each can be missing for that one frame.

    Reduction, for anyone who files it

    Open at 900×600 and scroll so the red paragraph's top is at y≈400. Wheel down 1500 px, let the scroll settle, then wheel up 1500 px, recording a DevTools trace with screenshots (disabled-by-default-devtools.screenshot).

    <!doctype html>
    <style>
    body { margin:0; font: 16px sans-serif; }
    #t { background: #ff0044; anchor-name: --a; margin: 0 20px; }
    #box { position: fixed; position-anchor: --a; position-visibility: always;
      left: anchor(left); bottom: calc(anchor(top) + 16px); width: 400px; height: 80px;
      background: white; outline: 8px solid #00cc44; }
    </style>
    <h1>Plain</h1><div style="height:650px"></div>
    <p id="t">The export keeps each tenant in an archive.</p>
    <div style="height:1800px"></div>
    <div id="box"><textarea>Keep these words</textarea></div>

    Readings, as (paragraph top, box top) per screenshot frame of the return:

    159.0.8154.6  [(399.6, 295.2), (None, None), (399.6, None), (399.6, 295.2)]
    158.0.8127.18 [(401.2, 296.4), (None, None), (401.2, 296.4)]
    157.0.8103.79 [(401.2, 296.4), (None, None), (401.2, 296.4)]
    

    Removing position-visibility, or using anchors-visible, doesn't change the result.

    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

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