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

LibWeb: Handle height:auto separately for BFC root vs other block boxes

I was wrong in 56df05ae44, there are
situations where floating children should not affect the auto height of
their parent.

It turns out we were using the "height:auto for BFC roots" algorithm for
all height:auto blocks. This patch fixes that by splitting it into two
separate functions, and implementing most of the two different variants.

Note that we don't support vertical margin collapsing here yet.

Thanks to Tim for noticing the error! :^)
This commit is contained in:
Andreas Kling 2022-03-01 23:21:24 +01:00
parent 4fa270d81f
commit fa43a4118e
2 changed files with 62 additions and 10 deletions

View file

@ -58,6 +58,7 @@ protected:
static float tentative_width_for_replaced_element(FormattingState const&, ReplacedBox const&, CSS::Length const& width);
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&);
ShrinkToFitResult calculate_shrink_to_fit_widths(Box const&);