Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 810cb2deb1447536eab4490c6cde79ebd227a04e
https://github.com/WebKit/WebKit/commit/810cb2deb1447536eab4490c6cde79ebd227a04e
Author: Elika Etemad <[email protected]>
Date: 2026-01-08 (Thu, 08 Jan 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/computed-grid-column-expected.txt
M LayoutTests/platform/mac/TestExpectations
M Source/WebCore/rendering/GridLayoutFunctions.cpp
M Source/WebCore/rendering/GridLayoutFunctions.h
M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
M Source/WebCore/rendering/RenderBlock.cpp
M Source/WebCore/rendering/RenderBlock.h
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderBox.h
M Source/WebCore/rendering/RenderBoxInlines.h
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
M Source/WebCore/rendering/RenderGrid.cpp
M Source/WebCore/rendering/RenderGrid.h
M Source/WebCore/style/values/grid/StyleGridTrackSizingDirection.h
Log Message:
-----------
Untangle grid self-alignment code
https://bugs.webkit.org/show_bug.cgi?id=304717
rdar://167221679
Reviewed by Sammy Gill.
This patch untangles the self-alignment code for grid containers by:
- Consolidating self-alignment getters into a single method, so that each
place where it's needed uses consistent logic and special cases are
always handled instead of sometimes forgotten.
- Redesigning the API for checking stretch alignment so that we encapsulate
logic that varies per formatting context within the formatting context
instead of making RenderBox contain logical specific to its subclasses.
This is Part 2 of a refactoring stack for grid-lanes item sizing (bug 304715).
* LayoutTests/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::hasStretchableSizeInColumnAxis):
(WebCore::GridLayoutFunctions::hasStretchableSizeInRowAxis):
(WebCore::GridLayoutFunctions::hasAutoSizeInColumnAxis): Deleted.
(WebCore::GridLayoutFunctions::hasAutoSizeInRowAxis): Deleted.
(WebCore::GridLayoutFunctions::allowedToStretchGridItemAlongColumnAxis):
Deleted.
(WebCore::GridLayoutFunctions::allowedToStretchGridItemAlongRowAxis): Deleted.
* Source/WebCore/rendering/GridLayoutFunctions.h:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForGridItem const):
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willStretchItem const):
* Source/WebCore/rendering/RenderBlock.h:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::isStretchingColumnFlexItem const):
(WebCore::RenderBox::sizesPreferredLogicalWidthToFitContent const):
(WebCore::RenderBox::shouldComputeLogicalHeightFromAspectRatio const):
(WebCore::RenderBox::columnFlexItemHasStretchAlignment const): Deleted.
(WebCore::RenderBox::hasStretchedLogicalHeight const): Deleted.
(WebCore::RenderBox::hasStretchedLogicalWidth const): Deleted.
* Source/WebCore/rendering/RenderBox.h:
(WebCore::RenderBox::selfAlignmentNormalBehavior const): Deleted.
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::RenderBox::hasStretchedLogicalHeight const):
(WebCore::RenderBox::hasStretchedLogicalWidth const):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::willStretchItem const):
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::selfAlignmentForGridItem const):
(WebCore::RenderGrid::selfAlignmentChangedToStretch const):
(WebCore::RenderGrid::selfAlignmentChangedFromStretch const):
(WebCore::RenderGrid::styleDidChange):
(WebCore::RenderGrid::canSetColumnAxisStretchRequirementForItem const):
(WebCore::RenderGrid::computeLayoutRequirementsForItemsBeforeLayout const):
(WebCore::RenderGrid::willStretchItem const):
(WebCore::RenderGrid::aspectRatioPrefersInline):
(WebCore::RenderGrid::applyStretchAlignmentToGridItemIfNeeded):
(WebCore::RenderGrid::isBaselineAlignmentForGridItem const):
(WebCore::RenderGrid::baselineGridItem const):
(WebCore::RenderGrid::columnAxisPositionForGridItem const):
(WebCore::RenderGrid::rowAxisPositionForGridItem const):
(WebCore::RenderGrid::columnAxisOffsetForGridItem const):
(WebCore::RenderGrid::rowAxisOffsetForGridItem const):
(WebCore::RenderGrid::alignSelfForGridItem const): Deleted.
(WebCore::RenderGrid::justifySelfForGridItem const): Deleted.
* Source/WebCore/rendering/RenderGrid.h:
* Source/WebCore/style/values/grid/StyleGridTrackSizingDirection.h:
(WebCore::Style::logicalAxis):
(WebCore::Style::gridTrackSizingDirection):
Canonical link: https://commits.webkit.org/305260@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications