Repository navigation
test: set the Tab preview stand-in before the runtime reads focus - #6190
Merged
Merged
Conversation
The walk-landing journey gives every focused element a stand-in preview from a focusin listener on the document. focus.js registered its own document focusin capture listener first, and preview.js reads the element in a microtask between the two, so the Add reaction button Tab reaches previewed its own name. The test passed only because a later redraw re-read the preview: the head's relative age ticked over within the expect's timeout. Since #6097 the head says a clock time, which doesn't redraw within the minute, so the expectation timed out. The stand-in now installs on the window's capture, which runs before any document listener. No behavior changed; the landing assertions now see the stand-in too. Closes #6179
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_walk_s_landing_previews_nothing_and_tab_reads_itgives every element focus reaches a stand-in preview ("Placed here") from afocusinlistener ondocument. The runtime's owndocumentfocusincapture listener (focus.js, registered at module load) runs first.preview.jsreads the focused element in a microtask between the two listeners, so the Add reaction button that Tab reaches previewed its own name. The Tab stop is the same before and after #6097. The test used to pass only because a later redraw re-read the standing preview once the head's relative age ticked over, about 40 s into the 120 sexpect. Since #6097 the head shows a clock time, which doesn't redraw within the minute, so the expectation timed out.The stand-in now installs on
window's capture, which runs before anydocumentlistener, so the runtime reads it the moment focus arrives. The test's intent is unchanged. Its landing assertions are now stronger, since the stand-in is already in place whenmlands, so a landing preview would actually show.Verified locally with
--run-nightly:f1b367375withActual value: Add reaction, matching the report.017407524) it took about 48 s, waiting for the age tick.Closes #6179 — automated triage