Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ee553c43b364439656fe9eb00616b8167c8d103a
      
https://github.com/WebKit/WebKit/commit/ee553c43b364439656fe9eb00616b8167c8d103a
  Author: Sammy Gill <[email protected]>
  Date:   2022-12-04 (Sun, 04 Dec 2022)

  Changed paths:
    M Source/WebCore/rendering/GridMasonryLayout.cpp
    M Source/WebCore/rendering/GridMasonryLayout.h
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderGrid.h
    M Source/WebCore/rendering/style/GridPositionsResolver.h

  Log Message:
  -----------
  Move masonry logic from RenderGrid to GridMasonryLayout.
https://bugs.webkit.org/show_bug.cgi?id=248621
rdar://102871735

Reviewed by Tim Nguyen.

This is a somewhat small refactor that involes moving some masonry
specific logic from RenderGrid to GridMasonryLayout. The intial goal was
to remove only collectMasonryItems so that GridMasonryLayout could
hold onto the items directly, but it became pretty clear that some of
the other logic in the surrounding area could also be moved. This should
hopefully have 2 benefits:

1.) Make RenderGrid much more simple and easier to read when we need to
do a masonry layout (since much of the responsibility should be moved)
2.) Allow GridMasonryLayout to much more easily query the masonry item
data structures without having to pass references around everywhere.
This is especially useful if we ever need to check if an item is a
first track item.

There should be no functionality change with this patch.

* Source/WebCore/rendering/GridMasonryLayout.cpp:
(WebCore::GridMasonryLayout::performMasonryPlacement):
(WebCore::GridMasonryLayout::collectMasonryItems):
(WebCore::GridMasonryLayout::allocateCapacityForMasonryVectors):
(WebCore::GridMasonryLayout::placeItemsWithDefiniteGridAxisPosition):
(WebCore::GridMasonryLayout::setItemGridAxisContainingBlockToGridArea):
(WebCore::GridMasonryLayout::nextMasonryPositionForItem):
(WebCore::GridMasonryLayout::gridAxisDirection const):
* Source/WebCore/rendering/GridMasonryLayout.h:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::allocateSpaceForMasonryVectors): Deleted.
(WebCore::itemGridAreaStartsAtFirstLine): Deleted.
(WebCore::itemGridAreaIsWithinImplicitGrid): Deleted.
(WebCore::RenderGrid::collectMasonryItems const): Deleted.
* Source/WebCore/rendering/RenderGrid.h:
* Source/WebCore/rendering/style/GridPositionsResolver.h:
(WebCore::GridPositionsResolver::gridAxisDirection): Deleted.

Canonical link: https://commits.webkit.org/257358@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to