<?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>20957</bug_id>
          
          <creation_ts>2013-02-12 00:00:03 +0000</creation_ts>
          <short_desc>[Shadow]: Styling elements in shadow trees based on host element</short_desc>
          <delta_ts>2014-04-24 00:55:21 +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>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          <dependson>22788</dependson>
          <blocked>23062</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dimitri Glazkov">dglazkov</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>dominicc</cc>
    
    <cc>hayato</cc>
    
    <cc>jackalmage</cc>
    
    <cc>sorvell</cc>
    
    <cc>tasak</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82933</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-02-12 00:00:03 +0000</bug_when>
    <thetext>From Tab:
http://lists.w3.org/Archives/Public/public-webapps/2013JanMar/0353.html

---

It&apos;s possible to style a host element from within the shadow&apos;s
stylesheet, and use the host&apos;s own qualities, by using the @host rule.
 It&apos;s also possible to style the shadow elements themselves, in their
own self-contained universe.

What doesn&apos;t seem possible is to use the host element&apos;s qualities
(such as tagname, attributes, class, etc.) to style elements in the
shadow tree.

Currently, the only way to even *refer* to the host element from
within a shadow-tree stylesheet is by using the @host rule, which
contains style rules. The selectors there are limited to only
targetting the host element itself.

This came up in a hallway discussion about dropping
resetStyleInheritance in favor of CSS&apos;s new &apos;all&apos; property
&lt;http://dev.w3.org/csswg/css3-cascade/#all-shorthand&gt;.  Doing so would
be fine, technically - the property accomplishes the same thing as the
attribute - but it falls down on usability.  We want to *default* to
having an inheritance shield, and let the author lower it if they
choose, but you can&apos;t &quot;unset&quot; a property; if we start with &quot;all:
default&quot; set, the author can&apos;t remove the declaration and lower the
shield.  If we kept the attribute and simply implemented it as the
&apos;all&apos; property using an attribute selector, though, it all works out.

However, you can&apos;t do that currently, as far as I can tell.  This
ability seems to be potentially useful beyond the use-case above, just
for a lot of author-facing design problems.

The problem seems to stem from the fact that the host element is
&quot;owned&quot; by both the outer page and the component author.  We currently
work around that dual ownership by using @host to let you target the
element directly.  However, this is an incomplete workaround.

I have a possible solution, though I&apos;m not sure I like it: expose a
::shadow(&lt;selector&gt;) pseudo-element that is only usable inside of
@host.  This&apos;ll solve the problem, but it seems inelegant.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90886</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-07-17 21:52:12 +0000</bug_when>
    <thetext>I think we can do this now, based on the latest proposal of matching host inside of the shadow tree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90893</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-07-17 22:12:35 +0000</bug_when>
    <thetext>*** Bug 21390 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104306</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-04-24 00:55:21 +0000</bug_when>
    <thetext>Let me close this bug.
I believe CSS scoping spec [1] has already addressed this issue.

[1]: http://dev.w3.org/csswg/css-scoping/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>