<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23045</bug_id>
          
          <creation_ts>2013-08-23 02:29:08 +0000</creation_ts>
          <short_desc>[Shadow]: ::part should override styles declared in a shadow tree</short_desc>
          <delta_ts>2014-01-15 11:36:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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>23062</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Takashi Sakamoto">tasak</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>hayato</cc>
    
    <cc>sorvell</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92488</commentid>
    <comment_count>0</comment_count>
    <who name="Takashi Sakamoto">tasak</who>
    <bug_when>2013-08-23 02:29:08 +0000</bug_when>
    <thetext>According to CSS cascading order, any style in a shadow tree wins comparing with ::part declared in document. (just talking about scope, specificity and order of appearance).

However, it would be better to apply ::part in document if the rule has higher specificity than all styles in a shadow tree.

For example,

&lt;style&gt;
  #host::x-part {
    color: orange;
  }
&lt;/style&gt;

&lt;div id=&quot;host&quot;&gt;
  #shadow-root
    &lt;style&gt;
       div {
         color: blue;
       }
    &lt;/style&gt;
    &lt;div pseudo=&quot;x-part&quot;&gt;style me&lt;/div&gt;
&lt;/div&gt;

If we cannot override, &quot;style me&quot;&apos;s color is blue. We cannot change.
So this makes it much more difficult to create &lt;style&gt; in a shadow tree when we want to use &quot;::part&quot;.

c.f. http://crbug.com/273138</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92491</commentid>
    <comment_count>1</comment_count>
    <who name="Takashi Sakamoto">tasak</who>
    <bug_when>2013-08-23 03:57:49 +0000</bug_when>
    <thetext>I need to say about &quot;the same specificity&quot; case. In the case, document&apos;s style wins.

For example,

&lt;style&gt;
  #host::part(x-part) {
    color: orange;
  }
&lt;/style&gt;

&lt;div id=&quot;host&quot;&gt;
  #shadow-root
    &lt;style&gt;
       #target.targetClass {
         color: blue;
       }
    &lt;/style&gt;
    &lt;div id=&quot;target&quot; clas=&quot;targetClass&quot; part=&quot;x-part&quot;&gt;style me&lt;/div&gt;
&lt;/div&gt;

#host::part(x-part)&apos;s specificity is id + pseudo element(=class).
#target.targetClass&apos;s specificity is id + class.

So the rules have the same specificity. In the case, &quot;style me&quot;&apos;s color is orange.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95358</commentid>
    <comment_count>2</comment_count>
    <who name="Steve Orvell">sorvell</who>
    <bug_when>2013-10-25 20:11:56 +0000</bug_when>
    <thetext>https://www.w3.org/Bugs/Public/show_bug.cgi?id=23467

is a replacement for ::part.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98488</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-01-15 11:35:44 +0000</bug_when>
    <thetext>Closing this bug because &apos;::part&apos; was dead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98489</commentid>
    <comment_count>4</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-01-15 11:36:00 +0000</bug_when>
    <thetext>Closing this bug because &apos;::part&apos; was dead.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>