Summary: | [Shadow]: @host rules defined within @media selectors are not applied | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Steve Orvell <sorvell> | ||||
Component: | DOM | Assignee: | 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: |
|
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). Tab, can you chime in on what's valid syntax or not? 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. @host isn't a thing anymore. |
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.