REOPENED 170743
shadowRoot.elementFromPoint() is not scoped
https://bugs.webkit.org/show_bug.cgi?id=170743
Summary shadowRoot.elementFromPoint() is not scoped
Daniel Freedman
Reported 2017-04-11 12:12:21 PDT
ShadowRoot.elementFromPoint(x, y) should be scoped to the ShadowRoot, but appears to return elements outside of the ShadowRoot. In this example, the empty ShadowRoot should return `null` for all calls to `elementFromPoint`, but it returns `document.documentElement` Example: http://jsbin.com/nogoyay/3/edit?html,console,output Expected: false Actual: true
Attachments
Patch (8.34 KB, patch)
2017-07-10 13:24 PDT, Ali Juma
rniwa: review-
rniwa: commit-queue-
Radar WebKit Bug Importer
Comment 1 2017-04-11 22:39:13 PDT
Ali Juma
Comment 2 2017-07-10 13:24:50 PDT
Ryosuke Niwa
Comment 3 2017-07-12 14:53:19 PDT
Comment on attachment 315017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=315017&action=review > Source/WebCore/ChangeLog:12 > + No new tests, extended existing test. Need a link to the spec. We can't make this change until the discussion in https://github.com/w3c/csswg-drafts/issues/556 concludes.
Ryosuke Niwa
Comment 4 2017-07-12 14:54:30 PDT
Comment on attachment 315017 [details] Patch Actually, never mind. Clearly, returning a node inside another shadow tree is problematic.
Ryosuke Niwa
Comment 5 2017-07-12 14:55:40 PDT
Comment on attachment 315017 [details] Patch wait a minute, sorry, this still doesn't make sense. we should be re-targeting the node to the current scope so this is a bug in retargetToScope.
Ryosuke Niwa
Comment 6 2022-02-13 23:25:00 PST
Not sure why this got closed as invalid. The bug still exists.
Ahmad Saleem
Comment 7 2023-03-27 15:34:41 PDT
(In reply to Ryosuke Niwa from comment #6) > Not sure why this got closed as invalid. The bug still exists. Just to update on first run, it shows 'true' but after refresh, it shows 'false', if you interact with the website. That's the behavior I am getting in Safari Technology Preview 166. Just wanted to update on how I was able to reproduce this.
Note You need to log in before you can comment on or make changes to this bug.