Skip to content

Commit 732527a

Browse files
committed
[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
1 parent 1b953e1 commit 732527a

2 files changed

Lines changed: 58 additions & 56 deletions

File tree

0 commit comments

Comments
 (0)