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

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

  Log Message:
  -----------
  [cleanup] Move flex base and hypothetical main size off FlexLayoutItem into a 
per-item list
https://bugs.webkit.org/show_bug.cgi?id=318557

Reviewed by Antti Koivisto.

FlexLayoutItem carried flexBaseContentSize and hypotheticalMainContentSize as
members. FlexLayout::layout keeps these in a per-item 
FlexBaseAndHypotheticalMainSizeList
(its step-3 output) and passes it to the sizing phases, leaving LogicalFlexItem
without them. Match that: collectFlexItems now fills a
FlexBaseAndHypotheticalMainSizeList (reusing the existing 
FlexBaseAndHypotheticalMainSize
struct) alongside the items, and the flex-line collection and flexible-length
resolution read the two sizes from that list instead of the item.

computeFlexLines/computeNextFlexLine, computeMainSizeForFlexItems/
resolveFlexibleLengthsForLineItems, and the freeze helpers take the list (sliced
per line for the resolution); the flexBaseMarginBoxSize / 
hypotheticalMainAxisMarginBoxSize
helpers and canFitItemWithTrimmedMarginEnd take the content size as an argument.
FlexLayoutItem no longer stores flexBaseContentSize or 
hypotheticalMainContentSize.
minMaxSizes stays on the item (FFC's list holds only the two sizes; min/max is
sourced separately), so constrainSizeByMinMax is unchanged.

No change in behavior: the list is filled from the same 
flexBaseAndHypotheticalMainSize
computation, in the same per-item order as allItems, so every reader gets the 
same
value it read off the item before. This is the input 
FlexLayout::computeMainSizeForFlexItems
takes, so its resolution body can be ported to match FFC's next.

* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::FlexLayoutItem::FlexLayoutItem):
(WebCore::RenderFlexibleBox::FlexLayoutItem::hypotheticalMainAxisMarginBoxSize):
(WebCore::RenderFlexibleBox::FlexLayoutItem::flexBaseMarginBoxSize):
(WebCore::RenderFlexibleBox::resolveFlexibleLengthsForLineItems):
(WebCore::RenderFlexibleBox::distributeMainAxisFreeSpaceForMultilineColumnIfNeeded):
(WebCore::RenderFlexibleBox::canFitItemWithTrimmedMarginEnd):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::collectFlexItems):
(WebCore::RenderFlexibleBox::computeFlexLines):
(WebCore::RenderFlexibleBox::computeMainSizeForFlexItems):
(WebCore::RenderFlexibleBox::computeNextFlexLine):
(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::freezeInflexibleItems):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):

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



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

Reply via email to