<?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>110763</bug_id>
          
          <creation_ts>2013-02-25 09:50:45 -0800</creation_ts>
          <short_desc>[Shadow]: @host rules defined within @media selectors are not applied</short_desc>
          <delta_ts>2019-10-04 22:52:36 -0700</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>Mac (Intel)</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>59827</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Steve Orvell">sorvell</reporter>
          <assigned_to name="Web Components Team">webcomponents-bugzilla</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>dominicc</cc>
    
    <cc>ericbidelman</cc>
    
    <cc>rniwa</cc>
    
    <cc>tabatkins</cc>
    
    <cc>tasak</cc>
    
    <cc>webcomponents-bugzilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>841046</commentid>
    <comment_count>0</comment_count>
      <attachid>190076</attachid>
    <who name="Steve Orvell">sorvell</who>
    <bug_when>2013-02-25 09:50:45 -0800</bug_when>
    <thetext>Created attachment 190076
reduction

With a construction like this, an @host rule is not applied.

@media screen and (max-width: 800px) {
   @host {
     * {
       background: green;
     }
   }
}

See the attached reduction and resize the window &gt; and &lt; 800px width to observe results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>850955</commentid>
    <comment_count>1</comment_count>
    <who name="Takashi Sakamoto">tasak</who>
    <bug_when>2013-03-08 00:33:43 -0800</bug_when>
    <thetext>Currently CSSGrammar.y.in cannot parse @host in @media. So we need to modify CSSGrammar.y.in (maybe, adding host to block_valid_rule).

However if we change the place of @host with @media&apos;s (I&apos;m not sure whether this is a valid css code or not), i.e.

@host {
   @media screen and (max-width: 800px) {
      * {
         background: green;
      }
   }
}

we need to change RuleSet.cpp (i.e. RuleSet::addChildRules).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>851246</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2013-03-08 09:21:15 -0800</bug_when>
    <thetext>Tab, can you chime in on what&apos;s valid syntax or not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>852046</commentid>
    <comment_count>3</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2013-03-10 22:25:17 -0700</bug_when>
    <thetext>We are seeking clarification from the spec: &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=21242&gt;

Given a lawyerly reading of that, @host rules should not be parsed in a stylesheet at all because the &apos;host&apos; production, though defined, is not used in the &apos;stylesheet&apos; production.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1577188</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-10-04 22:52:36 -0700</bug_when>
    <thetext>@host isn&apos;t a thing anymore.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>190076</attachid>
            <date>2013-02-25 09:50:45 -0800</date>
            <delta_ts>2013-02-25 09:50:45 -0800</delta_ts>
            <desc>reduction</desc>
            <filename>host-media-reduction.html</filename>
            <type>text/html</type>
            <size>763</size>
            <attacher name="Steve Orvell">sorvell</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8dGl0bGU+SG9zdC1NZWRpYSBSZWR1Y3Rp
b248L3RpdGxlPgo8L2hlYWQ+Cjxib2R5PgogIDxwPlJlc2l6ZSB2aWV3cG9ydCB3aWR0aCA+IGFu
ZCA8IDgwMHB4IGFuZCBvYnNlcnZlIHJlc3VsdHMuPC9wPgogIDxkaXYgaWQ9InRlc3QiPjwvZGl2
PgogIDxzY3JpcHQ+CiAgICByb290ID0gdGVzdC53ZWJraXRDcmVhdGVTaGFkb3dSb290KCk7CiAg
ICByb290LmlubmVySFRNTCA9ICc8c3R5bGU+JyArCiAgICAgICdAaG9zdCB7ICogeyBiYWNrZ3Jv
dW5kOiB5ZWxsb3c7IH0gfSBcbicgKwogICAgICAnQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0
aDogODAwcHgpIHtcbicgKyAKICAgICAgJ1x0QGhvc3QgeyAqIHsgYmFja2dyb3VuZDogZ3JlZW47
IH0gfSBcbicgKwogICAgICAnfTwvc3R5bGU+JyArCiAgICAgICdIZWxsbyBXb3JsZCEnOwogIDwv
c2NyaXB0PgogIDxicj48aHI+CiAgPHA+RXhwZWN0ZWQgcmVzdWx0OjwvcD4KICA8ZGl2IGNsYXNz
PSJ0ZXN0Ij4KICAgIDxzdHlsZSBzY29wZWQ+CiAgICAgIC50ZXN0IHsgCiAgICAgICAgYmFja2dy
b3VuZDogeWVsbG93OwogICAgICB9CiAgICAgIAogICAgICBAbWVkaWEgc2NyZWVuIGFuZCAobWF4
LXdpZHRoOiA4MDBweCkgewogICAgICAgIC50ZXN0IHsKICAgICAgICAgIGJhY2tncm91bmQ6IGdy
ZWVuOwogICAgICAgIH0KICAgICAgfQogICAgPC9zdHlsZT4KICAgIEhlbGxvIFdvcmxkIQogIDwv
ZGl2Pgo8L2JvZHk+Cgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>