1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

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.
This commit is contained in:
Tom 2022-12-31 14:32:15 +01:00 committed by Andreas Kling
parent 883b0f1390
commit 3dccee6025

View file

@ -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;