WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
178002
Retargeting algorithm is not correctly running in elementFromPoint
https://bugs.webkit.org/show_bug.cgi?id=178002
Summary
Retargeting algorithm is not correctly running in elementFromPoint
elkurin
Reported
2017-10-06 01:47:55 PDT
elementFromPoint bug shadowRoot.elementFromPoint(a host child which is the text node) should return the host node but now is returning the assigned slot node instead. JS Code:
http://jsbin.com/pelidinuka/1/edit?html,js,output
According to the shadow dom spec 7.1 NOTE, elementFromPoint runs the Retargeting Algorithm. Retargeting Algorithm is described in this URL.
https://w3c.github.io/webcomponents/spec/shadow/#retarget
By running this algorithm, the selected node itself (in this case, the parent of the node because the node is the text node) should be returned.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-08-01 22:41:26 PDT
<
rdar://problem/42843001
>
Ryosuke Niwa
Comment 2
2018-09-20 19:55:28 PDT
Here's a summary of the issue. When the text node is the result of hit testing, and it is assigned to a slot, Chrome returns the host presumably because Blink doesn't return a text node as the result of hitting as noted in
https://github.com/w3c/csswg-drafts/issues/556#issuecomment-369815892
However, the current behavior of WebKit matches that of Gecko whereas the behavior in Chrome is that we return the host element because . It's likely that we want to keep the current behavior of WebKit instead of alining to Chrome.
Ahmad Saleem
Comment 3
2022-08-19 14:47:25 PDT
Latest testing results using JSBin test case from
Comment 0
: *** Safari Technology Preview 151 *** host wrong *** Chrome Canary 106 *** host correct *** Firefox Nightly 105 *** host wrong ________ Just wanted to share updated testing results. Thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug