Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: abd75430aa54d1b777ea7e167343c51361d64aab
      
https://github.com/WebKit/WebKit/commit/abd75430aa54d1b777ea7e167343c51361d64aab
  Author: Sammy Gill <[email protected]>
  Date:   2026-06-26 (Fri, 26 Jun 2026)

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

  Log Message:
  -----------
  [GFC] Extract hasStretchedBlockSize and stretchedBlockSize helpers in 
GridLayoutUtils
https://bugs.webkit.org/show_bug.cgi?id=317885
rdar://180664653

Reviewed by Brandon Stewart.

Pull the block-axis stretch-fit computation out of usedBlockSizeForGridItem into
two standalone helpers. This is a behavior-preserving refactor that lets the
stretched block size be queried on its own, separately from the full
used-block-size logic.

hasStretchedBlockSize() captures the condition under which a grid item is sized
as align-self: stretch in the block axis (auto preferred size, normal alignment,
not replaced, no preferred aspect ratio, and non-auto margins). 
stretchedBlockSize()
computes the stretch-fit size exactly as the previous inline code did: the row
size minus margins and border/padding, clamped by the item's max size.
usedBlockSizeForGridItem() now calls these helpers instead of open-coding the
computation.

* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::hasStretchedBlockSize): Added.
(WebCore::Layout::GridLayoutUtils::stretchedBlockSize): Added.
(WebCore::Layout::GridLayoutUtils::usedBlockSizeForGridItem): Use the new 
helpers.
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h:

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



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

Reply via email to