We need to recalculate grid's auto repeat columns when the width/height of containing block changes. The grid has relative width/height to the containing block.
Created attachment 440196 [details] Patch
Created attachment 440205 [details] Patch
Created attachment 440599 [details] Patch
Comment on attachment 440599 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440599&action=review > Source/WebCore/rendering/RenderBox.cpp:1099 > + return style().paddingStart().isPercentOrCalculated() || style().paddingEnd().isPercentOrCalculated() || (isRenderGrid() && hasRelativeLogicalWidth()) || (style().hasAspectRatio() && (hasRelativeLogicalHeight() || (isFlexItem() && hasStretchedLogicalHeight()))); If you make a RenderGrid::needsPreferredWidthsRecalculation you can get rid of the isRenderGrid check and keep this simpler.
Created attachment 440770 [details] Patch
Comment on attachment 440770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440770&action=review > Source/WebCore/rendering/RenderGrid.h:209 > + bool needsPreferredWidthsRecalculation() const final; Nit: in WebKit we keep the member vars and methods separate. In this case the method should go directly below aspectRatioPrefersInline.
Created attachment 440775 [details] Patch
<rdar://problem/84141634>
I recall that we had an internal discussion with Javier on this patch and the solution here was not ideal. Make the patch as obselete.