From 686507a38f28404f511415df37f775e2a85a3c9e Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 21 Mar 2022 20:39:19 +0100 Subject: [PATCH] LibWeb: Translate table cells by their top left border --- Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 9c3504af6d..0d9b8dcc3d 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -101,7 +101,9 @@ void TableFormattingContext::layout_row(Box const& row, Vector& column_wi row.for_each_child_of_type([&](auto& cell) { auto& cell_state = m_state.get_mutable(cell); - cell_state.offset = row_state.offset.translated(content_width, 0); + + BlockFormattingContext::compute_height(cell, m_state); + cell_state.offset = row_state.offset.translated(cell_state.border_box_left() + content_width, cell_state.border_box_top()); // Layout the cell contents a second time, now that we know its final width. if (use_auto_layout) { @@ -110,8 +112,6 @@ void TableFormattingContext::layout_row(Box const& row, Vector& column_wi (void)layout_inside(cell, LayoutMode::Normal); } - BlockFormattingContext::compute_height(cell, m_state); - size_t cell_colspan = cell.colspan(); for (size_t i = 0; i < cell_colspan; ++i) content_width += column_widths[column_index++];