Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 60ed425475e2be58144ff1bdb539435c54053d68
https://github.com/WebKit/WebKit/commit/60ed425475e2be58144ff1bdb539435c54053d68
Author: Alan Baradlay <[email protected]>
Date: 2026-07-26 (Sun, 26 Jul 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp
M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h
M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp
M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Have FlexFormattingContext own FlexIntegrationUtils instead of
borrowing it from FlexLayout
https://bugs.webkit.org/show_bug.cgi?id=320298
Reviewed by Antti Koivisto.
FlexIntegrationUtils was a member of FlexLayout, so it lived as long as the
RenderFlexibleBox even
though everything on it is flex-algorithm work. What kept it there was the
flex-item content cache:
FlexLayout owns the cache, and its renderer-facing entry points reached it by
forwarding through
FlexIntegrationUtils' RenderBox-taking overloads.
Have FlexLayout talk to FlexItemContentCache directly instead. That drops those
overloads, and with
them the last reason for anything outside the flex algorithm to hold
FlexIntegrationUtils, so the
formatting context can construct it in its initializer list and let it die with
the layout. The
cache is still owned by FlexLayout, since it has to outlive a single layout,
and is now passed to
the formatting context by reference.
Making it a value member is what turns integrationUtils() into a
const/non-const pair: constness
propagates through a member but not through a reference, so the accessor now
has to say which
methods actually mutate. The formatting context's own RenderFlexibleBox
reference becomes const
along the way; its only two uses are InspectorInstrumentation calls.
Also drop the min-content branch in formattingContextRootLogicalHeightForType.
It is the only thing
that called RenderFlexibleBox::flexItemContentLogicalHeight, and it is
unreachable:
IntegrationUtils::minContentHeight, the sole path to
LogicalHeightType::MinContent for a flex item,
has no callers. That leaves the box argument used only by the ASSERT on the
first line, which compiles
out in release builds, so mark it UNUSED_PARAM.
No change in behaviour.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::FlexFormattingContext):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h:
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::formattingContextRootLogicalHeightForType):
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp:
(WebCore::LayoutIntegration::FlexIntegrationUtils::applyStretchedLogicalHeightToFlexItem):
(WebCore::LayoutIntegration::FlexIntegrationUtils::layoutFlexItemForStretchedCrossSize):
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexItemContentLogicalHeight):
(WebCore::LayoutIntegration::FlexIntegrationUtils::computeBlockAxisContentSizeForFlexItem):
(WebCore::LayoutIntegration::canSetFlexItemContentLogicalHeight): Deleted.
(WebCore::LayoutIntegration::FlexIntegrationUtils::setFlexItemContentLogicalHeightFromLayout):
Deleted.
(WebCore::LayoutIntegration::FlexIntegrationUtils::restoreFlexItemContentLogicalHeight):
Deleted.
(WebCore::LayoutIntegration::FlexIntegrationUtils::invalidateBlockAxisSizeForFlexItem):
Deleted.
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexItemWillBeRemoved):
Deleted.
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h:
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::layout):
(WebCore::LayoutIntegration::FlexLayout::setFlexItemContentLogicalHeightFromLayout):
(WebCore::LayoutIntegration::FlexLayout::invalidateBlockAxisSizeForFlexItem):
(WebCore::LayoutIntegration::FlexLayout::flexItemWillBeRemoved):
(WebCore::LayoutIntegration::FlexLayout::flexItemContentLogicalHeight): Deleted.
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::flexItemContentLogicalHeight): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/317944@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications