Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e7bee5e32c6eae701208ccb7c4346875b0f3776b
https://github.com/WebKit/WebKit/commit/e7bee5e32c6eae701208ccb7c4346875b0f3776b
Author: Alan Baradlay <[email protected]>
Date: 2026-07-24 (Fri, 24 Jul 2026)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h
A Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp
A 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] Introduce LayoutIntegration::FlexIntegrationUtils and route
FlexFormattingContext's render-tree access through it
https://bugs.webkit.org/show_bug.cgi?id=320188
Reviewed by Antti Koivisto.
FlexFormattingContext reached into the render tree by calling back into
RenderFlexibleBox
directly (m_flexBox->...). Introduce LayoutIntegration::FlexIntegrationUtils as
the boundary
the formatting context goes through instead, mirroring how
InlineFormattingContext uses its
IntegrationUtils: LayoutIntegration::FlexLayout (the flex integration layer
that drives the
FFC) constructs and owns it and hands it to the stack-scoped
FlexFormattingContext, which
reaches it only via integrationUtils(). RenderFlexibleBox just befriends it.
The integration realizes each operation one of two ways, but the FFC-facing
boundary is
uniform:
- Child-manipulating flex logic moves its body onto FlexIntegrationUtils:
applyStretchedLogicalHeightToFlexItem, layoutFlexItemForStretchedCrossSize and
layoutFlexItemWithMainSize (each still delegates the RenderFlexibleBox
helpers it does
not own via flexBox()).
- Operations that are the container sizing itself
(updateFlexContainerLogicalHeight, which
uses RenderBox's own protected height resolution), inherited
RenderBox/RenderBlock
mutators (setTrimmedMarginForChild, adjustBorderBoxLogicalWidthForBoxSizing),
and helpers
whose state/readers stay on the renderer (the margin-trim addItem* -- whose
sets are read
by the isChildEligibleForMarginTrim virtual -- and
flexItemHasPercentHeightDescendants)
stay on RenderFlexibleBox and are proxied through FlexIntegrationUtils.
The integration's API is expressed in terms of FlexLayoutItem (extracting the
renderer
internally), matching the abstraction the formatting context works in.
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h: Added.
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp: Added.
(WebCore::LayoutIntegration::FlexIntegrationUtils::FlexIntegrationUtils):
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexLayoutState const):
(WebCore::LayoutIntegration::FlexIntegrationUtils::applyStretchedLogicalHeightToFlexItem):
(WebCore::LayoutIntegration::FlexIntegrationUtils::layoutFlexItemForStretchedCrossSize):
(WebCore::LayoutIntegration::FlexIntegrationUtils::layoutFlexItemWithMainSize):
(WebCore::LayoutIntegration::FlexIntegrationUtils::updateFlexContainerLogicalHeight):
(WebCore::LayoutIntegration::FlexIntegrationUtils::setTrimmedMarginForChild):
(WebCore::LayoutIntegration::FlexIntegrationUtils::adjustBorderBoxLogicalWidthForBoxSizing
const):
(WebCore::LayoutIntegration::FlexIntegrationUtils::addItemAtFlexLineStart):
(WebCore::LayoutIntegration::FlexIntegrationUtils::addItemAtFlexLineEnd):
(WebCore::LayoutIntegration::FlexIntegrationUtils::addItemOnFirstFlexLine):
(WebCore::LayoutIntegration::FlexIntegrationUtils::addItemOnLastFlexLine):
(WebCore::LayoutIntegration::FlexIntegrationUtils::flexItemHasPercentHeightDescendants
const):
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h:
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::layout):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h:
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::FlexFormattingContext):
(WebCore::FlexFormattingContext::layout):
(WebCore::FlexFormattingContext::layoutFlexItems):
(WebCore::FlexFormattingContext::trimMainAxisMarginStart):
(WebCore::FlexFormattingContext::trimMainAxisMarginEnd):
(WebCore::FlexFormattingContext::trimCrossAxisMarginStart):
(WebCore::FlexFormattingContext::trimCrossAxisMarginEnd):
(WebCore::FlexFormattingContext::applyStretchAlignmentToFlexItem):
(WebCore::FlexFormattingContext::applyStretchMinMaxCrossSize):
(WebCore::FlexFormattingContext::layoutState const):
(WebCore::FlexFormattingContext::layoutFlexItemsWithMainSizes):
(WebCore::FlexFormattingContext::computeMainSizeFromAspectRatioUsing const):
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::applyStretchedLogicalHeightToFlexItem): Deleted.
(WebCore::RenderFlexibleBox::layoutFlexItemForStretchedCrossSize): Deleted.
(WebCore::RenderFlexibleBox::layoutFlexItemWithMainSize): Deleted.
Canonical link: https://commits.webkit.org/317879@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications