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

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

== [cssom-view] `scrollParent`  shouldn't necessarily be null for the body ==
https://drafts.csswg.org/cssom-view/#dom-htmlelement-scrollparent

> 1. If any of the following holds true, return null and terminate this algorithm:
> -  The element does not have an associated [box](https://drafts.csswg.org/css-display-4/#box).
> -  The element is the [root element](https://drafts.csswg.org/css-display-4/#root-element).
> -  The element is [the body element](https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2).
> -  The element’s computed value of the [position](https://drafts.csswg.org/css-position-3/#propdef-position) property is [fixed](https://drafts.csswg.org/css-position-3/#valdef-position-fixed) and no ancestor establishes a fixed position [containing block](https://drafts.csswg.org/css-display-4/#containing-block).

Sure, the root element won't be a scroll container because of [overflow propagation](https://drafts.csswg.org/css-overflow-3/#overflow-propagation), so removing the early return will typically result in null anyways.

However, if the root is an open shadow host, then the body could be assigned to a slot which is a scroll container. In that case I think `scrollParent` should be the slot, not null.

@flackr What was the point of this condition?

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


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

Received on Wednesday, 3 September 2025 13:24:55 UTC