Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de707c4cdc730b05690ae75247fca553837752c3
      
https://github.com/WebKit/WebKit/commit/de707c4cdc730b05690ae75247fca553837752c3
  Author: Yulun Wu <[email protected]>
  Date:   2026-08-25 (Tue, 25 Aug 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h

  Log Message:
  -----------
  [GFC] Include grid item margins in intrinsic size contributions
https://bugs.webkit.org/show_bug.cgi?id=321662
<rdar://184789473>

Reviewed by Sammy Gill.

Intrinsic size contributions are based on the outer size of the box, but GFC's 
intrinsic
contribution functions returned the grid item's border box size.

https://www.w3.org/TR/css-sizing-3/#outer-size

This PR refactors margin calculations into GridLayoutUtils and updates the 
intrinsic
contribution functions to include the margin.

No behavior change. Grid coverage rejects any grid item whose margin box is not 
entirely
zero, so every contribution grows by zero on trunk today.

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h:
(WebCore::Layout::GridFormattingContext::zoomFactor const): Deleted.
* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::layout):
(WebCore::Layout::GridLayout::computeInlineMargins):
(WebCore::Layout::GridLayout::computeBlockMargins):
(WebCore::Layout::GridLayout::layoutGridItems const):
(WebCore::Layout::computeMarginsForAxis): Deleted.
* Source/WebCore/layout/formattingContexts/grid/GridLayout.h:
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::usedMarginsForAxis):
(WebCore::Layout::GridLayoutUtils::inlineAxisMinContentContribution):
(WebCore::Layout::GridLayoutUtils::inlineAxisMaxContentContribution):
(WebCore::Layout::GridLayoutUtils::blockAxisMinContentContribution):
(WebCore::Layout::GridLayoutUtils::blockAxisMaxContentContribution):
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h:

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



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

Reply via email to