[whatwg] Selectors within <style scoped>

Boris Zbarsky bzbarsky at MIT.EDU
Mon Jul 18 21:14:55 PDT 2011

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.


More information about the whatwg mailing list