W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: [selectors-api] Consider backporting find() behavior to querySelector()

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Wed, 20 Jun 2012 19:46:54 +0400
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: Simon Pieters <simonp@opera.com>,public-webapps.w3.org <public-webapps@w3.org>
Message-Id: <1131341340207214@web18e.yandex.ru>
20.06.2012, 18:14, "Lachlan Hunt" <lachlan.hunt@lachy.id.au>:
> 4. Support for returning elements that are not descendants of the
> ššššcontext object.
> This feature allows a selector to be constructed such that it matches an
> element anywhere in the tree relative to the context element. This
> feature is not relevant to document.find(), since it can already return
> anything from the whole tree.
> šššelm.find("+span") ššššššš// span is a sibling
> šššelm.find("/for/ input") š// input could be anywhere
> šššelm.find(":not(:scope)") // Everything except the context object
> This feature cannot be supported on Element.qSA, even when using eplicit
> :scope, because matching elements need to be descendants of the context
> object.

It's unclear why an _updated_ qSA version should have same limitation that "matching elements need to be descendants of the context object". There is nothing obvious that makes h1.querySelector('+ H2') impossible to work in newer implementations (in older ones it would not work anyway -- to the same extent as `elm.querySelector(">span")` that you've declared as "could work").
Received on Wednesday, 20 June 2012 15:47:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:34 UTC