<?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>102788</bug_id>
          
          <creation_ts>2012-11-20 03:10:38 -0800</creation_ts>
          <short_desc>[Shadow DOM]: &apos;Click&apos; event stops on shadow boundary</short_desc>
          <delta_ts>2013-01-10 02:41:36 -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>INVALID</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>103230</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Web Components Team">webcomponents-bugzilla</assigned_to>
          <cc>dominicc</cc>
    
    <cc>hayato</cc>
    
    <cc>morrita</cc>
    
    <cc>shinyak</cc>
    
    <cc>webcomponents-bugzilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>771708</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-20 03:10:38 -0800</bug_when>
    <thetext>Found in Chrome 23.0.1271.64 m

Run the example of event retargeting taken from https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#event-retargeting-example. The code is the following:

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

//Example taken from http://www.w3.org/TR/shadow-dom/#event-retargeting-example
function createTestMediaPlayer(d) {
	var SR = window.ShadowRoot || window.WebKitShadowRoot;
	
    d.body.innerHTML = &apos;&apos; +
    &apos;&lt;div id=&quot;player&quot;&gt;&apos; +
        &apos;&lt;input type=&quot;checkbox&quot; id=&quot;outside-control&quot;&gt;&apos; +
        &apos;&lt;div id=&quot;player-shadow-root&quot;&gt;&apos; +
        &apos;&lt;/div&gt;&apos; +
    &apos;&lt;/div&gt;&apos;;

    var playerShadowRoot = new SR(d.querySelector(&apos;#player-shadow-root&apos;));
    playerShadowRoot.innerHTML = &apos;&apos; + 
        &apos;&lt;div id=&quot;controls&quot;&gt;&apos; +
            &apos;&lt;button class=&quot;play-button&quot;&gt;PLAY&lt;/button&gt;&apos; +
            &apos;&lt;input type=&quot;range&quot; id=&quot;timeline&quot;&gt;&apos; +
                &apos;&lt;div id=&quot;timeline-shadow-root&quot;&gt;&apos; +
                &apos;&lt;/div&gt;&apos; +
            &apos;&lt;/input&gt;&apos; +
            &apos;&lt;div class=&quot;volume-slider-container&quot; id=&quot;volume-slider-container&quot;&gt;&apos; +
                &apos;&lt;input type=&quot;range&quot; class=&quot;volume-slider&quot; id=&quot;volume-slider&quot;&gt;&apos; +
                    &apos;&lt;div id=&quot;volume-shadow-root&quot;&gt;&apos; +                       
                    &apos;&lt;/div&gt;&apos; +
                &apos;&lt;/input&gt;&apos; +
            &apos;&lt;/div&gt;&apos; +
        &apos;&lt;/div&gt;&apos;;
    
    var timeLineShadowRoot = new SR(playerShadowRoot.querySelector(&apos;#timeline-shadow-root&apos;));
    timeLineShadowRoot.innerHTML =  &apos;&lt;div class=&quot;slider-thumb&quot; id=&quot;timeline-slider-thumb&quot;&gt;&lt;/div&gt;&apos;;
    
    var volumeShadowRoot = new SR(playerShadowRoot.querySelector(&apos;#volume-shadow-root&apos;));
    volumeShadowRoot.innerHTML = &apos;&lt;div class=&quot;slider-thumb&quot; id=&quot;volume-slider-thumb&quot;&gt;&lt;/div&gt;&apos;;
    
    return {
        &apos;playerShadowRoot&apos;: playerShadowRoot,
        &apos;timeLineShadowRoot&apos;: timeLineShadowRoot,
        &apos;volumeShadowRoot&apos;: volumeShadowRoot
        };
}

function test() {
    var d = document;
        
	roots = createTestMediaPlayer(d);
	
    //For #volume-slider-thumb relative target is #volume-slider-thumb
    roots.volumeShadowRoot.querySelector(&apos;#volume-slider-thumb&apos;).addEventListener(&apos;click&apos;,          
        function (event) {
            alert(&apos;Point 1: relative target is &apos; + event.target.getAttribute(&apos;id&apos;));
    }, false);	
	
    //For #volume-slider-thumb relative target is #volume-slider-thumb
    roots.volumeShadowRoot.addEventListener(&apos;click&apos;, 
        function (event) {
        	alert(&apos;Point 2: relative target is &apos; + event.target.getAttribute(&apos;id&apos;)); 
    }, false);	
	
	//For #volume-slider-thumb relative target is #volume-slider-thumb
	roots.playerShadowRoot.querySelector(&apos;#volume-slider&apos;).addEventListener(&apos;click&apos;,            
	     function (event) {
		      alert(&apos;Point 3: relative target is &apos; + event.target.getAttribute(&apos;id&apos;));
	}, false);
	
	var event = d.createEvent(&apos;HTMLEvents&apos;);
	event.initEvent (&quot;click&quot;, true, false);
	roots.volumeShadowRoot.querySelector(&apos;#volume-slider-thumb&apos;).dispatchEvent(event);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;

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


At the points 1 and 2 this example shows correct related target. On point 3 event listener is not invoked that means that event was stopped on the shadow boundary but should not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>773904</commentid>
    <comment_count>1</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-22 06:33:12 -0800</bug_when>
    <thetext>Additional investigation showed that event is not stopped but bubbles. But it&apos;s strange why event listener is not invoked in the example shown in description.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804205</commentid>
    <comment_count>2</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-01-10 02:41:36 -0800</bug_when>
    <thetext>Marking INVALID since the example used in #1 is wrong.

#player-shadow-root should be a ShadowRoot, but that in example is actually a Shadow Host.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>