Changeset 285987 in webkit
- Timestamp:
- Nov 18, 2021 1:12:50 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/GridLayoutFunctions.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderGrid.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285984 r285987 1 2021-11-18 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Transfer size for grid item with an aspect-ratio and stretch alignment against the definite row 4 https://bugs.webkit.org/show_bug.cgi?id=232987 5 6 Reviewed by Javier Fernandez. 7 8 * TestExpectations: unskip the test that is now passing. 9 1 10 2021-11-17 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/TestExpectations
r285923 r285987 1396 1396 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-repeat-max-width-001.html [ ImageOnlyFailure ] 1397 1397 1398 imported/w3c/web-platform-tests/css/css-grid/grid-items/aspect-ratio-004.html [ ImageOnlyFailure ]1399 1398 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-inline-contribution-003.html [ ImageOnlyFailure ] 1400 1399 webkit.org/b/231021 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-size-with-orthogonal-child-dynamic.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r285986 r285987 1 2021-11-18 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Transfer size for grid item with an aspect-ratio and stretch alignment against the definite row 4 https://bugs.webkit.org/show_bug.cgi?id=232987 5 6 Reviewed by Javier Fernandez. 7 8 For a grid item with an aspect-ratio, if it has stretch alignment against the definite row, it should 9 try and resolve it if possible and transfer this size into the inline direction for the min/max content 10 size. For the case that the grid width is content sized, we need to update the width before laying out 11 the grid items. Since the min-content contribution of the grid item has changed based on the row sizes 12 calculated in step 2 of sizing algorithm, we also need to repeat the sizing algorithm steps to update 13 the width of the track sizes. 14 15 * rendering/GridLayoutFunctions.cpp: 16 (WebCore::GridLayoutFunctions::isAspectRatioBlockSizeDependentChild): 17 * rendering/RenderGrid.cpp: 18 (WebCore::RenderGrid::updateGridAreaForAspectRatioItems): 19 * rendering/RenderReplaced.cpp: 20 (WebCore::RenderReplaced::needsPreferredWidthsRecalculation const): 21 1 22 2021-11-18 Antoine Quint <graouts@webkit.org> 2 23 -
trunk/Source/WebCore/rendering/GridLayoutFunctions.cpp
r285497 r285987 85 85 bool isAspectRatioBlockSizeDependentChild(const RenderBox& child) 86 86 { 87 return (child.style().hasAspectRatio() || child.hasIntrinsicAspectRatio()) && child.hasRelativeLogicalHeight();87 return (child.style().hasAspectRatio() || child.hasIntrinsicAspectRatio()) && (child.hasRelativeLogicalHeight() || child.hasStretchedLogicalHeight()); 88 88 } 89 89 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r285857 r285987 961 961 populateGridPositionsForDirection(ForRows); 962 962 963 for (auto& autoGridItem : autoGridItems) 963 for (auto& autoGridItem : autoGridItems) { 964 964 updateGridAreaLogicalSize(*autoGridItem, gridAreaBreadthForChildIncludingAlignmentOffsets(*autoGridItem, ForColumns), gridAreaBreadthForChildIncludingAlignmentOffsets(*autoGridItem, ForRows)); 965 // For an item wtih aspect-ratio, if it has stretch alignment that stretches to the definite row, we also need to transfer the size before laying out the grid item. 966 if (autoGridItem->hasStretchedLogicalHeight()) 967 applyStretchAlignmentToChildIfNeeded(*autoGridItem); 968 } 965 969 } 966 970 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r285857 r285987 803 803 { 804 804 // If the height is a percentage and the width is auto, then the containingBlocks's height changing can cause this node to change it's preferred width because it maintains aspect ratio. 805 return hasRelativeLogicalHeight() && style().logicalWidth().isAuto();806 } 807 808 } 805 return (hasRelativeLogicalHeight() || (isGridItem() && hasStretchedLogicalHeight())) && style().logicalWidth().isAuto(); 806 } 807 808 }
Note: See TracChangeset
for help on using the changeset viewer.