Repository navigation
fix: keep the browser's scroll into a details it opens when the main thread is busy - #6726
Merged
Merged
Conversation
…he browser's scroll into it Find-in-page opens a closed <details> onto its match and scrolls the match into view. scrolling.js marked that opening as the browser's travel from the `toggle` event, which comes in a task of its own. On a busy main thread the rendering update that ends the travel's scroll sequence ran before that task, so the end read as layout's, and continuity's shift restore put the box back where the reader had left it. The opening is now read from a MutationObserver record on the `open` attribute, which arrives before the next rendering update. test_trace_tree_opened_by_the_browser_keeps_its_match failed on every run under --cpu-throttle 16 (and on macOS nightlies) and passes 3 of 3 with the change. Refs #6303
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.
Find-in-page opens a closed
<details>onto its match and scrolls the match into view.scrolling.jsmarked that opening as the browser's own travel from thetoggleevent, which arrives in a task of its own. On a busy main thread the rendering update that ends the travel's scroll sequence runs before that task: instrumented under--cpu-throttle 16, the tree'sscrollendcame at 229 ms andtoggleat 613 ms. The end then read as layout's, and continuity's shift restore (version.jsrestoreShifted→reading-place.jsrestorePlace) scrolled the tree back to where the reader had left it, losing the match. The opening is now read from aMutationObserverrecord on theopenattribute, which is delivered before the next rendering update. The scope (document light DOM,<details>only), the click exclusion for a summary the reader activated, and the two-frame window are unchanged.test_trace_tree_opened_by_the_browser_keeps_its_match, one of the macOS-only nightly failures in #6303, failed on every run under--cpu-throttle 16on main and on the Nov 15 base, and passes 3 of 3 with this change. Unthrottled, the trace, reading-place, changes-in-place, contents and go-to tests that touch disclosures pass (84 passed), as doespnpm run test:runtime.#6303 keeps two other cases: the settlement
Homecase and the Firefox send flash. Both passed in the Nov 21 nightly and are not touched here.Refs #6303 — automated triage