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

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

  Log Message:
  -----------
  [cleanup] Store each flex item's used main size in a list instead of on 
FlexLayoutItem
https://bugs.webkit.org/show_bug.cgi?id=318511

Reviewed by Antti Koivisto.

The flexible-length resolution wrote each item's used main size onto
FlexLayoutItem::flexedContentSize, and computeMainSizeForFlexItems then copied
that member into the returned Vector<LayoutUnit>. FlexLayout::layout keeps the
used main size only in a parallel SizeList and leaves LogicalFlexItem immutable.
Match that: computeMainSizeForFlexItems now sizes mainSizeList up front and 
hands
each line a slice to write directly, so the size never lands on the item.

resolveFlexibleLengthsForLineItems and the freeze helpers take a
std::span<LayoutUnit> mainSizes parallel to the item span and write it by index;
layoutFlexItems / layoutFlexItemAfterMainSizing take the size from the list; and
flexedMarginBoxSize takes the main size as an argument. LineState gains a
std::span<LayoutUnit> mainSizes (a slice of mainSizeList, symmetric with the
flexLayoutItems span it already holds) so the multi-line column re-resolution in
distributeMainAxisFreeSpaceForMultilineColumnIfNeeded re-writes the same backing
storage the follow-up layout reads. FlexLayoutItem::flexedContentSize is gone.

Behavior is unchanged: the same values are written in the same order, only into
the list rather than the item; mainSizeList lives for the whole layout and is
never resized after the line slices are taken, so those spans stay valid.

* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::FlexLayoutItem::flexedMarginBoxSize):
(WebCore::RenderFlexibleBox::LineState::LineState):
(WebCore::RenderFlexibleBox::resolveFlexibleLengthsForLineItems):
(WebCore::RenderFlexibleBox::distributeMainAxisFreeSpaceForMultilineColumnIfNeeded):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::computeMainSizeForFlexItems):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::freezeInflexibleItems):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
(WebCore::RenderFlexibleBox::layoutFlexItemAfterMainSizing):

Canonical link: https://commits.webkit.org/316964@main



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

Reply via email to