Repository navigation
test: check the thread walk's page jump in the press's task, not its first frame - #5518
Merged
Merged
Conversation
…first frame #5285 moved landings onto Leaf's own 140 ms glide. Its ease-out covers about a third of the trip in its first frame, and here the frame after `t` arrives late enough that the first page scroll event already reads ~1100 of 1224 px, so the test's `firstPage < 100` threshold, which assumed the browser's slow smooth-scroll start, no longer told a jump from a glide. The jump the test guards against, `scrollIntoView` moving the document to its nearest edge before the centred landing, happens in the press's own task. The test now reads the page, rail and local scroller at the end of the keydown dispatch: the nested scrollers have moved and the page has not. It then checks the page's scroll positions only ever increase on the way to the centre, one trip. Reintroducing the nearest-edge reveal on the page fails the new check with the page at 830 px in the press's task. Closes #5476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_a_thread_walk_starts_one_page_trip_and_reveals_its_nested_passagehas failed on main since #5285 because its threshold was built for the browser's smooth scroll, and #5285 replaced that on purpose. The test now checks the regression it was written for, a page jump in the press's own task, instead of how far the first animation frame goes.Cause. #5285 moved every landing onto Leaf's own glide: 140 ms of cubic ease-out (
glideToinbrowser/runtime/scrolling.js). Even when its first frame comes on time, that covers about a third of the trip, roughly 390 of the 1224 px here. Native smooth scroll started slowly, sofirstPage < 100used to tell a jump from a smooth start, but against the glide it can't. On this runner the frame aftertcame 70–90 ms after the press, so the first pagescrollevent already read 1025–1146 px, and the frames after it eased monotonically to 1224.Change. The old bug was
scrollIntoViewmoving the document to its nearest edge before the centred landing, and that move happens in the press's task. Akeydowncapture listener registered after the runtime's reads the page, the rail and the local scroller once the walk has handledt. At that point the nested scrollers have moved and the page has not. Once the passage is centred, the test also checks that the page's scroll positions only ever increase, so the page makes one trip. The interface and #5285's intent are unchanged; only the test moved.Verification. On current main the test fails as reported (
firstPage: 1025). With this change it passes three runs in a row. Reintroducing the nearest-edge reveal on the page (droppingif (box === targetScroller) inside = false;ininnerMoves) makes the new check fail withpage: 830.Not changed here: the glide's clock and a late first frame
glideTostarts its clock at the press. When the press's work holds the next frame back, as it did here by 70–90 ms, most of the ease runs out before anything is drawn, and the first frame that moves the page shows it about 90% of the way there. The first tick's rAF timestamp also came before the press (about 2845 ms against 3011 ms), so it was clamped to t = 0 and wrote no movement. Starting the clock at the first frame would change how long every landing and reading key takes, which is a product decision for #5285's line of work and not part of this test repair. Whether that delay also happens on a desktop, rather than this headless runner, hasn't been measured.Closes #5476 — automated triage