Re: [csswg-drafts] [cssom-view-1] Clip aligned element box by intermediate scrollers (#13411)

The CSS Working Group just discussed `[cssom-view-1] Clip aligned element box by intermediate scrollers`, and agreed to the following:

* `RESOLVED: scrollIntoView() targets the element's area as clamped by intervening scroll containers`
* `RESOLVED: scroll-padding is only taken into consideration on the scroller being scrolled (not on intervening scrollers)`
* `RESOLVED: scroll-margin is applied to the clamped area (is not itself clamped)`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> scribe+<br>
&lt;fantasai> flackr: Differences in behavior when scrolling into view.<br>
&lt;fantasai> flackr: Historically, would scroll "into view" regardless of clipping<br>
&lt;fantasai> flackr: Chrome changed to scroll to the portion that was visible if it's clipped<br>
&lt;fantasai> flackr: But if it was wholly invisible, it'll scroll to its actual position which is nonsense<br>
&lt;emilio> q+<br>
&lt;fantasai> flackr: I think when we perform scrollIntoView(), clip the region to the portion of the element that is not clipped by the outer scroller<br>
&lt;fantasai> flackr: So you won't scroll to invisible spaces where the box occupies but is not visible to the user.<br>
&lt;fantasai> astearns: Would this change Chrome's behavior, or new thing?<br>
&lt;fantasai> flackr: Chrome does it some of the time, but not always.<br>
&lt;fantasai> flackr: I'm proposing to do it always.<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: I think that's fine.<br>
&lt;fantasai> emilio: In the issue you mentioned clip-path, I suspect we don't want to do that.<br>
&lt;fantasai> flackr: Agree we don't want to do that.<br>
&lt;fantasai> emilio: My concern is things like, if an anchor is off-screen but in-position vertically ...<br>
&lt;fantasai> emilio: Maybe people use that to anchor scroll positions, and presumably we don't want to scroll that into view...? But maybe scrolling vertically makes sense?<br>
&lt;fantasai> flackr: Even if the visible box becomes zero area, it still has dimensions of top and bottom which would give you the correct vertical position.<br>
&lt;fantasai> emilio: Ah, so you want to do this per-axis.<br>
&lt;fantasai> flackr: I was imagining we want to scroll as close as we can to the visible part of the element, but not so far that we leave the scroller that's clipping it.<br>
&lt;fantasai> emilio: So wouldn't change behavior for anchors.<br>
&lt;fantasai> emilio: Slight concern about that, but overall makes sense.<br>
&lt;fantasai> fantasai: Wrt 'overflow: clip' I would suggest to keep it in sync with 'overflow: hidden' rather than 'clip-path' as you suggested, flackrr.<br>
&lt;fantasai> flackr: We could do this. My rationale for ignoring 'overflow: clip' is that it's not a scroll container. And we usually don't pay attention to non scroll-containers when walking the ancestors.<br>
&lt;emilio> I agree with flackr here<br>
&lt;fantasai> flackr: I always thought about 'overflow: clip' as purely decorative.<br>
&lt;fantasai> emilio: My mental model was the same<br>
&lt;fantasai> emilio: 'overflow: clip' is fundamentally not a scroll container, and this is about scroll containers.<br>
&lt;fantasai> emilio: Becomes a bit weird because there are other things that affect scroll-into-view like scroll-margin etc. and don't affect 'overflow: clip'<br>
&lt;emilio> q+<br>
&lt;fantasai> fantasai: I think from author perspective 'overflow' is for containment clipping, and 'clip-path' etc is decorative.<br>
&lt;astearns> ack fantasai<br>
&lt;fantasai> fantasai: So although from impl perspective 'overflow: clip' is like 'clip-path', I don't think that's true from authoring perspective.<br>
&lt;fantasai> flackr: Spec-wise it's pretty different thing.<br>
&lt;fantasai> flackr: but not opposed.<br>
&lt;fantasai> emilio: Treating 'overflow: clip' same as scroll ...<br>
&lt;fantasai> emilio: it gets you into a slipperly slope<br>
&lt;fantasai> emilio: Should you also inflate/deflate by 'scroll-margin' and 'scroll-padding'?<br>
&lt;fantasai> emilio: You deflate by that, but it feels weird<br>
&lt;fantasai> emilio: Treating it as a scroller but without these scrolly things, and then applying overflow-clip-margin on top ...<br>
&lt;fantasai> flackr: Prefer to start narrow and consider that separately.<br>
&lt;fantasai> astearns: Distinctions between 'overflow: clip' and 'clip-path'<br>
&lt;fantasai> astearns: concern is that it would have wider implications?<br>
&lt;fantasai> fantasai: No<br>
&lt;fantasai> flackr: Yes. That's the concern.<br>
&lt;fantasai> fantasai: Happy to split out to separate consideration.<br>
&lt;fantasai> PROPOSED: scrollIntoView() targets the element's area as clipped by intervening scroll containers<br>
&lt;fantasai> [tangent wrt scroll-padding etc.]<br>
&lt;fantasai> emilio: often used for abspos type stuff<br>
&lt;fantasai> flackr: I think it'll be fine [missed rationale]<br>
&lt;fantasai> emilio: But doesn't it give you some weird degenerate behavior... it's probably fine<br>
&lt;fantasai> PROPOSED: scroll-padding is only taken into consideration on the final scroller, and scroll-margin is applied to the clipped region (??)<br>
&lt;fantasai> astearns: Do we need to clarify that it's clamped if out of region?<br>
&lt;fantasai> flackr: Yeah we could clarify<br>
&lt;fantasai> PROPOSED: scrollIntoView() targets the element's area as clamped by intervening scroll containers<br>
&lt;fantasai> flackr: Inner scroller will use scroll-padding when scrolling<br>
&lt;emilio> Lgtm<br>
&lt;fantasai> RESOLVED: scrollIntoView() targets the element's area as clamped by intervening scroll containers<br>
&lt;fantasai> PROPOSED: scroll-padding is only taken into consideration on the scroller being scrolled<br>
&lt;fantasai> flackr: scroll-margin should be re-applied to the clipped bounds<br>
&lt;emilio> Sounds good<br>
&lt;fantasai> PROPOSED: scroll-padding is only taken into consideration on the scroller being scrolled (not on intervening scrollers)<br>
&lt;fantasai> RESOLVED: scroll-padding is only taken into consideration on the scroller being scrolled (not on intervening scrollers)<br>
&lt;fantasai> PROPOSED: scroll-margin is applied to the clamped area (is not itself clamped)<br>
&lt;fantasai> emilio: Feels a bit weird<br>
&lt;fantasai> emilio: but maybe it's fine<br>
&lt;fantasai> flackr: I got some bug reports about this, and in those cases tended to agree.<br>
&lt;fantasai> flackr: But we can revisit if it seems broken<br>
&lt;fantasai> RESOLVED: scroll-margin is applied to the clamped area (is not itself clamped)<br>
&lt;fantasai> astearns: We can revisit if needed<br>
&lt;fantasai> s/Topic:/Subtopic:/<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13411#issuecomment-4345155434 using your GitHub account


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

Received on Wednesday, 29 April 2026 15:27:35 UTC