Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0f389116ff7c15568402de1c99a6e709e9687a4e
https://github.com/WebKit/WebKit/commit/0f389116ff7c15568402de1c99a6e709e9687a4e
Author: Alan Baradlay <[email protected]>
Date: 2026-07-23 (Thu, 23 Jul 2026)
Changed paths:
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] Move the flex first/last-line item counts onto
LayoutIntegration::FlexLayout
https://bugs.webkit.org/show_bug.cgi?id=320131
Reviewed by Antti Koivisto.
The number of flex items on the first and last flex line
(m_numberOfFlexItemsOnFirstLine / m_numberOfFlexItemsOnLastLine) is produced by
the
FlexFormattingContext (returned in its Result) and consumed only by the flex
baseline
queries -- firstLineBaseline / lastLineBaseline / flexItemForFirst|LastBaseline
--
which all live on LayoutIntegration::FlexLayout. RenderFlexibleBox held the two
members but never read them; it only reset them and let the integration layer
reach
across (flexBox().m_numberOfFlexItemsOn...) to write and read them.
Move them onto LayoutIntegration::FlexLayout, which is a persistent member of
RenderFlexibleBox (so it outlives the stack-scoped FlexFormattingContext and is
still
around for the parent's post-layout baseline queries) and is where the baseline
logic
that uses them already lives. The integration layer now writes and reads its own
members, and resets them at the top of FlexLayout::layout() -- covering the
empty-container early return that RenderFlexibleBox::layoutBlock's reset used to
handle. RenderFlexibleBox loses both members and the reset; firstLineBaseline()
/
lastLineBaseline() already just forward to m_flexLayout.
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::layout):
(WebCore::LayoutIntegration::FlexLayout::firstLineBaseline const):
(WebCore::LayoutIntegration::FlexLayout::lastLineBaseline const):
(WebCore::LayoutIntegration::FlexLayout::flexItemForFirstBaseline const):
(WebCore::LayoutIntegration::FlexLayout::flexItemForLastBaseline const):
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/317833@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications