<?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>102666</bug_id>
          
          <creation_ts>2012-11-19 02:08:29 -0800</creation_ts>
          <short_desc>[Shadow DOM]: Retargeting of relatedTarget algorithm doesn&apos;t work</short_desc>
          <delta_ts>2012-12-06 03:01:51 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>102681</dependson>
          <blocked>103230</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hayato</cc>
    
    <cc>morrita</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>770501</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-19 02:08:29 -0800</bug_when>
    <thetext>Please run the following example in Chrome (my Chrome 23.0.1271.64 m):

&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function test() {
    var d = document;
    var SR = window.ShadowRoot || window.WebKitShadowRoot;

    //Shadow root to play with
    var s = new SR(d.querySelector(&apos;#host&apos;));

    var div1 = d.createElement(&apos;div&apos;);
    div1.setAttribute(&apos;style&apos;, &apos;height:100%; width:100%&apos;);
    div1.setAttribute(&apos;id&apos;, &apos;div1&apos;);
    s.appendChild(div1);
    
    var div2 = d.createElement(&apos;div&apos;);
    div2.setAttribute(&apos;style&apos;, &apos;height:100%; width:100%&apos;);
    div2.setAttribute(&apos;id&apos;, &apos;div2&apos;);
    d.body.appendChild(div2);
    
    d.body.addEventListener(&apos;mouseover&apos;, function(event) {
    	alert(&apos;event.relatedTarget.id=&apos; + event.relatedTarget.getAttribute(&apos;id&apos;));
    }, false);
    
    
    var evt = document.createEvent(&quot;MouseEvents&quot;);
    evt.initMouseEvent(&quot;mouseover&quot;, true, false, window,
      0, 10, 10, 10, 10, false, false, false, false, 0, div1);
    
    div2.dispatchEvent(evt);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;

&lt;div id=&quot;host&quot;&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;


As you can see related target is &quot;div1&quot; but according http://www.w3.org/TR/shadow-dom/#retargeting-related-target expected relatedTarget is &quot;host&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>784807</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-12-06 03:01:51 -0800</bug_when>
    <thetext>I&apos;ve confirmed that http://trac.webkit.org/changeset/136818 fixed this. Closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>