Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d820e29f6f554d387152d87e5008926328b13092
https://github.com/WebKit/WebKit/commit/d820e29f6f554d387152d87e5008926328b13092
Author: Sammy Gill <[email protected]>
Date: 2025-10-03 (Fri, 03 Oct 2025)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayout.h
M Source/WebCore/layout/formattingContexts/grid/PlacedGridItem.cpp
M Source/WebCore/layout/formattingContexts/grid/PlacedGridItem.h
Log Message:
-----------
[GFC] Add initial alignment support with start alignment.
https://bugs.webkit.org/show_bug.cgi?id=300058
rdar://problem/161856764
Reviewed by Alan Baradlay.
This patch adds the overall logic that we will use to support aligning
grid items after we have determined their sizes. Note that since
alignment is done with respect to the grid area, which acts as the
containing block for the grid item, the border box position that is
returned will be in the coordinate space of the grid area.
With this patch, we only support start alignment for the flex items, so
there is realistically no movement that is needed for the grid item's
margin box, so the final border box position will just be the same as
the value of the top margin. In order to support other alignment values,
we will likely need the size of the grid area along with the border box
dimensions of the grid item.
* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::constructPlacedGridItems const):
In order to perform alignment, we will need the align-self and
justify-self values for the grid item. If the value for this property is
not auto, then that is the value that will be used; otherwise, we refer to
the value of align-items/justify-items on the grid.
* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::layout):
(WebCore::Layout::GridLayout::performInlineAxisSelfAlignment):
(WebCore::Layout::GridLayout::performBlockAxisSelfAlignment):
The basic idea between these two functions is the same: first, we need to
find out what the margin box position will be to satisfy the needs of
the alignment value, and from there, we can just add in the start margin
to get the final position of the item's border box. Since the most basic
version of start alignment (without considering any sort of safety) does
not move the item from the start of the grid area, we can just return a
value of 0 to indicate that it is at the start of the grid area.
Canonical link: https://commits.webkit.org/300961@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes