Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 71dd28731234f14bdd1b184c1c5c7b3d0040b484
      
https://github.com/WebKit/WebKit/commit/71dd28731234f14bdd1b184c1c5c7b3d0040b484
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-grid-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-grid.html
    M Source/WebCore/rendering/RenderGrid.h
    M Source/WebCore/style/StyleExtractorCustom.h

  Log Message:
  -----------
  getComputedStyle for an out-of-flow grid item's auto inset is resolved 
against the grid container padding box instead of the grid area
https://bugs.webkit.org/show_bug.cgi?id=323524
rdar://186767196

Reviewed by Sammy Gill.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

The containing block of an absolutely-positioned grid item is its grid
area, not the grid container's padding box. When resolving the used value
of an `auto` inset in getComputedStyle, however, we measured the offset
from the grid container's padding box (via offsetLeft/offsetTop), so an
item placed at e.g. `grid-column: 2` reported `left: 100px` instead of
`left: 0px`.

Resolve the inset against the grid area instead. The grid already exposes
each out-of-flow item's grid area as logical track ranges via
gridAreaRangeForOutOfFlow(); make that helper public so the inset
extractor can consume it, keeping RenderGrid's API in logical coordinates
and consistent with the existing accessor. The extractor maps each
physical axis to its grid direction, applies the inline- and block-axis
flips to build the physical grid area rectangle (relative to the grid
container's border box), and subtracts the grid area's edges (relative to
the padding box origin) from the item's margin-edge offset.

Extend the imported WPT test to cover all four insets across LTR, RTL,
vertical-lr, vertical-rl and sideways-lr writing modes (the last covers
an inline-axis flip on the block-direction physical axis).

* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-grid.html:
 Extend coverage.
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-grid-expected.txt:
 Progression.
* Source/WebCore/rendering/RenderGrid.h: Make gridAreaRangeForOutOfFlow() 
public.
* Source/WebCore/style/StyleExtractorCustom.h:
(WebCore::Style::InsetEdgeSharedAdaptor::computedValue const):

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



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

Reply via email to