Repository navigation
Count a disclosure opened without its summary's click as travel to a match - #5414
Merged
Merged
Conversation
…match Find-in-page opens a closed <details> onto its match without firing beforematch, and its toggle follows in a later task, so a scroll to the match in the same frame read as layout's and continuity returned the trace's Saved elements tree to the reader's old place. A disclosure that opens without a click on its summary now marks the same travel beforematch does, for its own box and those inside it, which leaves carry.js's reopening across a revision to layout. Behavior changed: a scroll ending in such a disclosure within two frames of its opening is the reader's choice, so test_trace_tree_opened_by_the_ browser_keeps_its_match keeps the found row shown. Closes #4747
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.
When something other than the reader's click opens a closed
<details>and scrolls to a match inside it, Leaf now counts that scroll as the reader's choice. Find-in-page does this. Before, continuity read the scroll as a layout move and put the trace's Saved elements tree back where the reader had left it, so the found row ended up out of view.test_trace_tree_opened_by_the_browser_keeps_its_matchfailed on every run. On currentmainit fails with the row at 480–535px, outside the 12–111px band where the tree shows rows. With this change it passes.Cause.
scrolling.jstreats a single scroll jump as layout's when the box's extent changed while it moved. It makes one exception: travel into hidden content. Find-in-page signals that travel withbeforematch, but only forhidden="until-found"folds. When find opens a<details>(the HTML ancestor-revealing algorithm), nobeforematchfires. Itstoggleevent arrives in a later task. So opening the trace tree and scrolling to the row in the same frame looked like a layout move. #4761 fixed the Moment landing by marking Leaf's own instant landings. This is the browser-driven half that #4761 left open.Change. A disclosure that opens without a click on its summary now marks the same travel that
beforematchmarks, and for the same two frames. A reader opening it themselves clicks the summary first, and the click is dispatched before the toggle. The mark covers only the opened disclosure and the boxes inside it. Leaf opens disclosures itself too:carry.jscarries one open across a revision while layout moves the page around it, and the page's own scroll should still count as layout's there. Thescrolling.jsheader states the rule.Test basis. As max-sixty decided in #4747, the repair is checked against the test's scripted find: the test opens the disclosure, then calls native
scrollIntoView. It has not been checked against the browser's real find bar, which headless Chromium doesn't have.Verification.
tests/browser/test_render_playwright_trace.py: both tree tests pass, including checkpoint reopening, which confirms that a summary click still restores the reader's place.tests/journeys/…::test_trace_moment_lands_its_saved_element_over_the_trees_reading: both motion cases pass.pnpm run test:runtime(812 tests) andpnpm run checkpass.The browser-startup path gains two document-level capture listeners and no requests.
Closes #4747