[whatwg] Selectors within <style scoped>

Roland Steiner rolandsteiner at google.com
Mon Jul 18 21:30:02 PDT 2011


On Tue, Jul 19, 2011 at 1:14 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> 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
>

I think one could argue for either case. Personally, I think it's
advantageous to include the scoping element (i.e., use ":scope foo .bar,
foo:scope .bar"), in order to be able to do style the scoping element itself
rather than its children individually, e.g.

:scope { background-color: mauve; }

This otherwise would be impossible in the given proposal, without resorting
to either a) add :root for no semantic reason or b) wrap the contents of the
scoping element within another element, just to be able to style it.


- Roland



More information about the whatwg mailing list