Created attachment 383553 [details] Plunker that reproduces the issue If the offset parent of an element is part of some shadow DOM, .offsetParent incorrectly returns some node higher up the tree, outside of the shadow DOM. The following pluncker (also attached) demonstrates the issue: https://embed.plnkr.co/nxDd9HrA0XiN72WAbZBF/ . In MacOS Safari 13.0.3 as well as iOS 13.1 Safari, the reported .offsetParent is the body instead of the expected relative-positionned div.
<rdar://problem/57268349>
This is expected per https://bugzilla.mozilla.org/show_bug.cgi?id=1514074 / bug 157437 / https://github.com/w3c/csswg-drafts/issues/159, afaict. Firefox behaves the same.
Fair enough! Makes sense that the DOM API should avoid leaking shadow nodes. I will check the Blink bug tracker and see if it makes sense to open a bug there, then. Apologies for not googling long enough before opening this ticket!
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2) > This is expected per https://bugzilla.mozilla.org/show_bug.cgi?id=1514074 / > bug 157437 / https://github.com/w3c/csswg-drafts/issues/159, afaict. Firefox > behaves the same. Looks like Blink never implemented the new behavior. Commented on the issue to ping rakina & tkent. Hopefully they can align Blink's behavior.
Closing as invalid because WebKit's current behavior matches the spec & Firefox.