Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 25b88b1c459a0d652211acc0c5fc20e89caa45a8
      
https://github.com/WebKit/WebKit/commit/25b88b1c459a0d652211acc0c5fc20e89caa45a8
  Author: Sammy Gill <[email protected]>
  Date:   2025-10-06 (Mon, 06 Oct 2025)

  Changed paths:
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h
    A Source/WebCore/layout/formattingContexts/grid/GridItemRect.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h
    M Source/WebCore/layout/formattingContexts/grid/GridTypeAliases.h
    M Source/WebCore/layout/formattingContexts/grid/PlacedGridItem.h
    A Source/WebCore/layout/formattingContexts/grid/UsedTrackSizes.h
    M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp
    M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.h
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  [GFC][Integration] BoxGeometry and render tree geometry need to be updated 
after layout.
rdar://161903602
https://bugs.webkit.org/show_bug.cgi?id=300118

Reviewed by Alan Baradlay.

Now that we have a codepath for the grid layout algorithm, we need to add
some logic that handles the output of this process. This would entail
setting the BoxGeometry for each layout box associated with a grid item
as well as performing the integration step of updating the render tree
in the same way. This patch does so in three main steps:

1.) Return a set of GridItemRects along with the used track sizes from
GridLayout. A GridItemRect is a simple wrapper struct that holds the
border box geometry of the grid item alongside the margins for each
edge. This is done by taking the inline/block axis positions as a result
from alignment, used inline/block axis border box sizes from the final
layout step of grid items, and the margins resolved after we determined
the grid area sizes. Note that the position of these items is in the
coordinate space of its containing block, which is the grid area, and we
choose to map from this space to the coordinate space of the grid box as
part of GridFormattingContext. This is because we do not consider this
logic as strictly part of the grid layout process, so we let the
formatting context handle it. This is why the used track sizes are
needed as an output of layout.

2.) Set the box geometry for each grid item after we have returned from
GridLayout and have performed the step of mapping each location from the
grid area to the grid box. This is a mostly straightforward mapping
from the GridItemRect to box geometry with some small bit of math to to
go from the border box dimensions to the content box dimensions.

3.) Finally, in the integration code, take each grid item's BoxGeometry
and update the associated renderer with the same values. At this point
we also need to perform some final massaging to the formatting context
root in order to integrate properly. Namely, we need to make sure the
RenderGrid's internal grid is marked as not needing placement and also
has its order iterator properly set. This is so that

RenderGrid::paintChildren is happy!
Canonical link: https://commits.webkit.org/301074@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

Reply via email to