Bug 178002
Summary: | Retargeting algorithm is not correctly running in elementFromPoint | ||
---|---|---|---|
Product: | WebKit | Reporter: | elkurin |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, cdumez, elkurin, kochi, rniwa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 11 | ||
Hardware: | Mac | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 148695 |
elkurin
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
<rdar://problem/42843001>
Ryosuke Niwa
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
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!