Bug 110763

Summary: [Shadow]: @host rules defined within @media selectors are not applied
Product: WebKit Reporter: Steve Orvell <sorvell>
Component: DOMAssignee: Web Components Team <webcomponents-bugzilla>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: dglazkov, dominicc, ericbidelman, rniwa, tabatkins, tasak, webcomponents-bugzilla
Priority: P2 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 59827    
Attachments:
Description Flags
reduction none

Description Steve Orvell 2013-02-25 09:50:45 PST
Created attachment 190076 [details]
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 > and < 800px width to observe results.
Comment 1 Takashi Sakamoto 2013-03-08 00:33:43 PST
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's (I'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).
Comment 2 Dimitri Glazkov (Google) 2013-03-08 09:21:15 PST
Tab, can you chime in on what's valid syntax or not?
Comment 3 Dominic Cooney 2013-03-10 22:25:17 PDT
We are seeking clarification from the spec: <https://www.w3.org/Bugs/Public/show_bug.cgi?id=21242>

Given a lawyerly reading of that, @host rules should not be parsed in a stylesheet at all because the 'host' production, though defined, is not used in the 'stylesheet' production.
Comment 4 Ryosuke Niwa 2019-10-04 22:52:36 PDT
@host isn't a thing anymore.