[Webkit-unassigned] [Bug 191627] [css-grid] Incorrect track sizing when using relative sized items in 'auto' column tracks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 23 15:13:49 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=191627

--- Comment #4 from Javier Fernandez <jfernandez at igalia.com> ---
The root cause of this bug seems that we have an incorrect implementation of  RenderBox::containingBlockLogicalWidthForContent method for grid items (probably flex items too) with relative size.

The case is especially noticeable with orthogonal flows (vertical items), since the grid container's width is always definite (resolving the intrinsic width if needed), so that the grid item's logical height is based on the container's definite width (wrongly, as I'll explain now).

For grid items, the containing block shouldn't be the grid container, but the grid area it's located in. During the GridTrackSizingAlgorithm, we determine that this item has a relative size (percent in this case) and that the grid area is still indefinite (auto column track). Hence, we set nullopt for the grid area width and mark the item for layout. 

During the item's layout, we call this RenderBox::containingBlockLogicalWidthForContent to determine the available height. However, this method checks the containing block width's if the overridingContentLogicalWidth is nullopt, like in this case. This is incorrect for grid items; we should never use the grid container for resolving grid item's size.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210223/a7afdc70/attachment-0001.htm>


More information about the webkit-unassigned mailing list