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

LibWeb: Flexbox: Take parents' specified main size into account

Previously, if the parent of the container had a definite main size, it
would've been disregarded when calculating the main size of the
container if it had no definite size and neither min- nor max-main-size
constraints.
This patch fixes that behavior by additionally checking whether the main
size is not only not constrained but also infinite.
This commit is contained in:
Tobias Christiansen 2021-10-04 13:11:37 +02:00 committed by Andreas Kling
parent fdd2d49c5b
commit 9af85881f5

View file

@ -410,7 +410,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
}
// 4. Determine the main size of the flex container
if (!main_is_constrained || main_available_size == 0) {
if ((!main_is_constrained && main_size_is_infinite) || main_available_size == 0) {
// Uses https://www.w3.org/TR/css-flexbox-1/#intrinsic-main-sizes
// 9.9.1
// 1.