From 9fbd82e5d6b5b54ba0e8f5a56c31e2eb3c28ef03 Mon Sep 17 00:00:00 2001 From: "nico.burns" Date: Sat, 8 Aug 2026 16:03:52 +0000 Subject: [PATCH] Don't let display:none children force an inline formatting context display:none children generate no boxes, but classify_flow_children was counting them as in-flow inline content. A container whose only children are display:none (e.g. an root with display:none) was classified as all-inline and queued for inline layout construction -- panicking when that container was the Document node, which has no element data. --- packages/blitz-dom/src/layout/construct.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/blitz-dom/src/layout/construct.rs b/packages/blitz-dom/src/layout/construct.rs index e712a15fb..d96df7f94 100644 --- a/packages/blitz-dom/src/layout/construct.rs +++ b/packages/blitz-dom/src/layout/construct.rs @@ -310,6 +310,11 @@ fn classify_flow_children( continue; } + // display:none children generate no boxes and cast no vote + if matches!(display.outside(), DisplayOutside::None) { + continue; + } + let is_in_flow = matches!( position, PositionProperty::Static | PositionProperty::Relative | PositionProperty::Sticky