diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 548e898b07..0baf1444a4 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -36,8 +36,8 @@ struct Traits : public GenericTraits { namespace Web::Layout { -TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& block_container, FormattingContext* parent) - : BlockFormattingContext(state, block_container, parent) +TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& root, FormattingContext* parent) + : FormattingContext(Type::Table, state, root, parent) { } @@ -246,10 +246,10 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons cell_state.border_right = cell.box.computed_values().border_right().width; cell_state.set_content_width(span_width - cell_state.border_box_left() - cell_state.border_box_right()); - if (auto independent_formatting_context = layout_inside(cell.box, LayoutMode::Normal, cell_state.available_inner_space_or_constraints_from(available_space))) - independent_formatting_context->parent_context_did_dimension_child_root_box(); - - BlockFormattingContext::compute_height(cell.box, AvailableSpace(AvailableSize::make_indefinite(), AvailableSize::make_indefinite())); + auto independent_formatting_context = layout_inside(cell.box, LayoutMode::Normal, cell_state.available_inner_space_or_constraints_from(available_space)); + VERIFY(independent_formatting_context); + cell_state.set_content_height(independent_formatting_context->automatic_content_height()); + independent_formatting_context->parent_context_did_dimension_child_root_box(); cell.baseline = box_baseline(m_state, cell.box); diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h index 216b440b2f..a86e1d77c1 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -7,11 +7,11 @@ #pragma once #include -#include +#include namespace Web::Layout { -class TableFormattingContext final : public BlockFormattingContext { +class TableFormattingContext final : public FormattingContext { public: explicit TableFormattingContext(LayoutState&, BlockContainer const&, FormattingContext* parent); ~TableFormattingContext();