W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

Re: [csswg-drafts] [css-contain-2] Allow scroll position to be restored when element becomes un-skipped with content-visibility (#5869)

From: vmpstr via GitHub <sysbot+gh@w3.org>
Date: Wed, 13 Jan 2021 21:44:18 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-759757794-1610574256-sysbot+gh@w3.org>
> It seems as though you should be able to query the offset (e.g. scrollTop and scrollLeft) and size (scrollHeight and scrollWidth) forcing a layout if these are no longer fresh. This is similar to querying the bounds of an element within the display locked tree.

I think if we resolve the other issue to not add overflow here, then these can just return 0 (or whatever is the appropriate default without forcing the layout), right?

> When contents change I think we should be as consistent as possible with the behavior where the tree is not locked. I.e. with scroll anchoring we would attempt to anchor to the element at the top of the scroller. I think the same should happen here, where we anchor to the last element that was at the top of the scroller when it was locked.

I think this may be overkill. I agree conceptually that it would be the best thing to do, but the scroll anchoring algorithm is pretty complicated and if we also have to do it on items that are actually not visible (under content-visibility), and not even rendered, I suspect that we would defeat a lot of the optimizations that we can have. WDYT?

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 13 January 2021 21:44:19 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:25 UTC