1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibWeb: Set width in compute_width_for_table_wrapper()

Width of table wrapper need to be set to to calculate width of table
box inside. Otherwise TFC will set wrong width assuming width of
containing block is 0.
This commit is contained in:
Aliaksandr Kalenik 2023-05-07 02:53:11 +03:00 committed by Andreas Kling
parent 88e060907b
commit 3a605d8c19
3 changed files with 42 additions and 0 deletions

View file

@ -375,6 +375,7 @@ CSSPixels BlockFormattingContext::compute_width_for_table_wrapper(Box const& box
auto available_width = width_of_containing_block - margin_left.to_px(box) - margin_right.to_px(box);
LayoutState throwaway_state(&m_state);
throwaway_state.get_mutable(box).set_content_width(available_width);
auto context = create_independent_formatting_context_if_needed(throwaway_state, box);
VERIFY(context);
context->run(box, LayoutMode::IntrinsicSizing, m_state.get(box).available_inner_space_or_constraints_from(available_space));