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.
<rdar://problem/42843001>
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.
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!