RESOLVED FIXED 237628
[css-grid] Subgrid items should always be stretched
https://bugs.webkit.org/show_bug.cgi?id=237628
Summary [css-grid] Subgrid items should always be stretched
Matt Woodrow
Reported 2022-03-08 16:29:00 PST
9.j: The subgrid is always stretched in its subgridded dimension(s): the align-self/justify-self properties on it are ignored, as are any specified width/height constraints. We need to make sure that we always stretch subgrid items, even if it means overriding a specified width/height.
Attachments
Patch (50.67 KB, patch)
2022-03-08 19:29 PST, Matt Woodrow
no flags
Patch (20.76 KB, patch)
2022-03-08 19:54 PST, Matt Woodrow
zalan: review+
Patch for landing (16.98 KB, patch)
2022-03-17 13:51 PDT, Matt Woodrow
mattwoodrow: commit-queue+
Patch for landing (17.30 KB, patch)
2022-03-17 15:42 PDT, Matt Woodrow
no flags
Radar WebKit Bug Importer
Comment 1 2022-03-08 16:29:13 PST
Matt Woodrow
Comment 2 2022-03-08 19:29:42 PST
Matt Woodrow
Comment 3 2022-03-08 19:54:30 PST
EWS Watchlist
Comment 4 2022-03-08 19:56:55 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Tim Nguyen (:ntim)
Comment 5 2022-03-11 01:26:23 PST
Comment on attachment 454188 [details] Patch Upstream WPT doesn't seem happy about some trailing whitespace in your test, can you remove them? See: https://community-tc.services.mozilla.com/tasks/fKANgyH9StmuqxCzp54LiA/runs/0/logs/public/logs/live.log#L108-110
zalan
Comment 6 2022-03-16 20:45:47 PDT
Comment on attachment 454188 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454188&action=review > Source/WebCore/rendering/RenderBox.cpp:2885 > - return style.resolvedJustifySelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; > - return style.resolvedAlignSelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; > + return resolvedJustifySelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; > + return resolvedAlignSelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; I think it's ok to just check/downcast to RenderGrid and run the grid specific code in here. While I personally dislike the way we structure all these different layout systems, I think that's what the current pattern here is (same for width) > Source/WebCore/rendering/RenderGrid.cpp:1208 > + GridTrackSizingDirection childFlowDirection = GridLayoutFunctions::flowAwareDirectionForChild(*this, child, direction); auto? > Source/WebCore/rendering/RenderGrid.cpp:1292 > +{ I'd just early return on a non-grid child. > Source/WebCore/rendering/RenderGrid.cpp:1295 > + GridTrackSizingDirection childBlockDirection = GridLayoutFunctions::flowAwareDirectionForChild(*this, child, ForRows); > + LayoutUnit stretchedLogicalHeight = availableAlignmentSpaceForChildBeforeStretching(GridLayoutFunctions::overridingContainingBlockContentSizeForChild(child, childBlockDirection).value(), child, ForRows); autos
Matt Woodrow
Comment 7 2022-03-17 13:51:23 PDT
Created attachment 455023 [details] Patch for landing
Matt Woodrow
Comment 8 2022-03-17 15:42:14 PDT
Created attachment 455039 [details] Patch for landing
EWS
Comment 9 2022-03-17 19:34:49 PDT
Committed r291464 (248580@main): <https://commits.webkit.org/248580@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455039 [details].
Note You need to log in before you can comment on or make changes to this bug.