LibWeb: Use parent's available space for anonymous blocks in BFC

Height resolution assumes that when available space is definite, it
matches the size of non-anonymous containing block. With this change, we
correctly maintain this assumption when box is wrapped in anonymous
node.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/3422
This commit is contained in:
Aliaksandr Kalenik 2025-03-15 03:46:09 +01:00 committed by Alexander Kalenik
commit 227b4c38b7
Notes: github-actions[bot] 2025-03-15 12:52:21 +00:00
3 changed files with 47 additions and 1 deletions

View file

@ -803,7 +803,8 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain
});
}
layout_block_level_children(as<BlockContainer>(box), box_state.available_inner_space_or_constraints_from(available_space));
auto space_available_for_children = box.is_anonymous() ? available_space : box_state.available_inner_space_or_constraints_from(available_space);
layout_block_level_children(as<BlockContainer>(box), space_available_for_children);
}
}