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:
parent
b079f4d590
commit
f0269b0a94
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue