<?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>103479</bug_id>
          
          <creation_ts>2012-11-27 21:48:12 -0800</creation_ts>
          <short_desc>[Shadow DOM]: Event that must be stopped at Shadow boundary is not stopped if fired from DOM node distributed into insertion point</short_desc>
          <delta_ts>2012-12-06 03:32:20 -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>
          <dependson>102681</dependson>
          <blocked>63606</blocked>
    
    <blocked>103230</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dominicc</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>777520</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-27 21:48:12 -0800</bug_when>
    <thetext>According Shadow DOM specification (https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#events-that-are-always-stopped) Abort event should always be stopped at the nearest Shadow boundary. It works, but if the event is fired from the DOM node distributed into insertion point then it is not stopped. Run the following example:

&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

function test() {
	var SR = window.ShadowRoot || window.WebKitShadowRoot;
    var d = document;
        
    var host = d.createElement(&apos;div&apos;);
    host.setAttribute(&apos;id&apos;, &apos;host&apos;);
    d.body.appendChild(host);
    
    var inp1 = d.createElement(&apos;input&apos;);
    inp1.setAttribute(&apos;id&apos;, &apos;inp1&apos;);
    inp1.setAttribute(&apos;type&apos;, &apos;checkbox&apos;);
    inp1.setAttribute(&apos;class&apos;, &apos;clazz1&apos;);
    host.appendChild(inp1);
    
    var inp2 = d.createElement(&apos;input&apos;);
    inp2.setAttribute(&apos;id&apos;, &apos;inp2&apos;);
    inp2.setAttribute(&apos;type&apos;, &apos;checkbox&apos;);
    inp2.setAttribute(&apos;class&apos;, &apos;clazz2&apos;);
    host.appendChild(inp2);
    
    var inp3 = d.createElement(&apos;input&apos;);
    inp3.setAttribute(&apos;id&apos;, &apos;inp3&apos;);
    inp3.setAttribute(&apos;type&apos;, &apos;checkbox&apos;);
    inp3.setAttribute(&apos;class&apos;, &apos;clazz1&apos;);
    host.appendChild(inp3);
    
    
    //Shadow root to play with
    var s = new SR(host);
    
    var shadowDiv = document.createElement(&apos;div&apos;);
    shadowDiv.innerHTML = &apos;&lt;content select=&quot;.clazz1&quot;&gt;&lt;/content&gt;&apos;;
    s.appendChild(shadowDiv);
        
    d.body.addEventListener(&apos;abort&apos;, function(event) {
        alert(&apos;Abort event should always be stopped at Shadow boundary!&apos;);      
    }, false);
    
    var event = d.createEvent(&apos;UIEvent&apos;);
    event.initUIEvent (&apos;abort&apos;, true, false);
    inp1.dispatchEvent(event);        
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;

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


This example shows that the event is not stopped on the shadow boundary</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>784819</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-12-06 03:32:20 -0800</bug_when>
    <thetext>This is an expected behavior.

Event should be stopped at the nearest shadow boundary, but for distributed nodes, an event should be dispatched in the outer tree as normal. Attaching a shadow root should not change the behavior of event dispatching in the outer tree.

I think you might want to file a bug for the Shadow DOM spec if something is unclear.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>