<?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>22390</bug_id>
          
          <creation_ts>2013-06-17 06:23:53 +0000</creation_ts>
          <short_desc>[Shadow]: Support &apos;:host()&apos; pseudo class.</short_desc>
          <delta_ts>2014-04-24 01:22:39 +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>
          
          <blocked>23062</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hayato Ito">hayato</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>dominicc</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>89379</commentid>
    <comment_count>0</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-06-17 06:23:53 +0000</bug_when>
    <thetext>At a recent discussion, a &apos;:context()&apos; pseudo class was proposed.
A &apos;:context&apos; pseudo class could replace @host rules.

I&apos;ve written a proposal about how a &apos;:context&apos; pseudo class should behave.: 
https://docs.google.com/document/d/1Az5JGK3EiBkH6zjx7U_RQrdTWYdC7vnK866Yt6dYTAs/edit?usp=sharing

I appreiciate any comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89741</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-06-24 06:37:17 +0000</bug_when>
    <thetext>ping? Any comments?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89759</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-06-24 15:41:13 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; ping? Any comments?

We just had a f2f on Friday and slightly tweaked the names. The ::context() is going to be called ::host(). I&apos;ll post more on public-webapps today.

http://www.w3.org/2013/06/21-webapps-minutes.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89763</commentid>
    <comment_count>3</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-06-24 18:21:13 +0000</bug_when>
    <thetext>:host(), of course.  (one colon, not two).

Full details:

:host (no parentheses) matches the host element.  (Kinda like :root, but for the shadow tree rather than the document.)

:host(&lt;compound-selector&gt;) attempts to match the selector against each element in the fully-composed ancestor list, starting from and including the host element, ending in the document root. It matches the host element if the compound selector successfully matches against anything.

:host() (empty argument) is identical to :host(*), which is identical to :host - they match the host element unconditionally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89771</commentid>
    <comment_count>4</comment_count>
    <who name="Steve Orvell">sorvell</who>
    <bug_when>2013-06-24 21:35:18 +0000</bug_when>
    <thetext>In the f2f on this last Friday, we decided that :host should *not* allow combinators, as Tab noted.

The idea is that from a given shadowRoot, it&apos;s important to be able to glean some information about the composed tree (for example, does it match an important theming selector), but it&apos;s brittle to rely on composed tree structure (is A inside of B) because its details may change and shouldn&apos;t be known to a given shadowRoot.

Hayato-san, in your document, it looks like you&apos;re proposing that :host allow combinators as long as they match within the host scope. That&apos;s an interesting restriction and addresses the concern above, but my sense is that the additional expressiveness is offset by the arcane host scope matching behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89772</commentid>
    <comment_count>5</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-06-24 21:40:33 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; In the f2f on this last Friday, we decided that :host should *not* allow
&gt; combinators, as Tab noted.
&gt; 
&gt; The idea is that from a given shadowRoot, it&apos;s important to be able to glean
&gt; some information about the composed tree (for example, does it match an
&gt; important theming selector), but it&apos;s brittle to rely on composed tree
&gt; structure (is A inside of B) because its details may change and shouldn&apos;t be
&gt; known to a given shadowRoot.
&gt; 
&gt; Hayato-san, in your document, it looks like you&apos;re proposing that :host
&gt; allow combinators as long as they match within the host scope. That&apos;s an
&gt; interesting restriction and addresses the concern above, but my sense is
&gt; that the additional expressiveness is offset by the arcane host scope
&gt; matching behavior.

Yes, we do *not* want combinators, even if they&apos;re just parent or descendant combinators.  We&apos;re matching against the fully composed ancestor list, which includes the shadow trees of any enclosing components, and we don&apos;t want to expose the details of those trees more than necessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89780</commentid>
    <comment_count>6</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-06-25 02:31:10 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; In the f2f on this last Friday, we decided that :host should *not* allow
&gt; &gt; combinators, as Tab noted.
&gt; &gt; 
&gt; &gt; The idea is that from a given shadowRoot, it&apos;s important to be able to glean
&gt; &gt; some information about the composed tree (for example, does it match an
&gt; &gt; important theming selector), but it&apos;s brittle to rely on composed tree
&gt; &gt; structure (is A inside of B) because its details may change and shouldn&apos;t be
&gt; &gt; known to a given shadowRoot.
&gt; &gt; 
&gt; &gt; Hayato-san, in your document, it looks like you&apos;re proposing that :host
&gt; &gt; allow combinators as long as they match within the host scope. That&apos;s an
&gt; &gt; interesting restriction and addresses the concern above, but my sense is
&gt; &gt; that the additional expressiveness is offset by the arcane host scope
&gt; &gt; matching behavior.
&gt; 
&gt; Yes, we do *not* want combinators, even if they&apos;re just parent or descendant
&gt; combinators.  We&apos;re matching against the fully composed ancestor list, which
&gt; includes the shadow trees of any enclosing components, and we don&apos;t want to
&gt; expose the details of those trees more than necessary.

Okay. I don&apos;t have a strong opinion for that.

While we lose a power of a combinator, we get a power to match against the fully composed ancestor list. It would be enough in practical cases. Sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90896</commentid>
    <comment_count>7</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-07-17 22:14:08 +0000</bug_when>
    <thetext>*** Bug 21391 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104308</commentid>
    <comment_count>8</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-04-24 01:22:39 +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>