W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: QSA, the problem with ":scope", and naming

From: Roland Steiner <rolandsteiner@google.com>
Date: Thu, 20 Oct 2011 17:09:14 +0900
Message-ID: <CACFPSpgTTJfRh_NaXNpfmGnpE37nhLESn3uAav8nyqepS08fww@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Ojan Vafai <ojan@chromium.org>, Alex Russell <slightlyoff@google.com>, Webapps WG <public-webapps@w3.org>, Yehuda Katz <wycats@gmail.com>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>, Lachlan Hunt <lachlan.hunt@lachy.id.au>
On Thu, Oct 20, 2011 at 14:52, Jonas Sicking <jonas@sicking.cc> wrote:

> > <style scoped> should (I think) have three cases:
> >
> > 1. Selector without :scope - same as .find
> > 2. Selector with :scope - Same as #1, but also including the context
> node.
> > 3. Selector in @global - run the selector across the entire document,
> > filter the results to only be the context node and its descendants.
> >
> > (Some people disagree with me on this, and think that #1 and #2 should
> > be merged to always include the context node.  That's acceptable, but
> > I don't like it as much.)
> >
> > I think it's perfectly okay that these two APIs have different cases.
>
> I'm not sure I understand what you are proposing here. Are you saying that
>
> <div>
> <style scoped>
> :scope {
>  background: green;
> }
> </style>
> </div>
>
> should set the background of the <div> green? This does seem intuitive
> I agree, but it might also lead to strange behavior since the
> rendering of the <div> will change once the stylesheet is parsed. In
> other words, it's very easy to get flash-of-unstyled-content behavior.
>

Hixie's - again valid IMHO - counterargument for this was that, with the
above proposal:

    div { background-color-green }

would not color the scoping element, while the more specific (!)

    div:scope { background-color: green }

would. I.e., a more specific selector suddenly selecting MORE elements than
a not so specific one.


- Roland
Received on Thursday, 20 October 2011 08:10:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT