[webkit-changes] [WebKit/WebKit] 8b3d5c: [masonry] Fix masonry-intrinsic-sizing-rows-001 an...
Brandon Stewart
noreply at github.com
Mon Oct 7 15:31:36 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8b3d5cdb5a618ea5d7b325d2dfe73b4f9e134f60
https://github.com/WebKit/WebKit/commit/8b3d5cdb5a618ea5d7b325d2dfe73b4f9e134f60
Author: Brandon Stewart <brandonstewart at apple.com>
Date: 2024-10-07 (Mon, 07 Oct 2024)
Changed paths:
M LayoutTests/TestExpectations
A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-rows-007-expected.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-rows-007-ref.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-rows-007.html
M Source/WebCore/rendering/GridMasonryLayout.cpp
M Source/WebCore/rendering/GridMasonryLayout.h
M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderBox.h
M Source/WebCore/rendering/RenderGrid.cpp
M Source/WebCore/rendering/RenderGrid.h
Log Message:
-----------
[masonry] Fix masonry-intrinsic-sizing-rows-001 and masonry-intrinsic-sizing-rows-006
https://bugs.webkit.org/show_bug.cgi?id=279455
rdar://problem/135736934
Reviewed by Sammy Gill.
There were two main issues to tackle in this PR.
1. Incorrect sizing of grids.
The grid with was not being calculated correctly. I added support for running the
track sizing algorithm when masonry is in the row direction when calculating the intrinsic logical widths.
We can place the items using their min/max-cotents to get the min/max-content of the grid.
2. Failure to stretch items inside grid.
Items were not being stretched, which appears to be due to an extra check in sizesLogicalWidthToFitContent.
We can remove this check.
* LayoutTests/TestExpectations:
* Source/WebCore/rendering/GridMasonryLayout.cpp:
(WebCore::GridMasonryLayout::performMasonryPlacement):
(WebCore::GridMasonryLayout::placeItemsUsingOrderModifiedDocumentOrder):
(WebCore::GridMasonryLayout::placeItemsWithDefiniteGridAxisPosition):
(WebCore::GridMasonryLayout::placeItemsWithIndefiniteGridAxisPosition):
(WebCore::GridMasonryLayout::setItemGridAxisContainingBlockToGridArea):
(WebCore::GridMasonryLayout::insertIntoGridAndLayoutItem):
* Source/WebCore/rendering/GridMasonryLayout.h:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForGridItem const):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutMasonry):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::isMasonry const):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::updateGridAreaForAspectRatioItems):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutMasonryItems):
(WebCore::RenderGrid::populateGridPositionsForDirection):
Correctly sizes the last track in the masonry direction. The track was previously stuck pointing
at the first item.
(WebCore::RenderGrid::getBaselineGridItem const):
* Source/WebCore/rendering/RenderGrid.h:
Canonical link: https://commits.webkit.org/284790@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list