-
Notifications
You must be signed in to change notification settings - Fork 717
[css-anchor-position-1] Snapshotted scroll offset needs to consider both axis separately #9239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't quite agree. A final fallback might reasonably be to just position in screen space, for example, without reference to any anchor at all, or position relative to a different anchor. Having the element still get shifted to match the scroll offset of the default anchor element seems weird/bad, and That said, I sympathize with the "complicated to check", and you're right that anchor-center positions relative to the anchor without any anchor() functions at all, so something definitely has to change.
In conclusion, yeah I'm totally fine with dropping the condition if we also allow anchor-default to be set in fallback styles. |
Further feedback from the Chrome bug reporter:
So this use case requires us to track the scroll position of the anchor in one axis but not the other, which gets the issue even more complicated. As a result: Updated Proposal: we not only need to keep this condition, generalize it to work with It's getting quite complicated, but I don't see any other way to make it work. Btw, compared to this, I'm still not a fan of reviving the |
anchor()
Afaict, fixed with @xiaochengh's edits in #9347. |
Uh oh!
There was an error while loading. Please reload this page.
(Originally filed as a Chrome bug)
From the current spec, an absolutely positioned element
query el
has a snapshotted scroll offset if:Proposal: See #9239 (comment)
I propose removing the second condition, because:This condition is complicated to check. We need to go through both the base style and all the fallback stylesIt doesn't work with the newanchor-center
alignment keyword, which can be used alone without any explicitanchor()
functionsThis also suggests that the condition isn't future-proof. If we introduce new anchoring syntax in the future, this condition has to grow more complicatedHaving 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 usageThe text was updated successfully, but these errors were encountered: