1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibWeb: Use max-width property in table formatting

This commit is contained in:
martinfalisse 2023-04-05 18:21:40 +02:00 committed by Andreas Kling
parent 1440845aad
commit c839c51b0b
3 changed files with 35 additions and 0 deletions

View file

@ -246,6 +246,8 @@ void TableFormattingContext::compute_table_width()
// of resolved-table-width, and the used min-width of the table.
CSSPixels resolved_table_width = computed_values.width().resolved(table_box(), CSS::Length::make_px(width_of_table_containing_block)).to_px(table_box());
used_width = max(resolved_table_width, used_min_width);
if (!computed_values.max_width().is_none())
used_width = min(used_width, computed_values.max_width().resolved(table_box(), CSS::Length::make_px(width_of_table_containing_block)).to_px(table_box()));
table_box_state.set_content_width(used_width);
}
}