LibWeb: Reduce usage of Node::containing_block() in BFC

Explicitly pass containing block width in
resolve_vertical_box_model_metrics() instead of doing containing block
box lookup.

This is a part of refactoring towards removing containing_block() usage
that will allow us introduce partial layout.
This commit is contained in:
Aliaksandr Kalenik 2024-11-11 15:12:09 +01:00 committed by Andreas Kling
commit 07d8ddb5fa
Notes: github-actions[bot] 2024-11-11 19:21:51 +00:00
3 changed files with 6 additions and 7 deletions

View file

@ -46,7 +46,7 @@ CSSPixels TableFormattingContext::run_caption_layout(CSS::CaptionSide phase)
auto const& child_box = static_cast<Box const&>(*child);
// FIXME: Since caption only has inline children, BlockFormattingContext doesn't resolve the vertical metrics.
// We need to do it manually here.
caption_context->resolve_vertical_box_model_metrics(child_box);
caption_context->resolve_vertical_box_model_metrics(child_box, m_available_space->width.to_px_or_zero());
auto const& caption_state = m_state.get(child_box);
if (phase == CSS::CaptionSide::Top) {
m_state.get_mutable(table_box()).set_content_y(caption_state.content_height() + caption_state.margin_box_bottom());