mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
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. :^)
This commit is contained in:
parent
b19f62217f
commit
65eef944ab
Notes:
sideshowbarker
2024-07-19 01:10:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/65eef944ab3
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue