This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21202 - [Shadow]: Specify how :host() interacts with the scoped styles
Summary: [Shadow]: Specify how :host() interacts with the scoped styles
Status: RESOLVED LATER
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23062
  Show dependency treegraph
 
Reported: 2013-03-06 05:52 UTC by Dominic Cooney
Modified: 2014-04-24 00:56 UTC (History)
2 users (show)

See Also:


Attachments

Description Dominic Cooney 2013-03-06 05:52:19 UTC
The HTML5 spec says, of the HTMLStyleElement's scoped attribute:

"If the scoped attribute is present, then the user agent must apply the specified style information only to the style element's parent element (if any), and that element's descendants."

The Shadow DOM spec says, of style elements:

"Conversely, to enforce lower-boundary encapsulation, CSS rules declared in a shadow root style sheets must not apply in the document tree, with two exceptions: 1. ... 2. The @host @-rule matches a shadow host in the nesting tree."

Given an element with this in a shadow tree:

<style scoped>
@host {
  * { border: 1px solid salmon; }
}
</style>

then either the host element has salmon borders (ie the Shadow DOM spec wins) or it doesn't (ie the HTML5 spec wins.)

The Shadow DOM spec should clarify which it is.
Comment 1 Hayato Ito 2014-04-24 00:56:38 UTC
Let me close this bug.
I believe CSS scoping spec [1] should address this issue.

[1]: http://dev.w3.org/csswg/css-scoping/