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

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 UTC