Anne van Kesteren wrote:
If :scope needs to work matching in implementations might need to change by the way. Currently matching is only against the subtree. So <div>.querySelector("div") would only match descendant <div> elements.

That just means that it will only return elements that are descendants, but selects are still evaluated in the context of the entire tree.

  div.querySelector(":scope");

won't return anything, since the the selecor is referring to the element itself and is therefore quite a useless thing to do, but:

  div.querySelector(":scope>span")

will return only span elements that are children of that div element.

--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Reply via email to