[csswg-drafts] [css-anchor-position] fallback-position behavior: spec vs. expectation (#12682)

meyerweb has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-anchor-position] fallback-position behavior: spec vs. expectation ==
In recent experiments with thumb sliders and anchor positioning, I discovered that Chrome 139 and Safari Technology Preview 226 (the latest as I write this) behave differently on the following testcase:

https://codepen.io/meyerweb/pen/jEbpgEj

For clarity’s and posterity’s sake, here are videos of both behaviors:

* Chrome: https://github.com/user-attachments/assets/e730e30d-be9f-4ed0-a07f-3aaaa05604f7
* Safari: https://github.com/user-attachments/assets/930201e5-8a64-441c-be3b-02d2865059ac

I put up [a quick Mastodon poll](https://mastodon.social/@Meyerweb/115106404124445073), and people who saw it and voted preferred the Safari behavior by about 5:1.  It’s also what [the Oddbird anchoring polyfill](https://github.com/oddbird/css-anchor-positioning) does, I’m told.  I was ALSO told that Chrome is doing what the spec calls for, as per https://drafts.csswg.org/css-anchor-position-1/#last-successful-position-option.

I know well that polls are no guarantee of capturing reality, but I think it’s worth discussing whether A) the default behavior should or should not be changed to match Safari’s; and B) there should be a property or keyword that lets authors choose which of those behaviors they get, regardless of what we think about issue A.

I also have concerns around how (or if) fallbacks should provide ways to handle overlap of anchored elements once a fallback is invoked, but I’m not sure that discussion belongs in this issue.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12682 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 29 August 2025 17:19:34 UTC