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

[whatwg] Selectors within <style scoped>

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 19 Jul 2011 00:14:55 -0400
Message-ID: <4E2504BF.70504@mit.edu>
On 7/19/11 12:10 AM, Roland Steiner wrote:
> Just to nail this down:
>
> foo .bar
>      scoped, foo must be the scope element or a descendant

This is actually an interesting question.  Does this end up 
corresponding to:

   :scope foo .bar, foo:scope .bar

or to just

   :scope foo .bar

?  The latter would not match on 'foo' being the scope element, while 
the former would.

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

I'd think so; you can always insertBefore a <style> element as a child 
of <html>.

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

Assuming there's no interesting DOM manipulation adding multiple 
HTMLBodyElement elements to the page, etc.

-Boris
Received on Monday, 18 July 2011 21:14:55 UTC

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