[csswg-drafts] [cssom-view] Add scrollIntoView parameter to only scroll the nearest scrolling container (#10451)

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

== [cssom-view] Add scrollIntoView parameter to only scroll the nearest scrolling container ==
Right now the [cssom-view spec](https://drafts.csswg.org/cssom-view/#scroll-a-target-into-view) says that (emphasis mine):

> To scroll a target into view target, which is an [Element](https://dom.spec.whatwg.org/#concept-element) or [Range](https://dom.spec.whatwg.org/#concept-range), with a scroll behavior behavior, a block flow direction position block, and an inline base direction position inline, means to run these steps **for each ancestor element or [viewport](https://www.w3.org/TR/CSS21/visuren.html#x1) that establishes a [scrolling box](https://drafts.csswg.org/cssom-view/#scrolling-box) scrolling box, in order of innermost to outermost scrolling box**:

There are many use cases when building components where it would be nice to only scroll the scroller associated with that component. I propose we add a property to [ScrollIntoViewOptions](https://drafts.csswg.org/cssom-view/#dictdef-scrollintoviewoptions) which limits the scroll to only the nearest scrolling container. E.g.

```
dictionary ScrollIntoViewOptions : ScrollOptions {
  ScrollLogicalPosition block = "start";
  ScrollLogicalPosition inline = "nearest";
  RecursionBehavior scrollers = "all" | "nearest";
};
```

I thought this was already filed but I couldn't find it in search so filing again.

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


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

Received on Friday, 14 June 2024 19:06:54 UTC