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

Re: [selectors-api] Matching of :scope in document.querySelector(All)

From: Dean Edwards <dean.edwards@gmail.com>
Date: Fri, 30 Nov 2012 13:58:42 +0000
Message-ID: <CAJMHKgzHuodv_d8f+BpoGbwT3YhzNw5REQ-CBA1QF7exMGgj5A@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-webapps@w3.org
On 30 November 2012 02:01, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> When implementing :scope support, I discovered that as things stand this
> call:
>
>   document.querySelector(":scope")
>
> is specified to return null.  In particular
> http://dev.w3.org/2006/webapi/selectors-api2/#queryselector step 1 calls
> http://dev.w3.org/2006/webapi/selectors-api2/#determine-contextual-reference-nodes
> which returns an empty set.  Then this empty set is passed as an explicit
> contextual reference set to selector matching in
> http://dev.w3.org/2006/webapi/selectors-api2/#evaluate-a-selector so that
> :scope doesn't match anything.
>
> Is this intentional?  I would have expected the above call to return the
> documentElement, which is what :scope would match in a non-scoped
> stylesheet...


I would expect it to return documentElement too. Webkit's
implementation does this.

-dean
Received on Sunday, 2 December 2012 10:34:29 GMT

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