- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Sat, 17 Sep 2022 00:31:33 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `forgiving nature of :has()`. <details><summary>The full IRC log of that discussion</summary> <TabAtkins> Topic: forgiving nature of :has()<br> <TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7676<br> <TabAtkins> TabAtkins: i think we've lost enough people that are relevant to this<br> <TabAtkins> emilio: i have an opinion, but...<br> <TabAtkins> emilio: tldr is Chrome shipped :has() with forgiving parsing, bc jQuery calls querySelector() and if it throws, use their custom selector parser<br> <TabAtkins> emilio: i filed an issue a while ago about makign @support selector() not be forgiving, which lets jQuery do the right thing here, but that doesn't fix existing usage<br> <emilio> https://github.com/w3c/csswg-drafts/issues/7676#issuecomment-1235773031<br> <TabAtkins> emilio: 1) rename :has(), which isn't great<br> <TabAtkins> emilio: 2) give up on forgiving-selector-list, which also isn't great. is()/:where() already shipped with it<br> <TabAtkins> emilio: 2.5) give up on forgiving-selector-list in :has() specifically<br> <TabAtkins> Sorry, misminuted<br> <TabAtkins> emilio: 2.5) spec the webkit bug, which is unforgiving if *all* of the selectors fail<br> <TabAtkins> fremy: another idea is to explicitly check the jquery pseudoclasses and poison them<br> <fantasai> -1 to special-casing jquery<br> <TabAtkins> emilio: there's a lot, plus jquery just has some different parsing for the matching stuff of us, too<br> <TabAtkins> emilio: 3) leave it; if breakage isn't too big, oh well<br> <TabAtkins> fantasai: I'm okay with saying :has() is unforgiving, you can nest an :is() if you want<br> <TabAtkins> fantasai: lets authors be strict if they want<br> <fantasai> TabAtkins: We're not entirely consistent. :not() is unforgiving, for example<br> <andreubotella> q-<br> <astearns> ack andreubotella<br> <astearns> ack dbaron<br> <TabAtkins> dbaron: two thoughts, both weak prefs<br> <TabAtkins> dbaron: ONe is, I have mixed feelings about fogiving-selector-list<br> <TabAtkins> dbaron: even if the group thinks the old selector parsing is a mistake, having two models used in different places is worse than having just the bad one<br> <TabAtkins> dbaron: in terms of author confusion<br> <TabAtkins> dbaron: the other proposal is that :is() is different from :has() in now two ways<br> <TabAtkins> TabAtkins: you're confusing it with :where. :has() is completely different<br> <TabAtkins> dbaron: i'm not a fan of these names<br> <TabAtkins> dbaron: no strong suggestions for what to do about it<br> <astearns> ack fantasai<br> <TabAtkins> TabAtkins: Regardless of our opinions on :where(), that's not the current issue<br> <TabAtkins> dbaron: I do think it compounds the problem tho<br> <TabAtkins> fantasai: What if we just restricted forgivingness to :is() and :where() and nowhere else. If you really want it you can get it, and these two are basically just syntactic sugar for expanding things out anyway.<br> <fantasai> TabAtkins: if breakage is enough to worry about, and I think it might be<br> <florian> q?<br> <fantasai> TabAtkins: then that's my preferred solution of all of them<br> <TabAtkins> florian: so if that's the path we go, if you want forgiving-ness, you just do :has(:is()) ?<br> <TabAtkins> TabAtkins: yeah<br> <fantasai> TabAtkins: given that some ppl who know about badness of breakage aren't here<br> <fantasai> TabAtkins: I suggest we defer this, and say that if breakage is bad enough, we go with forgivingness only in :is() and :where()?<br> <fantasai> TabAtkins: We basically narrow to 2 options here<br> <fantasai> astearns: or switch it to unforgiving regardless<br> <fantasai> heycam|away: how do we decide if it's bad enough?<br> <fantasai> TabAtkins: been awhile since I looked<br> <fantasai> iank_: I think it was bad enough that we need to make a change<br> <TabAtkins> dbaron: I think the breakage came from jquery's test suite, not real sites<br> <TabAtkins> dbaron: but not sure<br> <astearns> https://github.com/w3c/csswg-drafts/issues/7676#issuecomment-1235441907<br> <TabAtkins> fantasai: that said, we still have you concerns<br> <TabAtkins> astearns: this comment says even if we make it unforgiving, :is() is still forgiving so it's a problem<br> <fantasai> TabAtkins: I made that comment, and response was that because :is() isn't part of jquery, much much less likely to trigger a problem<br> <fantasai> TabAtkins: it relies on code writing new standards-based selectors using :is() in old versions of jquery, which while it can happen is much less likely than new pages<br> <TabAtkins> TabAtkins: than old pages using jQuery's :has() and breaking due to the new standard :has()<br> <TabAtkins> astearns: So collect more info, provsionally conclude that making :has() unforgiving may be the path to fix if breakage is bad?<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7676#issuecomment-1249958942 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 17 September 2022 00:31:35 UTC