Skip to content

Conversation

Scony
Copy link
Contributor

@Scony Scony commented Nov 15, 2024

a84350e

[css-anchor-position-1] Implement `anchor-center` alignment value
https://bugs.webkit.org/show_bug.cgi?id=275451

Reviewed by Antti Koivisto.

This change implements `anchor-center` CSS value as specified in:
https://drafts.csswg.org/css-anchor-position-1/#anchor-center

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-htb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-vrl-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-htb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-vrl-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::isObjectAncestorContainerOf):
(WebCore::findClosestCommonContainer):
(WebCore::RenderBox::computeAnchorCenteredPosition const):
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::defaultAnchor const):
(WebCore::RenderElement::defaultAnchorRenderer const):
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForGridItem const):
(WebCore::RenderGrid::rowAxisPositionForGridItem const):
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::computeAnchorRectRelativeToContainingBlock):
(WebCore::Style::computeInsetValue):
(WebCore::Style::computeAnchorRectRelativeToContainingBlock): Deleted.
* Source/WebCore/style/AnchorPositionEvaluator.h:

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

01ac09f

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@Scony Scony self-assigned this Nov 15, 2024
@Scony Scony added the Layout and Rendering For bugs with layout and rendering of Web pages. label Nov 15, 2024
@Scony Scony force-pushed the 275451-css-anchoring-anchor-center-implementation branch from e0d9779 to 211995f Compare November 16, 2024 10:32
@nt1m nt1m requested a review from fantasai November 26, 2024 08:09
@Scony Scony force-pushed the 275451-css-anchoring-anchor-center-implementation branch from 211995f to 531df4c Compare November 26, 2024 08:26
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 26, 2024
@Scony Scony removed the merging-blocked Applied to prevent a change from being merged label Nov 26, 2024
@Scony Scony force-pushed the 275451-css-anchoring-anchor-center-implementation branch from 531df4c to 64a220f Compare November 26, 2024 09:46
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 26, 2024
@Scony Scony removed the merging-blocked Applied to prevent a change from being merged label Nov 26, 2024
@Scony Scony force-pushed the 275451-css-anchoring-anchor-center-implementation branch from 64a220f to 68b790b Compare November 26, 2024 11:37
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 26, 2024
@Scony Scony removed the merging-blocked Applied to prevent a change from being merged label Nov 27, 2024
@Scony Scony force-pushed the 275451-css-anchoring-anchor-center-implementation branch from 68b790b to 01ac09f Compare November 27, 2024 18:09
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 27, 2024
@Scony Scony added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Nov 28, 2024
https://bugs.webkit.org/show_bug.cgi?id=275451

Reviewed by Antti Koivisto.

This change implements `anchor-center` CSS value as specified in:
https://drafts.csswg.org/css-anchor-position-1/#anchor-center

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-htb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-htb-vrl-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-htb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-vrl-vrl-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::isObjectAncestorContainerOf):
(WebCore::findClosestCommonContainer):
(WebCore::RenderBox::computeAnchorCenteredPosition const):
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::defaultAnchor const):
(WebCore::RenderElement::defaultAnchorRenderer const):
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForGridItem const):
(WebCore::RenderGrid::rowAxisPositionForGridItem const):
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::computeAnchorRectRelativeToContainingBlock):
(WebCore::Style::computeInsetValue):
(WebCore::Style::computeAnchorRectRelativeToContainingBlock): Deleted.
* Source/WebCore/style/AnchorPositionEvaluator.h:

Canonical link: https://commits.webkit.org/287144@main
@webkit-commit-queue webkit-commit-queue force-pushed the 275451-css-anchoring-anchor-center-implementation branch from 01ac09f to a84350e Compare November 28, 2024 09:20
@webkit-commit-queue
Copy link
Collaborator

Committed 287144@main (a84350e): https://commits.webkit.org/287144@main

Reviewed commits have been landed. Closing PR #36705 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a84350e into WebKit:main Nov 28, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants