[webkit-reviews] review granted: [Bug 237628] [css-grid] Subgrid items should always be stretched : [Attachment 454188] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 20:45:47 PDT 2022


zalan <zalan at apple.com> has granted Matt Woodrow <mattwoodrow at apple.com>'s
request for review:
Bug 237628: [css-grid] Subgrid items should always be stretched
https://bugs.webkit.org/show_bug.cgi?id=237628

Attachment 454188: Patch

https://bugs.webkit.org/attachment.cgi?id=454188&action=review




--- Comment #6 from zalan <zalan at apple.com> ---
Comment on attachment 454188
  --> https://bugs.webkit.org/attachment.cgi?id=454188
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::overriding
ContainingBlockContentSizeForChild(child, childBlockDirection).value(), child,
ForRows);

autos


More information about the webkit-reviews mailing list