Re: [csswg-drafts] [css-anchor-position-1] Scroll adjustment doesn't work for chain of anchor-positioned elements (#9071)

This feels similar to nested sticky position. In particular, when you nest a sticky position element within another sticky position element it needs to take into account that it is being shifted by its ancestor sticky position element.

We handle this in chromium by tracking the nearest ancestor which has a dynamic (i.e. sticky position) offset and we always update those ancestors first, then [when calculating the offset applied to the descendant, we first apply the ancestor offset](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/page/scrolling/sticky_position_scrolling_constraints.cc?q=file:third_party%2Fblink%2Frenderer%2Fcore%2Fpage%2Fscrolling%2Fsticky_position_scrolling_constraints.cc%20StickyPositionScrollingConstraints::ComputeStickyOffset&ss=chromium%2Fchromium%2Fsrc).

In this case, it sounds a bit different in that abspos2 isn't normally shifted by abspos1, but the anchor constraint is so a similar approach should work.

This feels like an implementation issue more than a spec issue though, save for perhaps circular anchor positions?

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


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

Received on Tuesday, 7 November 2023 20:42:40 UTC