This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23045 - [Shadow]: ::part should override styles declared in a shadow tree
Summary: [Shadow]: ::part should override styles declared in a shadow tree
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23062
  Show dependency treegraph
 
Reported: 2013-08-23 02:29 UTC by Takashi Sakamoto
Modified: 2014-01-15 11:36 UTC (History)
2 users (show)

See Also:


Attachments

Description Takashi Sakamoto 2013-08-23 02:29:08 UTC
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,

<style>
  #host::x-part {
    color: orange;
  }
</style>

<div id="host">
  #shadow-root
    <style>
       div {
         color: blue;
       }
    </style>
    <div pseudo="x-part">style me</div>
</div>

If we cannot override, "style me"'s color is blue. We cannot change.
So this makes it much more difficult to create <style> in a shadow tree when we want to use "::part".

c.f. http://crbug.com/273138
Comment 1 Takashi Sakamoto 2013-08-23 03:57:49 UTC
I need to say about "the same specificity" case. In the case, document's style wins.

For example,

<style>
  #host::part(x-part) {
    color: orange;
  }
</style>

<div id="host">
  #shadow-root
    <style>
       #target.targetClass {
         color: blue;
       }
    </style>
    <div id="target" clas="targetClass" part="x-part">style me</div>
</div>

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

So the rules have the same specificity. In the case, "style me"'s color is orange.
Comment 2 Steve Orvell 2013-10-25 20:11:56 UTC
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23467

is a replacement for ::part.
Comment 3 Hayato Ito 2014-01-15 11:35:44 UTC
Closing this bug because '::part' was dead.
Comment 4 Hayato Ito 2014-01-15 11:36:00 UTC
Closing this bug because '::part' was dead.