Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 767e62cbb34461364cbdf59df9af230a7e5893a8
      
https://github.com/WebKit/WebKit/commit/767e62cbb34461364cbdf59df9af230a7e5893a8
  Author: Karl Dubost <[email protected]>
  Date:   2026-08-18 (Tue, 18 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgridded-axis-content-distribution-001-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgridded-axis-content-distribution-001.html
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  Subgrid columns ignore the parent grid's content distribution
https://bugs.webkit.org/show_bug.cgi?id=321024
rdar://184542148

Reviewed by Darin Adler.

A subgrid in a grid that spreads its leftover space between its tracks laid
its own tracks out packed together instead of on the parent's grid lines.
Firefox and Chrome place them on the parent's lines.

A grid keeps its content distribution as two numbers: one shift before the
first track, one added after every track.
computeContentPositionAndDistributionOffset() returned both as zero for a
subgridded axis. Zero is right for the shift, already in our border box
position, and wrong for the per-track offset, which nothing else put back.

Fix by inheriting the parent's per-track offset, keeping the shift at zero.

A subgrid that declares its own gap is a separate defect, not fixed here.

Test: 
imported/w3c/web-platform-tests/css/css-grid/subgrid/subgridded-axis-content-distribution-001.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgridded-axis-content-distribution-001-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgridded-axis-content-distribution-001.html:
 Added.
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset const):

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



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

Reply via email to