<?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>102791</bug_id>
          
          <creation_ts>2012-11-20 04:06:08 -0800</creation_ts>
          <short_desc>[Shadow DOM]: Error in retargeting algorithm</short_desc>
          <delta_ts>2013-01-10 02:32:08 -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>771730</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-20 04:06:08 -0800</bug_when>
    <thetext>According to the https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#event-retargeting-example for #player related target should be #player. But it isn&apos;t so in Chrome 23.0.1271.64 m. Run the following example:

&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;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 #player relative target is #player
    d.querySelector(&apos;#player&apos;).addEventListener(&apos;click&apos;,            
       function (event) {
    	alert(&apos;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.playerShadowRoot.querySelector(&apos;#volume-slider&apos;).dispatchEvent(event);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;

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


This example shows relative target as #player-shadow-root but according to the https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#event-retargeting-example relative target should be #player</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804198</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-01-10 02:32:08 -0800</bug_when>
    <thetext>The example in #1 is wrong.

#player-shadow-root should be a ShadowRoot, but #player-shadow-root in the example seems to be a shadow host.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>