Re: [csswg-drafts] [cssom-view] scrollIntoView container spec unclear (#12260)

Thanks!

The wording here is still a bit confusing for me:

> To scroll a target into view target, which is an [Element](https://dom.spec.whatwg.org/#concept-element), [pseudo-element](https://drafts.csswg.org/selectors-4/#pseudo-element), or [Range](https://dom.spec.whatwg.org/#concept-range), with a scroll behavior behavior, a block flow direction position block, an inline base direction position inline, and an optional containing [Element](https://dom.spec.whatwg.org/#concept-attribute-element) to stop scrolling after reaching container, means to run these steps:

_container_ is set to the element to scroll into view, which itself is not its nearest ancestor scrolling container... Also the steps don't stop scrolling "after reaching _container_".

The parameter is both a mode switch (nearest vs all) and a reference to the element being scrolled into view. But the algorithm already has _target_ for "the element" (it's always an element when `element.scrollIntoView()` is the entry point), so no need to have it in _container_ again.

I suggest passing on the string "all" or "nearest", defaulting to "all".

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


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

Received on Monday, 4 August 2025 21:19:50 UTC