Re: [csswg-drafts] [css-anchor-position-1] Ability to opt-out of transforms affecting anchor positioning (#13782)

Another use case. Anchor positioning can be pretty powerful for creating a pseudo `LayoutObserver` type pattern where connecting anchors to a root element and a target at the top left corner of each recreates the targets missing DOMRect x,y in render loop without layout invalidations by listening to resize events on some anchored element created between them (along with the target for w,h. By taking into account transforms, this invalidates the logic because it no longer correlates to the border-box of the target. This is already how resize observer behaves (does not account for transforms) so mirroring that functionality by not accounting for transforms is desired for the anchored element.

I’m surprised this was chosen as the default given how transforms are handled. This feels like it should have been refined and opted into as a possible performance loss (i.e. `anchor(—a start bounding-box)`). Then you could also open up the anchoring API to handle what box the anchor is applied to in general (border/content/padding). Not sure if that has been discussed. I think it would have to be per anchor though.

-- 
GitHub Notification of comment by mgmolisani
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13782#issuecomment-4229738224 using your GitHub account


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

Received on Saturday, 11 April 2026 16:13:50 UTC