Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 46e433297ff0a9a2ffdc8d180ced84732ca3825d
https://github.com/WebKit/WebKit/commit/46e433297ff0a9a2ffdc8d180ced84732ca3825d
Author: Alan Baradlay <[email protected]>
Date: 2026-07-07 (Tue, 07 Jul 2026)
Changed paths:
M Source/WebCore/rendering/BaselineAlignment.cpp
M Source/WebCore/rendering/BaselineAlignment.h
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Track baseline-sharing group membership in RenderFlexibleBox
instead of on BaselineGroup
https://bugs.webkit.org/show_bug.cgi?id=318389
Reviewed by Antti Koivisto.
Of the two baseline alignment clients, only flex reads a baseline-sharing
group's members back: performBaselineAlignment walks each group to position
its items and apply the group's fallback alignment. Grid only ever reads a
group's max ascent, never its members. Yet BaselineGroup held the member set
(a weak set of renderers) for both.
Have RenderFlexibleBox build and keep its own per-line baseline-sharing
groups -- their items and max ascent -- and iterate those when aligning, so it
no longer reads membership off BaselineGroup. BaselineAlignmentState now hands
back the index of the group a subject joins.
No change in behavior.
* Source/WebCore/rendering/BaselineAlignment.h:
* Source/WebCore/rendering/BaselineAlignment.cpp:
(WebCore::BaselineAlignmentState::sharedGroup const):
(WebCore::BaselineAlignmentState::updateSharedGroup):
(WebCore::BaselineAlignmentState::findCompatibleSharedGroup):
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineState::LineState):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::layoutAndPlaceFlexItems):
(WebCore::RenderFlexibleBox::alignFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
Canonical link: https://commits.webkit.org/316689@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications