W3C home > Mailing lists > Public > public-html@w3.org > June 2007

Re: Scoped style element questions Re: Unscoped <style> found outside the <head>

From: liorean <liorean@gmail.com>
Date: Sat, 2 Jun 2007 10:08:16 +0200
Message-ID: <cee13aa30706020108g1bef6facufd95af865387d6e4@mail.gmail.com>
To: "HTML WG" <public-html@w3.org>

On 01/06/07, Olivier GENDRIN <olivier.gendrin@gmail.com> wrote:
> And what about body, head css target ? How to handle a scoped
> body{background: #fff} ?

As I see it, the logical way to handle that is to always resolve
styles from the document node. I.e. the :root selector still applies
to the document element etc. However, we only *apply* the styles to
the specific subtrees that are later siblings to the style element.

> If we make an analogy with a full documents, we could consider that a
> scoped html applies to the parent element of <style>, and that body
> applies to the sibblings (they can also be targeted by usual
> selectors).

I don't think it's a good idea to do that. Let selectors and selector
resolution be unchanged, or you're going to end with a lot of confused
developers. Possibly you could introduce scoped pseudo-elements for
this case however. How about ::scoperoot to match the document
fragment that consists of all later siblings of the style element?

> And what about external stylesheets ? <style> should have a @src
> element that could be scoped.

Any reason not to have a style sheet inherit the scoping of it's owner
rule (recursively) so that @import in a scoped style element does just
that?
-- 
David "liorean" Andersson
Received on Saturday, 2 June 2007 08:08:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:00 GMT