mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibWeb: Use available space to resolve table container width
Using avilable space directly while resolving table container width allows to avoid assigning it to table wrapper box content width which sometimes involves infinite (saturated) values. Also this allows to get rid of set_max_content_width() which is a hack that allows to bypass set_content_width() to assign infinite (saturated) width to a box. Closes https://github.com/SerenityOS/serenity/issues/19521
This commit is contained in:
parent
fb60db7b00
commit
9101c8d079
7 changed files with 42 additions and 35 deletions
|
@ -421,14 +421,6 @@ CSSPixels BlockFormattingContext::compute_table_box_width_inside_table_wrapper(B
|
|||
auto available_width = width_of_containing_block - margin_left.to_px(box) - margin_right.to_px(box);
|
||||
|
||||
LayoutState throwaway_state(&m_state);
|
||||
if (available_space.width.is_definite())
|
||||
throwaway_state.get_mutable(box).set_content_width(available_width);
|
||||
else if (available_space.width.is_min_content())
|
||||
throwaway_state.get_mutable(box).set_min_content_width();
|
||||
else {
|
||||
VERIFY(available_space.width.is_max_content());
|
||||
throwaway_state.get_mutable(box).set_max_content_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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue