From f7bd1edde3588b6acd3d3628ec42e22302ed900b Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Sat, 15 Oct 2022 12:45:42 +0200 Subject: LibWeb: Calculate the height of the css grid correctly Enable the CSS grid height to be calculated correclly. --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Userland') 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' -- cgit v1.2.3