Re: [csswg-drafts] [selectors] Drop `:target-within`, deprecate `:focus-within` (#8357)

The CSS Working Group just discussed `Dropping :target-within, deprecating :focus-within`, and agreed to the following:

* `RESOLVED: Keep :focus-within, replace :target-within with a note that we hope :has(:target) is sufficient for use cases`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Dropping :target-within, deprecating :focus-within<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/8357<br>
&lt;fantasai> TabAtkins: It's possible we can just close this?<br>
&lt;fantasai> TabAtkins: Oriol points out that :focus-within has a number of arguments in favor of existence<br>
&lt;fantasai> TabAtkins: it operates on flat tree, has better perf, and includes the element itself<br>
&lt;fantasai> TabAtkins: Lea agrees<br>
&lt;fantasai> TabAtkins: :target-within, given no impl yet might be fine to drop, but I presume it has similar arguments for :focus-within<br>
&lt;florian> q+<br>
&lt;oriol> q+<br>
&lt;emilio> fantasai: In favor of keeping both for the reasons mentioned<br>
&lt;TabAtkins> fantasai: I'm in favor of keeping thm both for the reasons given<br>
&lt;fantasai> florian: I think we should definitely keep :focus-within, this has very relevant usage<br>
&lt;fantasai> florian: before we had :has() there was movement to add various :*-within for other things<br>
&lt;fantasai> florian: but now we do have :has(), so I'm less sure about adding more that are not as hot in terms of usage as :focus-within<br>
&lt;fantasai> florian: :target-within already in the spec, but no implementation, suggests lesser demand<br>
&lt;fantasai> florian: possibly to re-add later, if we observe :has()<br>
&lt;fantasai> florian: if too hard to optimize<br>
&lt;astearns> ack fantasai<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: but if can do with :has(), seems fine<br>
&lt;astearns> ack oriol<br>
&lt;fantasai> florian: so I would keep :focus-within and drop :target-within<br>
&lt;fantasai> oriol: I agree we should keep :focus-within and drop :target-within<br>
&lt;fantasai> oriol: point about flat tree doesn't seem to apply, I couldn't get :target to work with shadow DOM<br>
&lt;fantasai> oriol: perf isn't an issue here<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to point out shadow tree aspect<br>
&lt;emilio> fantasai: wdym you can't make them work on the shadow dom?<br>
&lt;emilio> ... if you have anchors in your shadow tree, you can't make `:target-within` match that<br>
&lt;emilio> oriol: I'd need to test again<br>
&lt;emilio> q+<br>
&lt;fantasai> s/:target-within/:has(:target)/<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: having :target match inside a shadow tree doesn't make sense, because URL only works in the outer tree<br>
&lt;fantasai> astearns: given lack of implementation, and implementation interest, I'd be OK adding a note saying that we believe :has(:target) is sufficient, but if there's some implication that requires it we might add it back<br>
&lt;fantasai> wfm<br>
&lt;fantasai> astearns: other opinions?<br>
&lt;fantasai> astearns: proposed resolution is to keep :focus-within and replace :target-within with a note that we hope :has(:target) is sufficient for use cases<br>
&lt;fantasai> RESOLVED: Keep :focus-within, replace :target-within with a note that we hope :has(:target) is sufficient for use cases<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8357#issuecomment-1680937182 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 August 2023 16:41:03 UTC