[w3ctag/design-reviews] ScrollIntoViewOptions container attribute (Issue #1105)

flackr created an issue (w3ctag/design-reviews#1105)

こんにちは TAG-さん!

I'm requesting a TAG review of the ScrollIntoViewOptions container attribute.

There are many advantages of using scrollIntoView, it is an ergonomically simple way for a developer to request that a particular element is made visible, aligning it within the scroll padding of the scroller and snapping as appropriate.

However, in many circumstances it can be counter-intuitive that a scroll into view call scrolls all ancestor scrollers. E.g. If a slideshow or carousel uses a scrolling box for slides and uses scrollIntoView to advance to the next slide, this will also force the top level scroller to scroll the slideshow into view.

The [container](https://drafts.csswg.org/cssom-view/#dom-scrollintoviewoptions-container) attribute on the [ScrollIntoViewOptions](https://drafts.csswg.org/cssom-view/#dictdef-scrollintoviewoptions) dictionary allows a developer to use scrollIntoView without forcibly scrolling all of the ancestor scrolling containers.

This [demo](https://output.jsbin.com/rihozik) uses the API to show how it helps in practice.

  - Explainer¹: https://github.com/w3c/csswg-drafts/issues/9452
  - Specification: [cssom-view-1 extensions to the element interface](https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface)
  - WPT Tests: https://wpt.fyi/results/css/cssom-view/scrollIntoView-container.html?label=master&label=experimental&aligned
  - User research: N/A
  - Security and Privacy self-review²: N/A
  - GitHub repo: https://github.com/w3c/csswg-drafts/
  - Primary contacts:
      - @flackr, Google, Author
  - Organization/project driving the specification: Google
  - Multi-stakeholder support³:
    - Chromium comments: N/A
    - Mozilla comments: https://github.com/mozilla/standards-positions/issues/1237
    - WebKit comments: https://github.com/WebKit/standards-positions/issues/502
    - Positive feedback on https://github.com/w3c/csswg-drafts/issues/9452 and https://github.com/w3c/csswg-drafts/issues/10451
  - Status/issue trackers for implementations⁴: https://chromestatus.com/feature/5100036528275456

Further details:

  - [X] I have reviewed the TAG's [Web Platform Design Principles](https://www.w3.org/TR/design-principles/)
  - Previous early design review, if any: N/A
  - Relevant time constraints or deadlines: N/A

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1105
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1105@github.com>

Received on Friday, 30 May 2025 15:56:00 UTC