Repository navigation
test: credit a margin row's lag when its anchor scrolls again before the row catches up - #6856
Conversation
…the row catches up The shift watch credits a carried row's one-reading lag behind its anchor's scroll (#6763) only where the anchor was read exactly at a compared frame. When a page scrolls twice from two scripts, as the root-tabs journey does with `scrollIntoView` and then `scrollBy(-40)`, the row catches up to the first scroll in the reading that already finds the anchor moved by the second, and that reading falls between the frames the watch compares. The watch then reported the margin marker as moving without input by the first scroll's distance, less the 40px it credited. `laggedTravel` now also lets each end pair the node with the anchor as it stood one reading before the reading that last placed the node. The lag allowed is still one reading. A new `twice` case covers the two-script scroll, and its `row` fault is still reported. Refs #6744
|
The anchor-lag change matches the reported failure, but the new twice-scroll regression leaves the frame between the two
|
…ads the first's paint The `twice` case of test_a_carried_row_keeps_its_anchor_s_lagging_scroll left the frame between its two scrolls to scheduler timing, so it passed on the unfixed watch without load. The failing ordering is a second scroll that lands after the frame carrying the row to the first, and before the watch's layout-shift observer reads that frame's paint. The case now posts the second scroll as a user-blocking task from that frame's callbacks, which runs ahead of the paint's shift delivery. On 39ee727's watch the clean case now fails 24 of 24 (CPU throttle 1 and 6); with this branch's watch it passes 24 of 24, and the 5px fault case is reported every time.
|
The The race was narrower than the gap between the two The page can't hook in ahead of the watch's observer, frame callback or input listeners, since the watch registers each of them first. A delivery observer the page holds (a
The 5px fault control |
The shift watch reported the root-tabs journey's margin marker as moving without input when the page scrolled twice in a row. The marker's carrier is anchored to the document, and Chrome moves an anchored box a frame after its anchor scrolls, which #6763 taught the watch to credit. That credit only applied when the anchor was read exactly at one of the frames the watch compares.
test_root_tabs_switch_views_without_moving_the_strip_and_follow_historycallsscrollIntoViewand thenscrollBy(-40)from two scripts. The marker caught up to the first scroll in the reading that already found the document moved by the second, and that reading fell between the compared frames. So the watch credited only the 582px the document had settled at, against the marker's 622px, and reported the marker as moving without input. The marker's painted position never jumped.laggedTravelnow also lets each end of a comparison pair the node with the anchor as it stood one reading before the reading that last placed the node, as well as one reading before the compared frame. The lag it allows is still one reading, which #6763's description gives the reason for.Verification, on Linux under
leaf-dev suite flake --workers 4 --load 2:main(39ee727dd)test_tabs.py::test_root_tabs_switch_views_without_moving_the_strip_and_follow_historytest_a_carried_row_keeps_its_anchor_s_lagging_scroll[twice-]…[twice-row], a row placed 5px offThe 117 shift-watch cases matching
anchor or scroll or carried or carrypass, and thelagging_scrollcases pass at CPU throttle 1, 4 and 8. Thetwicecase orders its second scroll explicitly: it posts the scroll as auser-blockingtask from the frame that carries the row to the first scroll. That task runs ahead of the delivery of the frame's painted shifts, so the watch's reading of that paint finds the words moved by both scrolls and the row caught up only to the first. That is the ordering the journey hits only under load.#6744's other margin-marker teardown failures aren't this cause.
test_render_application_boundary[Feed]reproduces onmain(1 of 24 on Linux), but its finding carries no scroll term at all. The trace journey's finding names a different anchor (animg) and didn't reproduce locally. Both stay open on the issue.Part of #6744 — automated triage