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 18444 - [Shadow]: @host @-rules vs rules in document tree
Summary: [Shadow]: @host @-rules vs rules in document tree
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 16009
  Show dependency treegraph
 
Reported: 2012-07-31 07:04 UTC by Takashi Sakamoto
Modified: 2012-08-06 02:23 UTC (History)
0 users

See Also:


Attachments

Description Takashi Sakamoto 2012-07-31 07:04:35 UTC
I would like to confirm what specificity @host @-rules have.  For example,

<head>
<style> host { color: red; } </style>
</head>
<body>
<div id="host"><span>distributed node</span></div>
</body>

and 

var shadowRoot = new WebKitShadowRoot(document.getElementById("host"));
shadowRoot.innerHTML = "<style>@host { color: blue; }</style><shadow></shadow>";

What color will be applied to the host?
If we use class rules instead, what color will be applied to the host? i.e.

<style> .hostClass { color: red; } </style>
<div id="host" class="hostClass"><span>distributed node</span></div>

Currently I'm thinking of the following way:
(1) If there exists any inline style, apply. Skip (2) and (3).
(2) If there exists any @host @-rule, apply. Skip (3).
(3) If there exists any rules (id rules, class rules and so on) declared in some style element in document tree, apply.

Is this correct?
Comment 1 Takashi Sakamoto 2012-07-31 08:57:45 UTC
I'm sorry. I found a mistake. I mean,

<style> #host { color: read; } </style>

Best regards,
Takashi Sakamoto
Comment 2 Takashi Sakamoto 2012-07-31 08:58:47 UTC
I'm sorry. "read" is typo.

<style> #host { color: red; } </style>
Comment 3 Dimitri Glazkov 2012-08-03 23:20:58 UTC
http://dvcs.w3.org/hg/webcomponents/rev/5b8b6007c651
Comment 4 Takashi Sakamoto 2012-08-06 02:23:59 UTC
Thank you for updating the spec.

Best regards,
Takashi Sakamoto