Skip to content

[css-anchor-position-1] Ignore auto margins in combination with position-area and anchor-center - #55460

Merged
fantasai merged 1 commit into
web-platform-tests:masterfrom
fantasai:position-area-margin-auto
Oct 30, 2025
Merged

[css-anchor-position-1] Ignore auto margins in combination with position-area and anchor-center#55460
fantasai merged 1 commit into
web-platform-tests:masterfrom
fantasai:position-area-margin-auto

Conversation

@fantasai

Copy link
Copy Markdown
Contributor

Because the HTML stylesheet for popovers used margins instead of alignment in order to do centering, margin: auto had to be sacrificed. See
w3c/csswg-drafts#10258

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fantasai
fantasai marked this pull request as draft October 15, 2025 19:38
@fantasai
fantasai force-pushed the position-area-margin-auto branch 2 times, most recently from 7779161 to 2b66c7f Compare October 15, 2025 21:22
@fantasai
fantasai force-pushed the position-area-margin-auto branch from 2b66c7f to 2be81a5 Compare October 16, 2025 04:17
@fantasai
fantasai marked this pull request as ready for review October 16, 2025 04:24
@fantasai
fantasai requested a review from a team as a code owner October 16, 2025 04:24

@nt1m nt1m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the recent spec resolution: w3c/csswg-drafts#10258

cc @dshin-moz @emilio @tabatkins @bfgeek in case they want to review the test

webkit-commit-queue pushed a commit to fantasai/WebKit that referenced this pull request Oct 16, 2025
…sition-1]

https://bugs.webkit.org/show_bug.cgi?id=300823

Reviewed by Alan Baradlay.

Converts auto margins to zero when position-area or anchor-center is in effect.
See w3c/csswg-drafts#10258

Tests: imported/w3c/web-platform-tests/css/css-anchor-position/auto-margins-position-area.html
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/auto-margins-position-area.html: Rewritten.
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/auto-margins-position-area-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/auto-margins-position-area-ref.html: Added.

web-platform-tests/wpt#55460

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

Canonical link: https://commits.webkit.org/301662@main
philwo pushed a commit to philwo/chromium that referenced this pull request Oct 24, 2025
In a somewhat roundabout fashion, the CSSWG resolved on our previous
behaviour of disabling auto margins. See:
w3c/csswg-drafts#10258 (comment)

Tests are in a pending WPT pull:
web-platform-tests/wpt#55460

Bug: 374574260
Change-Id: I477270f55449fa0009dc3c4fd0328b3446724119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7064142
Auto-Submit: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1535372}
@fantasai
fantasai enabled auto-merge (rebase) October 30, 2025 05:34
@fantasai
fantasai disabled auto-merge October 30, 2025 05:34
@fantasai
fantasai force-pushed the position-area-margin-auto branch from 2be81a5 to e283b4a Compare October 30, 2025 16:33
@fantasai
fantasai enabled auto-merge (rebase) October 30, 2025 16:34
…ion-area and anchor-center

Because the HTML stylesheet for popovers used margins instead of alignment
in order to do centering, margin: auto had to be sacrificed. See
  w3c/csswg-drafts#10258
@fantasai
fantasai force-pushed the position-area-margin-auto branch from e283b4a to 4f803cb Compare October 30, 2025 21:49
@fantasai
fantasai merged commit e2c9adc into web-platform-tests:master Oct 30, 2025
22 checks passed
jmajnert pushed a commit to jmajnert/chromium that referenced this pull request Nov 6, 2025
In a somewhat roundabout fashion, the CSSWG resolved on our previous
behaviour of disabling auto margins. See:
w3c/csswg-drafts#10258 (comment)

Tests are in a pending WPT pull:
web-platform-tests/wpt#55460

Bug: 374574260
Change-Id: I477270f55449fa0009dc3c4fd0328b3446724119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7064142
Auto-Submit: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1535372}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants