Repository navigation
End a sample's asked hold once the reader looks away from its frame - #6808
Merged
Merged
Conversation
A live sample the reader sees as it starts holds what showed it until the frame fits its page: the containing page's presentation, for a frame seen as it mounts, or the landing of the jump that brought it into view, which the page counts as an arrival and a rendering hold. In Chromium a sample's page gets no rendering while its frame is off screen, so a child holding a chart never upgrades there, and a reader who scrolled past the frame while it loaded held the page until they scrolled back. Measured on main, 23 s after the child's registry loaded: a page whose first screen held a chart sample never presented (readiness stuck at "upgraded"), and one reached by a jump kept an arrival outstanding and its rendering unsettled. The hold now also ends once the frame's growth would move nothing the reader sees (`whenNone` over `growthIsSeen`); the host keeps counting the child's arrival by its own rules (sample.js). `whenNone` is exported from widget-api.js and documented beside `heldGrowth`, which can't end this hold since it applies at once before the page presents. Two cases stay as they were or change slightly: - A frame clipped sideways, as by a horizontal scroller, still counts as seen (`growthIsSeen` reads only the vertical band), so its hold still waits in Chromium, as on main. - A reader who jumps to a sample, away and back before its page loads no longer has the second jump own the fit; re-deciding ownership on return needed a watch per near-reading, Reset and disconnect, and a review found four defects in that version. The new journey test keeps both children's registries held while it checks that the page presents and settles; it fails on main (no presentation within 120 s) and passes in Chromium and Firefox.
leaf-agent
approved these changes
Nov 23, 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.
A live sample the reader sees as it starts holds what showed it until its frame fits the sample's page: the containing page's presentation, for a frame seen as it mounts, or the landing of the jump that brought it into view. In Chromium a sample's page gets no rendering while its frame is off screen, so a child holding a chart never upgrades there, and a reader who scrolled past the frame while it loaded held the page until they scrolled back. On main, a page whose first screen held a chart sample never presented (readiness stuck at "upgraded" 23 s after the child loaded), so its keys stayed dead; one reached by a jump kept an arrival outstanding and its rendering unsettled.
The hold now also ends once the frame's growth would move nothing the reader sees (
whenNoneovergrowthIsSeen); the host keeps counting the child's arrival by its own rules (sample.js, #6783).To weigh:
whenNone, whichheldGrowthalready uses inside the runtime, joins the package API, documented besideheldGrowth.heldGrowthcan't end this hold, since before the page presents it applies at once.growthIsSeenreads only the vertical band), so its hold still waits in Chromium, as on main.Found by Codex reviewing #6783, as an existing defect; Codex reviewed this fix in two rounds.
Tests: a new journey test holds both children's registries while it checks that the page presents and settles; it fails on main (no presentation within 120 s) and passes in Chromium and Firefox. The sample hosting, shift-watch jump and live-sample tests,
pnpm run test:runtimeandpnpm run check:browserpass.