[csswg-drafts] [css-anchor-position-1] Allow having a snapshotted scroll offset without using `anchor()` (#9239)

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

== [css-anchor-position-1] Allow having a snapshotted scroll offset without using `anchor()` ==
(Originally filed as a [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1473388))

From the current spec, an absolutely positioned element `query el` has a snapshotted scroll offset if:
> - there is a [target anchor element](https://drafts.csswg.org/css-anchor-position-1/#target-anchor-element) given the [default anchor specifier](https://drafts.csswg.org/css-anchor-position-1/#default-anchor-specifier) of query el
> - and at least one [anchor()](https://drafts.csswg.org/css-anchor-position-1/#funcdef-anchor) function on query el refers to the same target anchor element

I propose removing the second condition, because:
1. This condition is complicated to check. We need to go through both the base style and all the fallback styles
2. It doesn't work with the new `anchor-center` alignment keyword, which can be used alone without any explicit `anchor()` functions
   - This also suggests that the condition isn't future-proof. If we introduce new anchoring syntax in the future, this condition has to grow more complicated
3. Having a valid default anchor without actually positioning it against the anchor is a weird/incorrect usage. I don't see much value guarding against such usage

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


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

Received on Thursday, 24 August 2023 21:53:31 UTC