You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_would: the margin preview's Resolve goes inert under the click since #6557 #6591
tests/browser/margin/test_pins.py::test_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_would started failing intermittently with #6557. It fails at resolve.click(), the first press after a comment is sent from a selection. The margin preview's Resolve is visible and stable, but the first click attempt lands on <article id="document">. The preview then becomes inert and stays invisible until the 120 s timeout:
- performing click action
- <article id="document">…</article> from <body …> subtree intercepts pointer events
- retrying click action
- element is inert
…
231 × retrying click action
- element is not visible
It first failed in run 44676418666 on 9b143828e. The test passed in the previous run, 44666096308 on 9114f0fdf.
Bisection
uv run leaf-dev suite flake <node id> --cpu-throttle 8, 18 copies per run, Chrome 159 shell:
Every failing copy shows the same call log as CI: the click is intercepted by the article, and then the preview is no longer visible. The rate is low, so the 0 / 54 before #6557 makes it the likely cause but doesn't prove it.
Where to look
The test involves no to-do, so #6557's new press in a promise's head isn't drawn here. The change that reaches every page is in fitOpened in browser/runtime/floating-panel.js. It used to clear fitting on every call. It now returns with fitting still set when the view is shown, the trail ends at the queue and opening.room is null. That keeps the fit pending across later passes, which may be what moves or covers the margin preview under the pointer. This is a lead from reading the diff, not a verified mechanism. The next experiment is to restore the unconditional fitting = false on head and rerun the flake command above.
The fitOpened lead is ruled out. The test has two failure modes, and #6594 fixes the more frequent one. This issue stays open for the second, which is a runtime bug.
All runs used uv run leaf-dev suite flake <node> --cpu-throttle 8 on this runner. Main failed 7/18, and restoring the unconditional fitting = false in fitOpened still failed 4/18.
1. Playwright's scroll (test-side, fixed by #6594).resolve.click() makes Chromium scroll the document about 444 px, although Resolve is already in view (y 844–872 of 900). The anchored card follows a frame or two later, so the click lands on the page's heading or article. That press dismisses the card, which produces the reported call log: intercepts, then inert, then not visible. A per-frame log around the click shows each step. #6594 presses through the existing press_visible helper instead. With it, 3/18 copies still fail, all from the second mode below.
2. The sent card stands below the window (runtime, open). In about 1 in 8 copies, Send captures the comment box's frame 297 px below where the box paints. The frame is read with getBoundingClientRect() in floating-response.js: the bar reads 1128 instead of 831. Its inline style, scrollY (537) and running animations (none) match a good copy exactly. The card adopts that offset in comment-placement.js (initialHold). It is placed with bottom: calc(-281px + anchor(top, …)) instead of calc(16px + …), so the card stands wholly below the window (Resolve at y 1141). It stays there through later passes until a scroll re-places it.
297 px is the window's scrollY before the test's scrollBy(240), which suggests Chromium's anchor scroll compensation for the fixed, anchored box is stale when Send reads it. That is unconfirmed. Adding a rendered() or a heavy probe before Send hid the bad reading in every copy, so it depends on timing.
The next experiment: log the field's rect on each frame from the box's opening to Send, next to scrollY. That shows whether the misread comes from one stale read or persists between frames. Then decide whether the frame should come from the placement's own landed position (landed) rather than a live client rect.
The 0/54 before #6557 doesn't place this mechanism in #6557's diff. Neither mode touches the to-do press or fitOpened.
The second failure mode has a confirmed cause, and it still occurs on current main (bd99da0ee): 2/18 copies failed with --cpu-throttle 8, both with Resolve at viewport ratio 0. I haven't opened a fix yet. The decision that remains is which scroll-invariant reading the sent card's origin should come from.
Cause. In Chrome, a box placed with position-anchor keeps reporting its old client rect for up to two frames after the page scrolls. Here is a minimal page on Chrome 159 (8154.6): a fixed box at top: anchor(top) sits at y 1200, then scrollTo(0, 300) runs. The anchor reads 900 at once. The box reads 1200 in the same task and still 1200 in the next requestAnimationFrame. It reads 900 only one frame after that. This matches anchor positioning's scroll compensation, which takes its scroll offset at a later update rather than on each scroll. I checked Chrome's behavior, not the spec text.
In the test, locator.focus() on the field, which opened at y 1174, scrolls the window from 240 to 537. Logging the bar on every frame shows this:
Good copy: after the scroll, the bar reads 1128 for about 500 ms of throttled frames, then 831. Send comes after that and reads 831.
Bad copy: no frame is drawn between the scroll and Send. fabFrameAt reads bar 1128 and field 1173 with scrollY 537. That is the 297 px offset the card then adopts in initialHold.
The bar's inline style was identical in both copies, and no animations were running. So the misread is a single stale read, not a placement that differs.
What a fix has to address. Every client rect fabFrameAt returns can be stale right after a scroll: box, and field, which feeds the card's grow motion. The field's offset from the bar stays correct, because both rects lag by the same amount (45 px in both copies). So one approach is to express the frame against the attachment line from the bar's own placement. landed already keeps held in pixels from that line, which no scroll changes. The frame would then add the field's offset within the bar. Two things are open:
held ignores the shift that holds the box against the window's edge. When that shift is in force, the box doesn't move with the page, so a frame built from held would be wrong in that posture.
carry.dropped adopts a client-pixel box through the same adopt path.
Which reading to use is the open question, and I'd rather settle it with a test than guess. The next step is a runtime test that scrolls and sends in the same task with no frame between them, and asserts that the card opens where the box painted. It should fail on main, and it would make this independent of CPU throttling.
#6725 fixes the second failure mode. Send now reads the comment box's frame from where the box's placement stands it, measured against the anchor's current box. Before, it used the box's own client rectangle, which Chrome leaves at its pre-scroll position for up to two frames after a scroll. The PR's new send-placement test scrolls in the same keydown that sends, so the bug reproduces without CPU throttling. That test fails on main every time and passes with the change. With --cpu-throttle 8, the seats test failed 3 of 18 copies on main (fac415460), all with Resolve at viewport ratio 0, and passed 36 of 36 with the fix. Review, CI and landing proceed on the PR, which closes this issue when it merges.
@max-sixty, I'm reopening this because #6735 reverts #6725, the fix for this issue's second failure mode: a comment sent in the same task as a page scroll opens its card offset by the scroll.
What #6725 did. It added floatingPlacement.lag(), the box's client rectangle minus where its last placement stands it, measured from the anchor's box read now. fabFrameAt subtracts that lag, so Send reads where the box paints rather than Chrome's rectangle from before the scroll.
What it broke.fabFrameAt is also called during placeFab's attachment handoff. When saved state moves the open box from its quoted words to their subject, the anchor moves because its content changed, and lag() counts that move as lag. In test_saved_widget_words_cannot_dismiss_an_unfinished_comment the box jumps 247 px while the user is writing (3 of 6 cases, red on main in run 44999105534).
What the revert gives up.#6725's regression test test_a_send_in_the_task_that_scrolls_the_page_opens_the_card_where_the_box_stood is removed. test_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_would goes back to its throttled flake rate (3 of 18 copies at --cpu-throttle 8, per #6725).
What your answer should settle. How the fix should come back. The box's rectangle can't tell a scroll that hasn't been drawn yet from an anchor that moved for another reason. Two options:
Measure the scroll that happened since the box last painted, which needs tracking per frame.
Apply the correction only at Send and leave the handoff uncorrected.
The second keeps both tests green, but it repeats the rule in the caller instead of fixing fabFrameAt.
Activity
leaf-agent commentedon Nov 20, 2026
The
fitOpenedlead is ruled out. The test has two failure modes, and #6594 fixes the more frequent one. This issue stays open for the second, which is a runtime bug.All runs used
uv run leaf-dev suite flake <node> --cpu-throttle 8on this runner. Main failed 7/18, and restoring the unconditionalfitting = falseinfitOpenedstill failed 4/18.1. Playwright's scroll (test-side, fixed by #6594).
resolve.click()makes Chromium scroll the document about 444 px, although Resolve is already in view (y 844–872 of 900). The anchored card follows a frame or two later, so the click lands on the page's heading or article. That press dismisses the card, which produces the reported call log: intercepts, then inert, then not visible. A per-frame log around the click shows each step. #6594 presses through the existingpress_visiblehelper instead. With it, 3/18 copies still fail, all from the second mode below.2. The sent card stands below the window (runtime, open). In about 1 in 8 copies, Send captures the comment box's frame 297 px below where the box paints. The frame is read with
getBoundingClientRect()infloating-response.js: the bar reads 1128 instead of 831. Its inline style,scrollY(537) and running animations (none) match a good copy exactly. The card adopts that offset incomment-placement.js(initialHold). It is placed withbottom: calc(-281px + anchor(top, …))instead ofcalc(16px + …), so the card stands wholly below the window (Resolve at y 1141). It stays there through later passes until a scroll re-places it.297 px is the window's
scrollYbefore the test'sscrollBy(240), which suggests Chromium's anchor scroll compensation for the fixed, anchored box is stale when Send reads it. That is unconfirmed. Adding arendered()or a heavy probe before Send hid the bad reading in every copy, so it depends on timing.The next experiment: log the field's rect on each frame from the box's opening to Send, next to
scrollY. That shows whether the misread comes from one stale read or persists between frames. Then decide whether the frame should come from the placement's own landed position (landed) rather than a live client rect.The 0/54 before #6557 doesn't place this mechanism in #6557's diff. Neither mode touches the to-do press or
fitOpened.Press the sent thread card's Resolve in place in the margin seats test (
leaf-agent commentedon Nov 21, 2026
The second failure mode has a confirmed cause, and it still occurs on current main (
bd99da0ee): 2/18 copies failed with--cpu-throttle 8, both with Resolve at viewport ratio 0. I haven't opened a fix yet. The decision that remains is which scroll-invariant reading the sent card's origin should come from.Cause. In Chrome, a box placed with
position-anchorkeeps reporting its old client rect for up to two frames after the page scrolls. Here is a minimal page on Chrome 159 (8154.6): a fixed box attop: anchor(top)sits at y 1200, thenscrollTo(0, 300)runs. The anchor reads 900 at once. The box reads 1200 in the same task and still 1200 in the nextrequestAnimationFrame. It reads 900 only one frame after that. This matches anchor positioning's scroll compensation, which takes its scroll offset at a later update rather than on each scroll. I checked Chrome's behavior, not the spec text.In the test,
locator.focus()on the field, which opened at y 1174, scrolls the window from 240 to 537. Logging the bar on every frame shows this:fabFrameAtreads bar 1128 and field 1173 withscrollY537. That is the 297 px offset the card then adopts ininitialHold.The bar's inline style was identical in both copies, and no animations were running. So the misread is a single stale read, not a placement that differs.
What a fix has to address. Every client rect
fabFrameAtreturns can be stale right after a scroll:box, andfield, which feeds the card's grow motion. The field's offset from the bar stays correct, because both rects lag by the same amount (45 px in both copies). So one approach is to express the frame against the attachment line from the bar's own placement.landedalready keepsheldin pixels from that line, which no scroll changes. The frame would then add the field's offset within the bar. Two things are open:heldignores the shift that holds the box against the window's edge. When that shift is in force, the box doesn't move with the page, so a frame built fromheldwould be wrong in that posture.carry.droppedadopts a client-pixel box through the sameadoptpath.Which reading to use is the open question, and I'd rather settle it with a test than guess. The next step is a runtime test that scrolls and sends in the same task with no frame between them, and asserts that the card opens where the box painted. It should fail on main, and it would make this independent of CPU throttling.
leaf-agent commentedon Nov 22, 2026
#6725 fixes the second failure mode. Send now reads the comment box's frame from where the box's placement stands it, measured against the anchor's current box. Before, it used the box's own client rectangle, which Chrome leaves at its pre-scroll position for up to two frames after a scroll. The PR's new send-placement test scrolls in the same keydown that sends, so the bug reproduces without CPU throttling. That test fails on main every time and passes with the change. With
--cpu-throttle 8, the seats test failed 3 of 18 copies on main (fac415460), all with Resolve at viewport ratio 0, and passed 36 of 36 with the fix. Review, CI and landing proceed on the PR, which closes this issue when it merges.leaf-agent commentedon Nov 22, 2026
@max-sixty, I'm reopening this because #6735 reverts #6725, the fix for this issue's second failure mode: a comment sent in the same task as a page scroll opens its card offset by the scroll.
What #6725 did. It added
floatingPlacement.lag(), the box's client rectangle minus where its last placement stands it, measured from the anchor's box read now.fabFrameAtsubtracts that lag, so Send reads where the box paints rather than Chrome's rectangle from before the scroll.What it broke.
fabFrameAtis also called duringplaceFab's attachment handoff. When saved state moves the open box from its quoted words to their subject, the anchor moves because its content changed, andlag()counts that move as lag. Intest_saved_widget_words_cannot_dismiss_an_unfinished_commentthe box jumps 247 px while the user is writing (3 of 6 cases, red on main in run 44999105534).What the revert gives up. #6725's regression test
test_a_send_in_the_task_that_scrolls_the_page_opens_the_card_where_the_box_stoodis removed.test_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_wouldgoes back to its throttled flake rate (3 of 18 copies at--cpu-throttle 8, per #6725).What your answer should settle. How the fix should come back. The box's rectangle can't tell a scroll that hasn't been drawn yet from an anchor that moved for another reason. Two options:
The second keeps both tests green, but it repeats the rule in the caller instead of fixing
fabFrameAt.