Update reset and position-anchor:auto information relating to implicit anchor association - #45550
Conversation
|
Preview URLs (5 pages)
External URLs (7)URL:
URL:
URL: (comment last updated: 2026-09-08 08:41:09) |
|
Hi @chrisdavidmills, On your note about needing
So I don't think the resets are what breaks it. With I wrote about this with the spec quotes and some suggested prose in #45514 . Happy for it to be folded in here or handled separately. |
|
Sorry, I missed your update before posting. Glad it's clear now. |
@arpit-agr no worries at all — thanks for the detailed info; it saved me a lot of time. This PR is now ready for review, and should fix both issues. |
Description
In our docs, we've included information about having to reset the default values set on popover elements, such as inset and margin property values, so that they don't break attempts to position popovers using
anchor()/position-area/anchor-center.However, as per #45515, the default behavior has been updated so that the need for these resets is avoided, except for the
anchor()cases. In addition, #45514 points out thatposition-anchor: autois needed to opt-in to the association, in theanchor()cases.This PR attempts to update our information so that it is no longer out of date.
I wrote some quick demos to test the updated behavior:
anchor(): https://codepen.io/editor/Chris-Mills/pen/01a07b77-d3a7-7f58-b78a-3265437f0047position-area: https://codepen.io/editor/Chris-Mills/pen/01a07b9e-73d6-75a9-a056-c5b91edadcb4anchor-center: https://codepen.io/editor/Chris-Mills/pen/01a07b83-0beb-74da-b0c1-cf4f5f566331Note: Another thing I noticed — even though popovers and their control buttons are meant to have implicit association, meaning that you shouldn't need to associate them with-- Update: I've now read the other issue and am now clear on what is going on here. I will fix both in this PR ;-)anchor-name/position-anchor, it seems like I needed to setposition-anchor: autoin cases where I was doing resets to make the anchor positioning work. I was surprised by this, and I'm not 100% sure what I should say about it in the docs. This is maybe something @mfreed7 could advise me on.See also mdn/dom-examples#396 for a related demo fix.
Motivation
Additional details
Related issues and pull requests
Fixes #45515
Fixes #45514