Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a5da259342fb2ea31834a8131b5310f5c595978e
      
https://github.com/WebKit/WebKit/commit/a5da259342fb2ea31834a8131b5310f5c595978e
  Author: Elika Etemad <[email protected]>
  Date:   2025-08-13 (Wed, 13 Aug 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-grid-001-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-grid-001-expected.txt
    M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderGrid.h

  Log Message:
  -----------
  [css-anchor-1] anchor() fails to account for grid-area
https://bugs.webkit.org/show_bug.cgi?id=295924
rdar://155823420

Reviewed by Alan Baradlay.

PositionedLayoutConstraints relies on grid area information cached during 
layout,
but we are not in the middle of layout while computing anchor() insets.

This patch revises PositionedLayoutConstraints to call for a direct computation
of the grid area range, and removes all the extra methods that interact with the
now unnecessary out-of-flow grid-area cache.

It also reorders some of the area computation internals to avoid accessing data
that isn't valid prior to layout, see https://commits.webkit.org/298027@main

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-grid-001-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-grid-001-expected.txt:

Pass more tests.

* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::captureGridArea):

Call new API for directly computing grid-area LayoutRange.

* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::layoutOutOfFlowBox):
(WebCore::RenderGrid::columnAxisOffsetForGridItem const):
(WebCore::RenderGrid::rowAxisOffsetForGridItem const):
(WebCore::RenderGrid::gridAreaRangeForOutOfFlow const):
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowGridItem): Deleted.
(WebCore::RenderGrid::logicalOffsetForOutOfFlowGridItem const): Deleted.
(WebCore::RenderGrid::gridAreaRowRangeForOutOfFlow const): Deleted.
(WebCore::RenderGrid::gridAreaColumnRangeForOutOfFlow const): Deleted.
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowGridItem const): Deleted.
(WebCore::RenderGrid::gridAreaPositionForGridItem const): Deleted.
* Source/WebCore/rendering/RenderGrid.h:

Adjust out-of-flow grid-area size computation method to return a LayoutRange,
rename it to gridAreaRangeForOutOfFlow(), and delete all now-unused methods
and data types.

Originally-landed-as: 297834@main (fb8ef69f7e7a). rdar://155823420
Canonical link: https://commits.webkit.org/298644@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to