<?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>101309</bug_id>
          
          <creation_ts>2012-11-05 23:19:08 -0800</creation_ts>
          <short_desc>[Shadow DOM]: Event retargeting doesn’t occur for document nodes distributed to the shadow insertion points</short_desc>
          <delta_ts>2012-11-06 09:33:33 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          
          <blocked>63606</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>hayato</cc>
    
    <cc>shinyak</cc>
    
    <cc>webcomponents-bugzilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>759296</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-05 23:19:08 -0800</bug_when>
    <thetext>Run the following example.

&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function test() {
       var SR = window.ShadowRoot || window.WebKitShadowRoot;
    var d = document;
    
    var ul = d.querySelector(&apos;ul.stories&apos;);
    var s = new SR(ul);

    //make shadow subtree
    var div = d.createElement(&apos;div&apos;);
    div.innerHTML = &apos;&lt;ul id=&quot;ip_wrapper&quot;&gt;&lt;content select=&quot;.shadow&quot;&gt;&lt;/content&gt;&lt;/ul&gt;&apos;;
    s.appendChild(div);
         
       d.body.addEventListener(&apos;click&apos;, function (event) {
             alert(&apos;event.target.tagName=&apos; + event.target.tagName);
    }, false);
       
    var event = d.createEvent(&apos;HTMLEvents&apos;);
    event.initEvent (&quot;click&quot;, true, false);
    d.querySelector(&apos;#li3&apos;).dispatchEvent(event);             
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;
    &lt;ul class=&apos;stories&apos;&gt;
        &lt;li id=&apos;li1&apos;&gt;&lt;a href=&apos;#1&apos;&gt;Link1&lt;/a&gt;&lt;/li&gt;
        &lt;li id=&apos;li2&apos; title=&quot;li2&quot;&gt;&lt;a href=&apos;#2&apos;&gt;Link 2&lt;/a&gt;&lt;/li&gt;
        &lt;li id=&apos;li3&apos; class=&apos;shadow&apos;&gt;&lt;a href=&apos;#3&apos;&gt;Link 3 Shadow&lt;/a&gt;&lt;/li&gt;
        &lt;li id=&apos;li4&apos; class=&apos;shadow2&apos;&gt;&lt;a href=&apos;#4&apos;&gt;Link 4 Shadow 2&lt;/a&gt;&lt;/li&gt;
        &lt;li id=&apos;li5&apos;&gt;&lt;a href=&apos;#5&apos;&gt;Link 5&lt;/a&gt;&lt;/li&gt;
        &lt;li id=&apos;li6&apos; class=&apos;shadow&apos;&gt;&lt;a href=&apos;#5&apos;&gt;Link 6 Shadow&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;


This example shows tagName LI. But according http://www.w3.org/TR/shadow-dom/#event-retargeting (see steps 5 and 6 of event retargeting algorithm) UL (a shadow root) should be a relative target.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759305</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-11-05 23:36:52 -0800</bug_when>
    <thetext>Let me take a look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759329</commentid>
    <comment_count>2</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-11-06 00:07:29 -0800</bug_when>
    <thetext>&apos;LI&apos; is correct in this case. That matches my intention and the implementation.

Do you think the spec need to be fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759336</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-06 00:17:02 -0800</bug_when>
    <thetext>I believe spec needs to be fixed. I thought that parent calculation algorithm should be invoked in this case. It&apos;s not obvious for me that in this case it shouldn&apos;t be invoked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759363</commentid>
    <comment_count>4</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-11-06 01:04:42 -0800</bug_when>
    <thetext>Thank you for the reply.

I think the it might be better to file a bug on the spec if the spec is unclear. So let me close this WebKit&apos;s bug.
Please feel free to file a bug on the spec with a reference to this bug.

(In reply to comment #3)
&gt; I believe spec needs to be fixed. I thought that parent calculation algorithm should be invoked in this case. It&apos;s not obvious for me that in this case it shouldn&apos;t be invoked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759371</commentid>
    <comment_count>5</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-06 01:21:34 -0800</bug_when>
    <thetext>Bug against specification filled https://www.w3.org/Bugs/Public/show_bug.cgi?id=19875</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759772</commentid>
    <comment_count>6</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2012-11-06 09:33:33 -0800</bug_when>
    <thetext>Thanks, Sergey. Will look into this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>