diff options
author | Andreas Kling <kling@serenityos.org> | 2020-11-29 22:37:15 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-29 22:39:01 +0100 |
commit | 65eef944ab35ca85be178615ffc32834d430f4e3 (patch) | |
tree | 873fdd0e65f905c444efc06899857c24475cbe72 /Libraries | |
parent | b19f62217ff0bfd6f0107f0ce67fa91eb197e434 (diff) | |
download | serenity-65eef944ab35ca85be178615ffc32834d430f4e3.zip |
LibWeb: Auto-size table box height to fit all the rows
This is just a hack until we implement the full 'height' property for
tables. :^)
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibWeb/Layout/TableFormattingContext.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Libraries/LibWeb/Layout/TableFormattingContext.cpp index b448ad5bf6..988b859488 100644 --- a/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -51,6 +51,8 @@ void TableFormattingContext::run(LayoutMode) { compute_width(context_box()); + float total_content_height = 0; + context_box().for_each_child_of_type<TableRowGroupBox>([&](auto& box) { compute_width(box); auto column_count = box.column_count(); @@ -70,9 +72,12 @@ void TableFormattingContext::run(LayoutMode) }); box.set_height(content_height); + + total_content_height += content_height; }); - compute_height(context_box()); + // FIXME: This is a total hack, we should respect the 'height' property. + context_box().set_height(total_content_height); } void TableFormattingContext::calculate_column_widths(Box& row, Vector<float>& column_widths) |