RESOLVED INVALID 204195
offsetParent is wrong if the offset parent is inside some shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=204195
Summary offsetParent is wrong if the offset parent is inside some shadow DOM
Pascal Spadone
Reported 2019-11-14 04:13:55 PST
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.
Attachments
Plunker that reproduces the issue (1.90 KB, application/zip)
2019-11-14 04:13 PST, Pascal Spadone
no flags
Radar WebKit Bug Importer
Comment 1 2019-11-17 16:39:42 PST
Emilio Cobos Álvarez (:emilio)
Comment 2 2019-11-19 08:03:18 PST
Pascal Spadone
Comment 3 2019-11-20 02:29:45 PST
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!
Ryosuke Niwa
Comment 4 2019-11-25 14:25:38 PST
(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.
Ryosuke Niwa
Comment 5 2019-11-25 14:26:06 PST
Closing as invalid because WebKit's current behavior matches the spec & Firefox.
Note You need to log in before you can comment on or make changes to this bug.