Repository navigation
test: wait for Firefox's caret scroll before scrolling a focused field away - #5767
Merged
Merged
Conversation
…d away Firefox scrolls a text field it focuses to its caret after `focus()` returns. The pointer-column Tab test focused an input and scrolled the columns into view at once, so that late caret scroll took the page back to the field (scrollY 80, not 2400). The pointer then moved to coordinates below the window, recorded no position, and Tab went on from the left column. Both tests that focus a field and then scroll it away now wait for the page to render first. No product behavior changes. Closes #5742 Closes #5729
This was referenced Nov 9, 2026
This was referenced Nov 10, 2026
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.
Firefox scrolls a text field it focuses to its caret after
focus()returns.test_tab_at_a_control_scrolled_away_goes_on_in_the_column_the_pointer_is_in[firefox_browser-input]focused its input and scrolled to the columns straight away, so the late caret scroll put the page back at the field. On a failing runscrollYwas 80 instead of 2400 when Tab was pressed. The test then moved the mouse to the right column's coordinates, which by then were below the window. Nopointermovearrived,recentPlaceInput()stayedfocusandpointerAt()stayed at-1, so Tab went on to#left-next. The runtime made no scroll call in between: a probe onscrollTo,scrollIntoView,scrollTop, selection and focus methods saw only the test's ownscrollTo. The button variant and Chromium pass because neither moves to a caret on focus.Both tests that focus a field and then scroll away now call
rendered(page)between the two, so the caret scroll lands before the test's own scroll.test_a_key_at_a_control_scrolled_away_acts_from_what_the_user_readshad the same pattern with its textarea. There the race was hidden, because#nextfollows the textarea in tab order either way, but its setup didn't really leave the field out of sight. The change touches only tests and moves no product behavior.Verified locally on Linux. Before the change, the Firefox input case failed 3 of 3 runs, matching the issue's 3 of 4 and 3 of 3. After it, the case passed 6 of 6, and all six parametrizations of the two edited tests pass.
Closes #5742 — automated triage
Closes #5729 — automated triage