Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6c9904c1764ad0e759022a201281b2d0d726876e
https://github.com/WebKit/WebKit/commit/6c9904c1764ad0e759022a201281b2d0d726876e
Author: Alan Baradlay <[email protected]>
Date: 2026-07-24 (Fri, 24 Jul 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.h
Log Message:
-----------
[cleanup] Pass FlexLayoutItem instead of RenderBox to the remaining
FlexFormattingUtils flex-item helpers
https://bugs.webkit.org/show_bug.cgi?id=320243
Reviewed by Antti Koivisto.
FlexFormattingContext works in FlexLayoutItems, but still reached through
.renderer to call a
handful of FlexFormattingUtils per-item helpers that only had a RenderBox
overload -- so several
call sites kept a `CheckedRef flexItem = flexLayoutItem.renderer` local purely
to feed them.
Give those helpers a FlexLayoutItem overload -- crossAxisExtentForFlexItem,
mainAxisExtentForFlexItem,
overflowAlignmentForFlexItem, flexItemHasAspectRatio, and
availableAlignmentSpaceForFlexItem -- each a
one-line forwarder to the existing RenderBox form, mirroring the
static/instance pairs the class
already had (crossAxisMarginExtentForFlexItem, alignmentForFlexItem, ...).
Switch the
FlexFormattingContext call sites to pass the FlexLayoutItem so none of them
hands FlexFormattingUtils a
renderer, and drop three now-unused renderer locals (their asserts read
flexLayoutItem.renderer directly).
The RenderBox forms stay: they are still called from the render side --
RenderFlexibleBox,
LayoutIntegration::FlexLayout's baseline and positioned static-position paths,
and FlexIntegrationUtils'
override scopes -- which hold a bare renderer rather than a FlexLayoutItem.
No change in behavior.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::crossSizeForFlexLines):
(WebCore::FlexFormattingContext::computeCrossSizeForFlexItems):
(WebCore::FlexFormattingContext::handleCrossAxisAlignmentForFlexItems):
(WebCore::FlexFormattingContext::performBaselineAlignment):
(WebCore::FlexFormattingContext::placeFlexItems):
(WebCore::FlexFormattingContext::layoutColumnReverse):
(WebCore::FlexFormattingContext::computeContentBasedMinMainSize):
(WebCore::FlexFormattingContext::computeMainSizeFromAspectRatioUsing):
(WebCore::FlexFormattingContext::applyStretchMinMaxCrossSize):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.h:
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp:
(WebCore::FlexFormattingUtils::crossAxisExtentForFlexItem):
(WebCore::FlexFormattingUtils::mainAxisExtentForFlexItem):
(WebCore::FlexFormattingUtils::overflowAlignmentForFlexItem):
(WebCore::FlexFormattingUtils::flexItemHasAspectRatio):
(WebCore::FlexFormattingUtils::availableAlignmentSpaceForFlexItem):
Canonical link: https://commits.webkit.org/317911@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications