Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f12ce46ea2dd37e4bcd2e8e2d93980fa6a8c228a
      
https://github.com/WebKit/WebKit/commit/f12ce46ea2dd37e4bcd2e8e2d93980fa6a8c228a
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M Source/WebCore/rendering/RenderFlexLayout.cpp
    M Source/WebCore/rendering/RenderFlexLayout.h
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to