1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

LibWeb: Fix calculating the intrinsic height of a box

For computing height in FormattingContext::calculate_intrinsic_sizes
we were calling into BlockFormattingContext::compute_theoretical_height
which will check if the CSS height property was defined and calculate
the height based on that instead of calculating the intrinsic height

This patch adds a new function calculate_intrinsic_height, which will
call into compute_auto_height_for_block_level_element for a block
element, or into compute_height_for_replaced_element for a replaced
element.
This commit is contained in:
Enver Balalic 2022-03-30 19:44:18 +02:00 committed by Andreas Kling
parent b526a10d76
commit 74d8e201eb
2 changed files with 12 additions and 2 deletions

View file

@ -81,6 +81,7 @@ protected:
static float tentative_height_for_replaced_element(FormattingState const&, ReplacedBox const&, CSS::Length const& height);
static float compute_auto_height_for_block_formatting_context_root(FormattingState const&, BlockContainer const&);
static float compute_auto_height_for_block_level_element(FormattingState const&, Box const&);
static float compute_intrinsic_height(FormattingState const& state, Box const& box);
ShrinkToFitResult calculate_shrink_to_fit_widths(Box const&);