Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6690fc7072d02c64fd26f0be578c19f9c59a9c0b
https://github.com/WebKit/WebKit/commit/6690fc7072d02c64fd26f0be578c19f9c59a9c0b
Author: Alan Baradlay <[email protected]>
Date: 2026-10-10 (Sat, 10 Oct 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.h
M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp
M Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h
M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp
Log Message:
-----------
[cleanup] Remove dead code from the flex formatting context
https://bugs.webkit.org/show_bug.cgi?id=327088
<rdar://problem/189704335>
Reviewed by Antti Koivisto.
1. Remove the checks for an empty line or item list in layout(),
computeFlexLines,
handleCrossAxisAlignmentForFlexLines and
setFlexItemCountsForFirstAndLastLine; layout() returns early for an empty
container, so there is always a line.
2. Compute crossAxisStartEdge in computeFlexItemRects instead of passing it
from layout(); it is the first line's
position before align-content moves it, which is always the content box's
cross-start edge.
3. Remove flowAwareBorderAfter() and flowAwarePaddingAfter(); they only filled
the never-read block-after half of two
FlexLayoutConstraints pairs, which become flowAwareBorderBefore and
flowAwarePaddingBefore.
4. Remove FlexItemDefiniteCrossSizeScope's m_shouldRestoreInlineSize and
m_shouldRestoreBlockSize; every constructor
path set both, so save both overriding sizes up front and always restore
them.
5. Drop the null check in buildFlexLayoutItems; it runs on the list
buildFlexItemList has just collected from the
container's children, so no item has been destroyed.
6. Turn the m_flexLayoutResult checks in flexItemForFirstBaseline and
flexItemForLastBaseline into ASSERTs; their only
callers, firstLineBaseline and lastLineBaseline, already return early
without a result.
No change in behavior.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::layout):
(WebCore::FlexFormattingContext::computeFlexLines):
(WebCore::FlexFormattingContext::computeFlexLineCrossPositions):
(WebCore::FlexFormattingContext::handleCrossAxisAlignmentForFlexLines):
(WebCore::FlexFormattingContext::computeFlexItemRects):
(WebCore::FlexFormattingContext::setFlexItemCountsForFirstAndLastLine):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h:
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp:
(WebCore::FlexFormattingUtils::flowAwareBorderAfter const): Deleted.
(WebCore::FlexFormattingUtils::flowAwarePaddingAfter const): Deleted.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.h:
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.cpp:
(WebCore::LayoutIntegration::FlexItemDefiniteCrossSizeScope::FlexItemDefiniteCrossSizeScope):
(WebCore::LayoutIntegration::FlexItemDefiniteCrossSizeScope::~FlexItemDefiniteCrossSizeScope):
* Source/WebCore/layout/integration/flex/FlexIntegrationUtils.h:
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::flexLayoutConstraints const):
(WebCore::LayoutIntegration::FlexLayout::buildFlexLayoutItems):
(WebCore::LayoutIntegration::FlexLayout::flexItemForFirstBaseline const):
(WebCore::LayoutIntegration::FlexLayout::flexItemForLastBaseline const):
Canonical link: https://commits.webkit.org/323335@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications