W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2019

Re: [csswg-drafts] [selectors-4] Rescope :has to static CSS rather than .querySelector (#3925)

From: Ilya Streltsyn via GitHub <sysbot+gh@w3.org>
Date: Thu, 08 Aug 2019 08:41:08 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-519426616-1565253666-sysbot+gh@w3.org>
@ExE-Boss agree, this would be more suitable in most practical cases (though this seems to have a slightly different semantics in the unlikely case of nested `a` elements). I guess it also can be rewritten as a one-liner like `Array.from(document.querySelectorAll('a img'), img => img.closest('a'))` which would be probably even more performant. But my example was there just to illustrate the point that JS developers probably won't benefit from the new sub-syntax for the tree structure logic as much as CSS developers would benefit from content-depending styling of elements.

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3925#issuecomment-519426616 using your GitHub account
Received on Thursday, 8 August 2019 08:41:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:12 UTC