diff options
author | Simon Wanner <skyrising@pvpctutorials.de> | 2022-04-03 22:29:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-03 23:12:13 +0200 |
commit | 509362c103aa22d68766848451ac58cd5537a2b8 (patch) | |
tree | 87a78d9a6c49f15bf8f3fbde3b0b0810ff33b3bd /Userland/Libraries/LibWeb | |
parent | d28f3e07354b0e65221e1e240c67792f4d314876 (diff) | |
download | serenity-509362c103aa22d68766848451ac58cd5537a2b8.zip |
LibWeb: Include all row-groups in column width calculations
This was noticeable for example on fonts.serenityos.net, where the
thead and tfoot would not get the same column widths as the tbody.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index edeaac5830..4833ccfa79 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -34,17 +34,18 @@ void TableFormattingContext::run(Box const& box, LayoutMode) float total_content_width = 0; float total_content_height = 0; + Vector<ColumnWidth> column_widths; box.for_each_child_of_type<TableRowGroupBox>([&](auto& row_group_box) { - auto& row_group_box_state = m_state.get_mutable(row_group_box); - compute_width(row_group_box); auto column_count = row_group_box.column_count(); - Vector<ColumnWidth> column_widths; - column_widths.resize(column_count); + column_widths.resize(max(column_count, column_widths.size())); row_group_box.template for_each_child_of_type<TableRowBox>([&](auto& row) { calculate_column_widths(row, table_width, column_widths); }); + }); + box.for_each_child_of_type<TableRowGroupBox>([&](auto& row_group_box) { + auto& row_group_box_state = m_state.get_mutable(row_group_box); float remaining_for_max = box_state.content_width; float remaining_for_min = box_state.content_width; |