Bug 232987

Summary: [css-grid] Transfer size for grid item with an aspect-ratio and stretch alignment against the definite row
Product: WebKit Reporter: zsun
Component: CSSAssignee: zsun
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, esprehn+autocc, ews-watchlist, glenn, jfernandez, kondapallykalyan, pdr, rego, svillar, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

zsun
Reported 2021-11-11 01:45:33 PST
This is similar to bug 231802. Instead of having a percentage of the definite row, the grid item stretches in the block-axis. Affected test - imported/w3c/web-platform-tests/css/css-grid/grid-items/aspect-ratio-004.html
Attachments
Patch (5.88 KB, patch)
2021-11-11 02:05 PST, zsun
no flags
Patch (5.89 KB, patch)
2021-11-11 05:06 PST, zsun
no flags
Patch (6.06 KB, patch)
2021-11-16 03:43 PST, zsun
no flags
zsun
Comment 1 2021-11-11 02:05:15 PST
zsun
Comment 2 2021-11-11 05:06:00 PST
Javier Fernandez
Comment 3 2021-11-12 06:19:19 PST
Comment on attachment 443938 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=443938&action=review > Source/WebCore/rendering/RenderGrid.cpp:965 > + if (autoGridItem->hasStretchedLogicalHeight()) I think a comment here, explaining why we need to apply the stretch alignment, and how it affects the aspect-ratio, would be a good idea. > Source/WebCore/rendering/RenderReplaced.cpp:805 > + return (hasRelativeLogicalHeight() || (isGridItem() && hasStretchedLogicalHeight())) && style().logicalWidth().isAuto(); Do we need to check for isGridItem() ? wouldn't this be relevant for flexbox (the other layout model applying stretch alignment) as well ?
zsun
Comment 4 2021-11-16 03:43:51 PST
zsun
Comment 5 2021-11-16 04:53:00 PST
(In reply to Javier Fernandez from comment #3) > Comment on attachment 443938 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=443938&action=review > > > Source/WebCore/rendering/RenderGrid.cpp:965 > > + if (autoGridItem->hasStretchedLogicalHeight()) > > I think a comment here, explaining why we need to apply the stretch > alignment, and how it affects the aspect-ratio, would be a good idea. > Comments added. > > Source/WebCore/rendering/RenderReplaced.cpp:805 > > + return (hasRelativeLogicalHeight() || (isGridItem() && hasStretchedLogicalHeight())) && style().logicalWidth().isAuto(); > > Do we need to check for isGridItem() ? wouldn't this be relevant for flexbox > (the other layout model applying stretch alignment) as well ? Yes, I think we do need to check for isGridItem(). I have seen a couple of table related tests failures without this check. Tried running WPT flexbox tests with the check (e.g. add (isGridItem() || isFlexItem()) but couldn't see it makes any difference on the test result for flexibox tests.
Javier Fernandez
Comment 6 2021-11-17 15:08:10 PST
Comment on attachment 444370 [details] Patch r=me
EWS
Comment 7 2021-11-18 01:12:59 PST
Committed r285987 (244384@main): <https://commits.webkit.org/244384@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 444370 [details].
Radar WebKit Bug Importer
Comment 8 2021-11-18 01:13:25 PST
Note You need to log in before you can comment on or make changes to this bug.