From 3dccee6025c3275638bf2cadbd33cc818b71063d Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 31 Dec 2022 14:32:15 +0100 Subject: [PATCH] LibWeb: Fix table-row y-position Fixes the y-position of rows when indicated through the display attribute `table-row`. Previously there was no y-offset between rows and so they would overlap. --- Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 68c1b12cc8..bbe91b1959 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -276,6 +276,7 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons row.baseline = max(row.baseline, cell.baseline); } + float row_top_offset = 0.0f; for (size_t y = 0; y < m_rows.size(); y++) { auto& row = m_rows[y]; auto& row_state = m_state.get_mutable(row.box); @@ -286,6 +287,8 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons row_state.set_content_height(row.used_width); row_state.set_content_width(row_width); + row_state.set_content_y(row_top_offset); + row_top_offset += row_state.content_height(); } float row_group_top_offset = 0.0f;