diff options
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutTableRow.cpp')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutTableRow.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutTableRow.cpp b/Libraries/LibWeb/Layout/LayoutTableRow.cpp index 44f9209783..e241e642de 100644 --- a/Libraries/LibWeb/Layout/LayoutTableRow.cpp +++ b/Libraries/LibWeb/Layout/LayoutTableRow.cpp @@ -39,9 +39,18 @@ LayoutTableRow::~LayoutTableRow() { } -void LayoutTableRow::layout(LayoutMode layout_mode) +void LayoutTableRow::layout(LayoutMode) { - LayoutBox::layout(layout_mode); + float tallest_cell_height = 0; + float content_width = 0; + for_each_child_of_type<LayoutTableCell>([&](auto& cell) { + cell.layout(LayoutMode::OnlyRequiredLineBreaks); + cell.set_offset(effective_offset().translated(content_width, 0)); + content_width += cell.width(); + tallest_cell_height = max(tallest_cell_height, cell.height()); + }); + set_width(content_width); + set_height(tallest_cell_height); } LayoutTableCell* LayoutTableRow::first_cell() |