[cleanup] Pass the flex container's main-axis available space into FlexLayout as a constraint
https://bugs.webkit.org/show_bug.cgi?id=318611 Reviewed by Antti Koivisto. FlexLayout computed the flex container's main-axis available space itself: contentBoxLogicalWidth for row flow, and for column flow the specified logical height via computeLogicalHeight (clearing and restoring the flex-basis override so it sees the specified height rather than the parent flex's sizing). That is a container property, and unlike the cross size (which grows as lines stack) it is fixed before the algorithm runs, so FlexLayout should be handed it rather than reach back into the container for it. Move the computation to RenderFlexibleBox and snapshot the result into FlexLayoutConstraints alongside the flow flags and border/padding; FlexLayout reads m_constraints.mainAxisAvailableSpace when collecting lines. flexLayoutConstraints() becomes non-const because the column path mutates the container's override while reading its specified height. No change in behavior: the value is computed the same way and does not depend on item layout, so computing it up front (before the flex-base sizing pass) rather than during line collection yields the same result. * Source/WebCore/rendering/RenderFlexLayout.cpp: * Source/WebCore/rendering/RenderFlexLayout.h: * Source/WebCore/rendering/RenderFlexibleBox.cpp: * Source/WebCore/rendering/RenderFlexibleBox.h: Canonical link: https://commits.webkit.org/317278@main
A
Alan Baradlay committed
f12ce46ea2dd37e4bcd2e8e2d93980fa6a8c228a
Parent: 7461d46