W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2011

[whatwg] Selectors within <style scoped>

From: Roland Steiner <rolandsteiner@google.com>
Date: Tue, 19 Jul 2011 13:10:16 +0900
Message-ID: <CACFPSpjE2N9-Cgc3o_i3heKy8JnCXerfkdh3E4=gD0v1MR5u2w@mail.gmail.com>
On Tue, Jul 19, 2011 at 12:40 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 7/18/11 10:55 PM, Dimitri Glazkov wrote:
>
>> I actually really like this proposal.
>>
>> Let's do this. Roland, Dave, Boris -- what do y'all think?
>>
>
> The proposal being that all selectors are scoped except the ones where
> :root is present in the first sequence of simple selectors (not quite what
> Kornel said, but I think that's what he meant)?
>
> That seems ok to me, I think.  David, thoughts?
>

Just to nail this down:

foo .bar
    scoped, foo must be the scope element or a descendant

:root foo .bar
    NOT scoped, foo can be matched outside the scope

html foo .bar
    scoped, will not match, unless <html> element itself somehow becomes the
scoping element (can this happen?)

body foo .bar
    scoped, will potentially match only if <style scoped> is a direct child
of <body> (thus <body> becoming the scoping element)

html:root foo .bar
    NOT scoped due to the presence of :root in the first sequence (even
though not absolutely the first simple selector)

Seems reasonable, except there may be the question why it "works" with
:root, but not with 'html' or 'body', but I guess that can be explained.


Cheers,

- Roland
Received on Monday, 18 July 2011 21:10:16 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:34 UTC