Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac8f2d360bbdd3aff75e5df8666ea6a4280d4576
      
https://github.com/WebKit/WebKit/commit/ac8f2d360bbdd3aff75e5df8666ea6a4280d4576
  Author: Yulun Wu <[email protected]>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

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

  Log Message:
  -----------
  [GFC] Add a columns-only fast path for intrinsic width computation
https://bugs.webkit.org/show_bug.cgi?id=319294
<rdar://182131247>

Reviewed by Sammy Gill.

GridFormattingContext::computeIntrinsicWidths() only needs the grid's
column track sizes, but it obtained them by running the full grid layout
(GridLayout::layout) once per intrinsic scenario. That full path also
sizes the rows, lays out every grid item, and computes margins,
alignment, and item rects — all of which are discarded when only the
column sizes are read.

Not all of the work needs to be done for every grid layout. A grid with items
that do not depend on their block size when computing inline contributions
does not require all of layout, and we can instead finish with just the first 
step
of the grid sizing algorithm.

Spec:

https://www.w3.org/TR/css-grid-2/#algo-grid-sizing

See also:

https://commits.webkit.org/317063@main

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::computeIntrinsicWidths):
* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::layout):
* Source/WebCore/layout/formattingContexts/grid/GridLayout.h:

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



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

Reply via email to