[csswg-drafts] [cssom-view] `offsetParent` should be null for any `<body>`, not just "the body element" (#12834)

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

== [cssom-view] `offsetParent` should be null for any `<body>`, not just "the body element" ==
https://drafts.csswg.org/cssom-view-1/#dom-htmlelement-offsetparent

> If any of the following holds true return null and terminate this algorithm:
>     - [...]
>     - The element is [the body element](https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2).

But all browsers agree that the check should be for a `<body>`. They return null:

 - Even if the parent is not a `<html>`
 - Event if they are not the first `<body>` child of a `<html>`
 - Even if the parent is not the root


https://searchfox.org/firefox-main/rev/bd4c9573f3f4304df50e943f4358a7af7688b4c0/dom/base/Element.cpp#5433
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;drc=b0670db20644d78d720e45995089f8d256cb49dd;l=4419
https://searchfox.org/wubkat/rev/0cfebd9e836885d2eb9d3e1faf92ce7e30bc58af/Source/WebCore/rendering/RenderElement.cpp#2270

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


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

Received on Friday, 19 September 2025 14:37:41 UTC