<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178002</bug_id>
          
          <creation_ts>2017-10-06 01:47:55 -0700</creation_ts>
          <short_desc>Retargeting algorithm is not correctly running in elementFromPoint</short_desc>
          <delta_ts>2022-08-19 14:47:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 11</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>elkurin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>elkurin</cc>
    
    <cc>kochi</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1357516</commentid>
    <comment_count>0</comment_count>
    <who name="">elkurin</who>
    <bug_when>2017-10-06 01:47:55 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447183</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-08-01 22:41:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/42843001&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1461677</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-09-20 19:55:28 -0700</bug_when>
    <thetext>Here&apos;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&apos;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&apos;s likely that we want to keep the current behavior of WebKit instead of alining to Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892511</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-19 14:47:25 -0700</bug_when>
    <thetext>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!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>