[csswg-drafts] [css-anchor-1] Need ability to say "don't render" when anchor is off-screen (#7758)

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

== [css-anchor-1] Need ability to say "don't render" when anchor is off-screen ==
Consider: an anchor is inside of a scroll container. The positioned element is outside of the scroll container. This is legit if you want the positioned element, when visible, to be able to project outside of the scrollable area, such as into the margin.

However, this then means that if the anchor is scrolled outside of the scrollport, the positioned element just hovers above or below the scroll container, wherever the anchor is theoretically positioned. That is *almost certainly* not what you want!

So we should have some way to specify that if the anchor is off-screen, the positioned element should hide itself.

Questions:
* What does "hide itself" mean? display:none? visibility:hidden? I suspect just visibility should be used, so it still has a meaningful position and can, say, be scrollIntoView()'d.
* What anchor do we care about if you use multiple anchors? I think the right answer might be if *any* anchor is off-screen it should trigger.
* Does this need to be controllable? This probably needs to activate by default, but are there good reasons to have an anchored element continue to show up when its anchor is off-screen?
* Maybe this only activates when there is a scroll container between the anchor and the positioned element? When the positioned element is inside the same scroll container, it'll hide itself naturally due to the scroller, and being able to show up as you scroll *near* the anchor (rather than suddenly popping in when the anchor comes on-screen) seems good. 

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


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

Received on Friday, 16 September 2022 19:20:47 UTC