Skip to content

test: wait for Firefox's caret scroll before scrolling a focused field away - #5767

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5742
Nov 9, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5742

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

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 run scrollY was 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. No pointermove arrived, recentPlaceInput() stayed focus and pointerAt() stayed at -1, so Tab went on to #left-next. The runtime made no scroll call in between: a probe on scrollTo, scrollIntoView, scrollTop, selection and focus methods saw only the test's own scrollTo. 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_reads had the same pattern with its textarea. There the race was hidden, because #next follows 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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant