You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[css-anchor-position-1] Implement position-area in CSS grids
https://bugs.webkit.org/show_bug.cgi?id=290075
rdar://147452098
Reviewed by Alan Baradlay.
Integrates grid-area handling and grid container static posititions with
position-area calculations in PositionedLayoutConstraints, and updates
callers of containingBlockLogical*ForPositioned to use this full logic.
Cosmetic fixes:
* Clarify what the LogicalBoxAxis argument to the constructor represents.
* Update some comments and add section markers.
* Rename computeAnchorGeometry for consistency with other methods.
* Organize static position computation under a single primary method.
* Reorganize data members of PositionedLayoutConstraints into 3 sections:
1. Data about the box and container.
2. Containing block geometry.
3. Box geometry properties.
because the previous split about data mutability no longer is accurate.
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-in-grid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-area-in-grid.html:
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::PositionedLayoutConstraints):
(WebCore::PositionedLayoutConstraints::captureInsets):
(WebCore::PositionedLayoutConstraints::captureGridArea):
(WebCore::PositionedLayoutConstraints::captureAnchorGeometry):
(WebCore::PositionedLayoutConstraints::computeStaticPosition):
(WebCore::PositionedLayoutConstraints::computeInlineStaticDistance):
(WebCore::PositionedLayoutConstraints::computeBlockStaticDistance):
(WebCore::PositionedLayoutConstraints::computeAnchorGeometry): Deleted.
* Source/WebCore/rendering/PositionedLayoutConstraints.h:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
(WebCore::RenderBox::availableLogicalHeightUsing const):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::gridAreaColumnRangeForOutOfFlow const):
(WebCore::RenderGrid::gridAreaPositionForInFlowGridItem const):
(WebCore::RenderGrid::gridAreaPositionForGridItem const):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowGridItem const): Deleted.
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowGridItem const): Deleted.
* Source/WebCore/rendering/RenderGrid.h:
Canonical link: https://commits.webkit.org/293946@main
// Capture the anchor geometry and adjust for position-area.
81
+
captureAnchorGeometry(renderer);
79
82
80
-
if (logicalAxis == LogicalBoxAxis::Inline)
81
-
computeInlineStaticDistance(renderer);
82
-
else
83
-
computeBlockStaticDistance(renderer);
83
+
// Cache insets and margins, etc.
84
+
captureInsets(renderer, selfAxis);
85
+
86
+
if (m_useStaticPosition)
87
+
computeStaticPosition(renderer, selfAxis);
84
88
89
+
if (containingCoordsAreFlipped()) {
90
+
// Ideally this check is incorporated into captureInsets() but currently it needs to happen after computeStaticPosition() because containingCoordsAreFlipped() depends on m_useStaticPosition.
0 commit comments