diff options
author | martinfalisse <martinmotteditfalisse@gmail.com> | 2022-10-15 12:45:42 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-10-15 16:04:01 +0200 |
commit | f7bd1edde3588b6acd3d3628ec42e22302ed900b (patch) | |
tree | 51b3675f9d83f5cd9dd71f881c4a021d62363bf2 | |
parent | b6a29ae9e26f7a74759d468c826dd473f957fd0c (diff) | |
download | serenity-f7bd1edde3588b6acd3d3628ec42e22302ed900b.zip |
LibWeb: Calculate the height of the css grid correctly
Enable the CSS grid height to be calculated correclly.
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index dfac2822d3..a1f47c7a6b 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -276,6 +276,12 @@ float FormattingContext::compute_auto_height_for_block_level_element(Box const& // NOTE: The automatic block size of a block-level flex container is its max-content size. return calculate_max_content_height(box, available_space.width); } + if (display.is_grid_inside()) { + // https://www.w3.org/TR/css-grid-2/#intrinsic-sizes + // In both inline and block formatting contexts, the grid container’s auto block size is its + // max-content size. + return calculate_max_content_height(box, available_space.width); + } // https://www.w3.org/TR/CSS22/visudet.html#normal-block // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' |