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

LibWeb: Set zero underflow when calculating intrinsic width of block

This fix resolves issue where calculating the min size of a block could
result in incorrect value if width of the block's children was
compensated by margins to fit into container width (which is equal to 0
during min size calculation).
This commit is contained in:
Aliaksandr Kalenik 2023-05-02 11:19:29 +03:00 committed by Andreas Kling
parent 00e3e82bbd
commit 6cec431720
4 changed files with 55 additions and 5 deletions

View file

@ -174,7 +174,7 @@ void BlockFormattingContext::compute_width(Box const& box, AvailableSpace const&
// 10.3.3 cont'd.
auto underflow_px = width_of_containing_block - total_px;
if (!isfinite(underflow_px.value()))
if (available_space.width.is_intrinsic_sizing_constraint())
underflow_px = 0;
if (width.is_auto()) {