<?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>103973</bug_id>
          
          <creation_ts>2012-12-03 22:54:58 -0800</creation_ts>
          <short_desc>[Shadow DOM]: custom pseudo-element styles are not applied to the shadow tree elements</short_desc>
          <delta_ts>2012-12-14 10:22:26 -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>
    
    <blocked>103230</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Web Components Team">webcomponents-bugzilla</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>miket</cc>
    
    <cc>morrita</cc>
    
    <cc>shinyak</cc>
    
    <cc>tasak</cc>
    
    <cc>webcomponents-bugzilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>782236</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-12-03 22:54:58 -0800</bug_when>
    <thetext>Found in Chrome 23.0.1271.95 m. Custom pseudo-elements styles (https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#custom-pseudo-elements) are not applied to the shadow tree elements. 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 widget = d.createElement(&apos;div&apos;);
    d.body.appendChild(widget);
    var s = new SR(widget);
    var thumb = d.createElement(&apos;span&apos;);
    thumb.innerHTML = &apos;Some text&apos;;
    thumb.pseudo = &apos;x-thumb&apos;;
    s.appendChild(thumb);
    
    var style = d.createElement(&apos;style&apos;);
    style.innerHTML = &apos;span::x-thumb {&apos; +
        &apos;color:red;&apos; +
        &apos;}&apos;;
    s.appendChild(style);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;test()&quot;&gt;
&lt;/body&gt;
&lt;/html&gt;


As you can see red color style is not applied. If is ShadowRoot style replace span::x-thumb by span then style is applied. So problem is in custom pseudo-element</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>791407</commentid>
    <comment_count>1</comment_count>
    <who name="Shinya Kawanaka">shinyak</who>
    <bug_when>2012-12-14 00:20:03 -0800</bug_when>
    <thetext>This test seems to contain several bugs.

1. style element should be in document instead of shadow tree.
2. selector should be div::x-thumb. (you should specify host element before ::.)

Also, now we&apos;re using prefixed version of API, i.e. webkitPseudo.

Please see this. This should work in Chrome Canary.
http://jsfiddle.net/yRb68/2/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>791454</commentid>
    <comment_count>2</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-12-14 01:23:57 -0800</bug_when>
    <thetext>Thank you for the clarification. Code from http://jsfiddle.net/yRb68/2/ really works in Canary. But webkitPseudo property is set in the example.

thumb.webkitPseudo = &apos;x-thumb&apos;;

According the example from Shadow DOM spec (see https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#custom-pseudo-elements) thumb.pseudo property should work but doesn&apos;t in the Canary</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>791459</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-12-14 01:25:40 -0800</bug_when>
    <thetext>Ups.. missed that you are using prefixed version of the API. Sorry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>791688</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2012-12-14 10:22:26 -0800</bug_when>
    <thetext>Yay!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>