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

LibWeb: Some improvements to CSS height:auto computation for blocks

Auto block heights are now computed according to something that kinda
resembles the specification.

Blocks with inline children and height:auto have their height computed
based on the top of the first line box and the bottom of the last line
box. Very straightforward.

Blocks with block children and height:auto have their height computed
based on the top of the first in-flow block child's margin box, and the
bottom of the last in-flow block child's margin box.
This commit is contained in:
Andreas Kling 2021-03-08 22:49:34 +01:00
parent 0918dd0460
commit 968ad0f8d1
2 changed files with 66 additions and 28 deletions

View file

@ -54,7 +54,8 @@ private:
void compute_width_for_floating_box(Box&);
void compute_width_for_block_level_replaced_element_in_normal_flow(ReplacedBox&);
void compute_height_for_block_level_replaced_element_in_normal_flow(ReplacedBox&);
[[nodiscard]] static float compute_auto_height_for_block_level_element(const Box&);
void layout_initial_containing_block(LayoutMode);