Skip to content

position-area: add behavioral subfeature for auto margins#29280

Merged
caugner merged 1 commit intomdn:mainfrom
ddbeck:position-area-auto-margins
Mar 20, 2026
Merged

position-area: add behavioral subfeature for auto margins#29280
caugner merged 1 commit intomdn:mainfrom
ddbeck:position-area-auto-margins

Conversation

@ddbeck
Copy link
Copy Markdown
Contributor

@ddbeck ddbeck commented Mar 17, 2026

Summary

A specification change to anchor positioning now requires that if a non-none position-area applies to an element, then margin: auto and inset: auto to resolve to 0. This PR captures support for this behavior in a behavior subfeature.

Test results and supporting details

Spec

The spec text is this bullet point:

The used value of any 'auto' inset properties and 'auto' margin properties resolves to '0'.

It followed w3c/csswg-drafts#10258 (comment).

Chrome

According to bug 374574260 (comment #18) Chrome appears to have supported this behavior—or something close it—in its initial anchor positioning implementation. Then the spec changed twice, bringing back this original behavior.

Firefox

The actual support for this comes out of Firefox bug 1997481, though the changes to make the test pass came about in Firefox bug 2006398.

Safari

WebKit bug 300823 tracks this; it was fixed by WebKit/WebKit#52419. I determined the version number where it ultimately shipped from the Safari 26.2 Release Notes.

Related issues

@github-actions github-actions Bot added data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed labels Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@caugner caugner merged commit fcbd3c4 into mdn:main Mar 20, 2026
8 checks passed
@mdn-bot mdn-bot mentioned this pull request Mar 20, 2026
@ddbeck ddbeck deleted the position-area-auto-margins branch March 23, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants