Bug 110763 - [Shadow]: @host rules defined within @media selectors are not applied
Summary: [Shadow]: @host rules defined within @media selectors are not applied
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) Unspecified
: P2 Normal
Assignee: Web Components Team
URL:
Keywords: HasReduction
Depends on:
Blocks: 59827
  Show dependency treegraph
 
Reported: 2013-02-25 09:50 PST by Steve Orvell
Modified: 2019-10-04 22:52 PDT (History)
7 users (show)

See Also:


Attachments
reduction (763 bytes, text/html)
2013-02-25 09:50 PST, Steve Orvell
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.