[css-contain-2] Allow scroll position to be restored when element becomes un-skipped with content-visibility

Open
#5,869 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
css
Domain
frontend, web-dev

Research direction

Start by reading this issue alongside #5868 and the CSS Containment Level 2 definition of skipped contents. Determine the intended scroll-offset behavior when content-visibility hides and later reveals an element, then document a resolved specification change that preserves the position without contradicting overflow behavior. The issue is over five years old and has no linked implementation.

Written by the indexing model from the issue text.

Description

css-contain-2

This depends on #5868. If we agree that skipped contents should not contribute to the overflow (i.e. that the scroll thumb does not indicate size of content), then it would still be nice if we allow for that scroll position to be restored when the element is un-hidden.

The current spec compliant behavior (if #5868 is resolved not to include contents in overflow) would cause the scroll offset to be essentially reset when the element is hidden via content-visibility and then shown again. This is not as ergonomic for developers as it could be.

Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.