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

LibWeb: Mark root element height as definite when affected by quirk

This will be required for percentages to resolve against it correctly
after we make set_content_height() not automatically mark heights as
definite sizes.
This commit is contained in:
Andreas Kling 2024-01-29 15:54:33 +01:00
parent b079f4d590
commit f0269b0a94

View file

@ -455,6 +455,7 @@ CSSPixels BlockFormattingContext::compute_table_box_width_inside_table_wrapper(B
void BlockFormattingContext::compute_height(Box const& box, AvailableSpace const& available_space)
{
auto const& computed_values = box.computed_values();
auto& box_used_values = m_state.get_mutable(box);
// Then work out what the height is, based on box type and CSS properties.
CSSPixels height = 0;
@ -499,9 +500,12 @@ void BlockFormattingContext::compute_height(Box const& box, AvailableSpace const
// 3. Return the bigger value of size and the normal border box size the element would have
// according to the CSS specification.
height = max(size, height);
// NOTE: The height of the root element when affected by this quirk is considered to be definite.
box_used_values.set_has_definite_height(true);
}
m_state.get_mutable(box).set_content_height(height);
box_used_values.set_content_height(height);
}
void BlockFormattingContext::layout_inline_children(BlockContainer const& block_container, LayoutMode layout_mode, AvailableSpace const& available_space)