summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-04-28 00:35:47 +0300
committerAndreas Kling <kling@serenityos.org>2023-04-28 06:17:07 +0200
commit9b4cd0dab7d33090f398321c8dd46b9e3076b5ff (patch)
treecef384f80659a8641bfd3cf0be4d7827be3ef8db /Userland/Libraries/LibWeb/Layout
parentd06057f88b6c6d8f629f93b097773b54bbc6ebd8 (diff)
downloadserenity-9b4cd0dab7d33090f398321c8dd46b9e3076b5ff.zip
LibWeb: Consider row computed height in total row min height of table
Fixes the issue that currently we do not consider table rows height while calculating min row height even if it is definite value.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
index 0a9dd32306..4d77098045 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
@@ -425,6 +425,16 @@ void TableFormattingContext::calculate_row_heights(LayoutMode layout_mode)
row.used_height = max(row.used_height, cell_state.border_box_height());
row.baseline = max(row.baseline, cell.baseline);
}
+
+ for (auto& row : m_rows) {
+ auto row_computed_height = row.box->computed_values().height();
+ if (row_computed_height.is_length()) {
+ auto height_of_containing_block = m_state.get(*row.box->containing_block()).content_height();
+ auto height_of_containing_block_as_length = CSS::Length::make_px(height_of_containing_block);
+ auto row_used_height = row_computed_height.resolved(row.box, height_of_containing_block_as_length).to_px(row.box);
+ row.used_height = max(row.used_height, row_used_height);
+ }
+ }
}
void TableFormattingContext::position_row_boxes(CSSPixels& total_content_height)