[whatwg] Selectors within <style scoped>

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