mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibWeb: Forbid usage of indefinite width in calculate_min{max}_height
Changing `calculate_min_content_heigh()` and `calculate_min_content_heigh()` to accept width as `CSSPixels`, instead of `AvailableSize` that might be indefinite, makes it more explicit that width is supposed to be known by the time height is measured. This change has a bit of collateral damage which is rows height calculation regression in `table/inline-table-width` that worked before by accident.
This commit is contained in:
parent
9b61339261
commit
e25b1f76e1
8 changed files with 52 additions and 80 deletions
|
@ -834,7 +834,7 @@ void FlexFormattingContext::determine_main_size_of_flex_container()
|
|||
}
|
||||
} else {
|
||||
if (!has_definite_main_size(flex_container()))
|
||||
set_main_size(flex_container(), calculate_max_content_height(flex_container(), m_available_space_for_flex_container->space.width));
|
||||
set_main_size(flex_container(), calculate_max_content_height(flex_container(), m_available_space_for_flex_container->space.width.to_px()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2012,7 +2012,7 @@ CSSPixels FlexFormattingContext::calculate_min_content_main_size(FlexItem const&
|
|||
if (available_space.width.is_indefinite()) {
|
||||
available_space.width = AvailableSize::make_definite(calculate_width_to_use_when_determining_intrinsic_height_of_item(item));
|
||||
}
|
||||
return calculate_min_content_height(item.box, available_space.width);
|
||||
return calculate_min_content_height(item.box, available_space.width.to_px_or_zero());
|
||||
}
|
||||
|
||||
CSSPixels FlexFormattingContext::calculate_max_content_main_size(FlexItem const& item) const
|
||||
|
@ -2024,7 +2024,7 @@ CSSPixels FlexFormattingContext::calculate_max_content_main_size(FlexItem const&
|
|||
if (available_space.width.is_indefinite()) {
|
||||
available_space.width = AvailableSize::make_definite(calculate_width_to_use_when_determining_intrinsic_height_of_item(item));
|
||||
}
|
||||
return calculate_max_content_height(item.box, available_space.width);
|
||||
return calculate_max_content_height(item.box, available_space.width.to_px_or_zero());
|
||||
}
|
||||
|
||||
CSSPixels FlexFormattingContext::calculate_fit_content_main_size(FlexItem const& item) const
|
||||
|
@ -2048,7 +2048,7 @@ CSSPixels FlexFormattingContext::calculate_min_content_cross_size(FlexItem const
|
|||
if (available_space.width.is_indefinite()) {
|
||||
available_space.width = AvailableSize::make_definite(calculate_width_to_use_when_determining_intrinsic_height_of_item(item));
|
||||
}
|
||||
return calculate_min_content_height(item.box, available_space.width);
|
||||
return calculate_min_content_height(item.box, available_space.width.to_px_or_zero());
|
||||
}
|
||||
return calculate_min_content_width(item.box);
|
||||
}
|
||||
|
@ -2060,7 +2060,7 @@ CSSPixels FlexFormattingContext::calculate_max_content_cross_size(FlexItem const
|
|||
if (available_space.width.is_indefinite()) {
|
||||
available_space.width = AvailableSize::make_definite(calculate_width_to_use_when_determining_intrinsic_height_of_item(item));
|
||||
}
|
||||
return calculate_max_content_height(item.box, available_space.width);
|
||||
return calculate_max_content_height(item.box, available_space.width.to_px_or_zero());
|
||||
}
|
||||
return calculate_max_content_width(item.box);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue