Repository navigation
Hold arriving initial widgets without document.write, and print console warnings from probe - #3405
Merged
Merged
Conversation
The probe printed only console errors and exceptions, so `probe --firefox` showed none of the warnings Firefox raises on a Leaf page: the reparse after the initial-render `document.write` and the forced layout in a sample child. Its reading now names the field `console` and carries warnings beside errors, as the suite's browser fixtures already collect. The startup observer asked Firefox and WebKit for layout-shift entries, which they lack, and each frame warned; it now asks only where the entry type is supported. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Delivery opened a <template> around each widget drawn before first paint with document.write, so the parser held its source inert until the script after its end tag drew it. Firefox reparses the rest of the document after any unbalanced write and warns of it on every such page. The host now arrives marked `data-lf-arriving`, which the theme hides while the runtime will run (`html[data-lf-interactive]`), and the script after its end tag takes the mark off and draws it in the same task. With scripts off, or in a DOMParser reading, the mark hides nothing, as the unopened template did. The streamed-delivery test now also runs in Firefox, whose collector rejects the reparse warning; it fails on the previous delivery. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Chrome's corpus sweep holds every page's console to no warning or error, but Firefox reports what Chrome never says: a reparse after an unbalanced document.write, layout forced before the page loaded, a response blocked as opaque. Each corpus page now also opens in Firefox with its live samples loaded, and the Firefox fixture rejects any message. The three pages with live samples fail for now: each sample's document forces layout before Firefox has started it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 21, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new Firefox corpus test fails on pages this PR includes. I ran leaf-dev probe feature-gallery --firefox --js "1" on this head; it recorded five “Layout was forced before the page was fully loaded” warnings from live sample documents. firefox_browser passes those console warnings to clean_browser, so test_page_fixture_opens_without_firefox_console_warnings will fail for this page in the scheduled journeys tier. The PR description reports the same warning for two other gallery pages. Please resolve the sample layout warning before adding an empty-console requirement for the whole corpus, so the new check can pass when it runs.
The sweep's three pages with live samples fail on Firefox's "Layout was forced" warning from each fresh sample document, and feature-gallery also never reaches readiness there in CI. The check returns with the fix for those, rather than landing red. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 21, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 21, 2026
The Firefox sweep (`test_page_fixture_opens_without_firefox_console_warnings`) opens each corpus page, loads its live samples, and fails on any console warning, as the Chrome render gate does. #3405 held it back because two things kept it red. **Firefox warns "Layout was forced before the page was fully loaded" from sample frames.** In its rendering update, a document with a ResizeObserver flushes layout in every in-process document of the tab (`FlushLayoutForWholeBrowsingContextTree` in `Document.cpp`), including a sample frame still parsing its head. That frame's content sink then starts layout early and reports it. A page with a ResizeObserver and an iframe whose head arrives slowly, with no Leaf code, warns 3 of 3 times; without the observer, 0 of 3. Inlining the sample's stylesheet doesn't help, since the flush lands before the frame has parsed any. No page can prevent it, so `console_finding` drops Firefox's own form of that warning when its location is a frame's document, a sample (served under `/api/samples/<id>/`) or an HTML preview's `about:srcdoc` frame, and keeps it from the page itself. Firefox files the warning under the script that forced layout where one did, so the location is matched by path rather than compared with the top-level URL. The cost: a sample's own script reading layout too early would also go unreported. **The feature gallery never finished arriving in Playwright's Firefox.** Playwright's Firefox leaves about half the sample frames without the suite's init scripts. The input watch wrapped each port message in an envelope, which such a child could not read, so its host's calls went unanswered and the page stalled at `arrived` for 240 s. The source now rides as one extra field on Leaf's plain-object port messages, which an unwatched peer reads past. The shift-watch fixture that sent strings now sends objects, as Leaf does. **The Firefox run of the feature gallery then hung in CI after its test body passed.** Under concurrency, Playwright's Firefox loses up to 9 of the page's 18 frames, reporting them at `about:blank` or an earlier URL. The watch judgement's `evaluate` in such a frame never returns, so the test hung for 30 minutes and the job for 4 more hours. `judge_watches` now leaves a Firefox child frame unjudged when it answers no bounded probe within 2 s; that frame never ran the watches' init scripts. Chrome still judges every frame. The sweep's wait for each sample is bounded too, and names a sample that never gets ready. Six concurrent copies of the feature-gallery case now pass locally in about 30 s each; before this, all six hung. Checked locally: the three pages that failed (`feature-gallery`, `thread-panel-gallery`, `diff-thread-gallery`) pass, the other 32 passed before, and the shift-watch and words-watch port tests pass. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Firefox printed warnings on Leaf pages that Chrome never shows, and nothing in the suite or
leaf-dev probesurfaced them. This removes the main one and makes the probe report them.Initial-render delivery no longer uses
document.write. A widget drawn before first paint (x-initial: playgrounds, contents, activity) was wrapped in a<template>opened bydocument.write, so its source stayed inert until the script after its end tag drew it. Firefox reparses the rest of the document after an unbalanced write and warns on every such page. The host now arrives markeddata-lf-arriving, which the theme hides only while the runtime will run (html[data-lf-interactive]); the script after its end tag removes the mark and draws it in the same task. With scripts off, or in a DOMParser reading, the mark hides nothing, as the unopened template did. The streamed-delivery test now also runs in Firefox, where it fails on the previous delivery. Requests before presentation are unchanged (62); the page grows by the 255-byte theme rule.leaf-dev probeprints console warnings beside errors, under aconsolefield, and its startup observer no longer asks Firefox and WebKit for layout-shift entries they lack.A Firefox sweep of the corpus with an empty-console requirement is held back: on the three pages with live samples, each fresh sample's document forces layout before Firefox has started it ("Layout was forced before the page was fully loaded"), and
feature-gallerynever reached readiness in Firefox in CI. It lands with the fix for those.