[csswg-drafts] [cssom-view-1] offsetParent spec says that we return elements from open shadow trees, no browser does. (#12392)

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

== [cssom-view-1] offsetParent spec says that we return elements from open shadow trees, no browser does. ==
According to the cssom-view-1 spec, offsetParent should expose a containing element within an open shadow tree, however, on testing it seems that chrome, firefox and safari skip the shadow tree entirely.

See https://jsbin.com/negusux/edit?html,js,output
In particular, I think the offsetParent of `<DIV id="openInnerElement" class="target">` should be the `.shadow-scroller` element in the `<open-component>` if browsers were following the spec, however every browser returns the same `<DIV id="outerScroller" class="scroller">` for both the open and closed shadow trees, skipping the shadow tree entirely.

I propose we update the spec to match what browsers do, skipping elements from inner shadow trees, for both offsetParent and the new scrollParent.

@tabatkins FYI

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


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

Received on Tuesday, 24 June 2025 15:52:06 UTC