Re: [csswg-drafts] [cssom-view] `scrollParent` shouldn't necessarily be null for the body (#12723)

The CSS Working Group just discussed ``[cssom-view] `scrollParent`  shouldn't necessarily be null for the body``, and agreed to the following:

* `RESOLVED: scrollParent of root should be null, scrollParent of body is null iff body is the scrollingElement`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> oriol: scrollParent has an early return that returns null for root or body<br>
&lt;emilio> ... reasoning is that when the scroll container would be the viewport scrollParent returns the scrollingElement<br>
&lt;Rossen> q?<br>
&lt;emilio> ... could be either the same element or a descendant and that'd be problematic if it's walking scrollParent up<br>
&lt;flackr> q+<br>
&lt;emilio> ... not sure if we resolved on this<br>
&lt;emilio> ... do we want to return the scrolling element for the viewport?<br>
&lt;emilio> ... we could return the document node<br>
&lt;emilio> ... but that's annoying because causes authors to type check<br>
&lt;emilio> ... then I want to confirm if we want to prevent this footgun<br>
&lt;emilio> ... if so I propose to return null for the root element<br>
&lt;Rossen> ack flackr<br>
&lt;emilio> ... but only for `&lt;body>` in quirks mode<br>
&lt;emilio> flackr: I was basically copying offsetParent<br>
&lt;emilio> ... you shouldn't have a node where you recursively get yourself<br>
&lt;emilio> ... scrollParent of root should be null, scrollParent of body is null iff body is the scrollingElement<br>
&lt;smfr> q+<br>
&lt;Rossen> ack smfr<br>
&lt;emilio> ... I think your change sounds good, keeps intent, I think we should hit scrollingElement if you're walking the the scroll parent change<br>
&lt;emilio> smfr: what's the case if body is overflow:scroll and root overflow:hidden<br>
&lt;emilio> oriol: in quirks mode or standards mode?<br>
&lt;emilio> smfr: standards mode<br>
&lt;emilio> flackr: then body would have a scroll parent of the root element<br>
&lt;emilio> smfr: ok<br>
&lt;emilio> +1<br>
&lt;emilio> PROPOSED RESOLUTION: scrollParent of root should be null, scrollParent of body is null iff body is the scrollingElement<br>
&lt;smfr> sounds fine<br>
&lt;emilio> RESOLVED: scrollParent of root should be null, scrollParent of body is null iff body is the scrollingElement<br>
</details>


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


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

Received on Wednesday, 4 March 2026 17:18:20 UTC