Repository navigation
Blitz patch 15: the layout tree's debug check looks only at the layout tree - #11
Merged
Merged
Conversation
…t tree Main's V8 job failed in list::in_a_narrow_window_the_pane_takes_the_lists_place: "layout child NodeId(749v1) of NodeId(743v1) is not in the slab", from upstream's assert_layout_parents_consistent (debug builds only). Below a display: none box resolve_layout_children never walks, because the box has no layout children. The lists down there keep what they held when the box was hidden. In a narrow window the Tracker's list column hides behind the detail pane, the rows' labels change, and V8 collects the old ones: their ids stay in lists that nothing lays out, paints or hit-tests, and that are rebuilt when the box shows again. Upstream's check looked at every node in the document; it now walks the tree that is kept, from the root. QuickJS did not collect the labels during the test, so only V8 failed. The new ops test reproduces it without a JS engine, and checks that the box's contents are laid out anew once it shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Main's CI (run 45850244628, on 578cafc) failed on V8 in
list::in_a_narrow_window_the_pane_takes_the_lists_place. Locally it failed 4 runs in 4:Cause
The panic comes from
assert_layout_parents_consistent, an upstream Blitz check that only runs in debug builds. Upstream main has the same code.display: nonewhile the detail pane is open (Clicks clipped by boxes that clip; the Tracker in narrow windows #8).display: nonebox (DisplayInside::None => {}), soresolve_layout_childrennever walks below it. Every list down there keeps what it held when the column was hidden.<span>gets new children. V8 collects the old ones, and their ids stay in lists that nothing lays out, paints or hit-tests. The column's ownlayout_childrenare[].I traced it with a diagnostic that I have since removed: 248 stale ids while the pane was open, 93 while it closed, and 0 once the column showed again. Showing it again rebuilds the subtree, so nothing was drawn wrong.
Fix
Patch 15 (
crates/blitz-dom/src/resolve.rs, markedsepal patch, entry 15 inPATCH.md): the check now walks the tree thatresolve_layout_childrenmaintains, starting from the root. It checks the same two things on every node it can reach. It has no effect on release builds.The new test
ops::tests::a_node_freed_below_a_hidden_box_is_not_a_layout_childreproduces the panic from ops alone, with no JS engine and no GC: a laid-out box is hidden, its child is removed and dropped, and a new child is added. It also checks that the new child is laid out once the box shows again.Checked
pnpm testpasses.cargo test --features "screenshot engine-v8": 141 passed, 0 failed.Not fixed
Blitz's text-selection walkers (
traversal.rs) indexself.nodes[child]straight fromlayout_children. If a selection's anchor were inside a hidden subtree whose children changed, they could still reach one of these stale ids in a release build. That is a separate upstream fragility, and nothing here makes it worse.🤖 Generated with Claude Code