[webkit-changes] [WebKit/WebKit] 5d11fc: [Grid] Incorrect margins used for grid items on re...

Sammy Gill noreply at github.com
Sat Aug 10 17:10:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d11fc8e580bf9265c3b36c374415e17807b6510
      https://github.com/WebKit/WebKit/commit/5d11fc8e580bf9265c3b36c374415e17807b6510
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-08-10 (Sat, 10 Aug 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/GridLayoutFunctions.cpp
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.h

  Log Message:
  -----------
  [Grid] Incorrect margins used for grid items on relayout when computing DefiniteSizeStrategy::minContentForGridItem.
https://bugs.webkit.org/show_bug.cgi?id=260290
rdar://113984882

Reviewed by Alan Baradlay.

In grid-items/percentage-margin-dynamic.html we fail to correctly
recompute the margins as part of the min content size of the grid item
when the constraints are changed. When GridLayoutFunctions::marginLogicalSizeForGridItem
is reached we end up taking the code path that grabs the margins on
the renderer since the renderer was not marked for layout.

To fix this we do two things:
1.) Expand the logic in DefiniteSizeStrategy::minContentForGridItem to
set the overriding containing block size to 0 when the grid item spans
intrinsic sized columns and has either percentage padding or
percentage/auto margins. This is because the size ends up becoming a
cyclic percentage size so these percentages should resolve against 0.
I also added another constraint to make sure that the grid item is
not orthogonal because it does not seem our helper functions seem to
handle these cases.

2.) Have GridLayoutFunctions::marginLogicalSizeForGridItem always
compute the margin values using the grid item's style since we cannot
know if the values on the renderer are stale.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::marginLogicalSizeForGridItem):
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::DefiniteSizeStrategy::minContentForGridItem const):
* Source/WebCore/rendering/GridTrackSizingAlgorithm.h:

Canonical link: https://commits.webkit.org/282092@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list