summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom <martinmotteditfalisse@gmail.com>2022-12-31 14:32:15 +0100
committerAndreas Kling <kling@serenityos.org>2022-12-31 14:48:37 +0100
commit3dccee6025c3275638bf2cadbd33cc818b71063d (patch)
tree953fd89be2638d71bb5e368c80a83210c76e416c
parent883b0f1390449f92a098ebe8d7639c7d24ff4a75 (diff)
downloadserenity-3dccee6025c3275638bf2cadbd33cc818b71063d.zip
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.
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp3
1 files changed, 3 insertions, 0 deletions
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;