Re: [csswg-drafts] [selectors] Child & descendant pseudo element combinators (#7346)

The CSS Working Group just discussed `[selectors] Child & descendant pseudo element combinators`, and agreed to the following:

* `RESOLVED: Start selectors 5 with the experimental work from this issue`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: [selectors] Child &amp; descendant pseudo element combinators<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/7346<br>
&lt;dael> TabAtkins: We've had for a little while a minor problem where pseudo elements inside pseudo elements have been tricky to target<br>
&lt;dael> TabAtkins: Repeatedly written incorrect rules that do not correctly target. *::marker doesn't hit inside ::before<br>
&lt;dael> TabAtkins: This will get more problematic over time as we add things like shared element transitions with a family of nested pseudo elements. Targetting a grandchild of a transistion element you have the name the transition tag regardless of where because can't meaningfully use target<br>
&lt;dael> TabAtkins: You can't save effort with nesting either<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: Jake came up with the idea of having a combinator that can select into pseudo tree as a descdendant combinator. You say a name and you find it regardless of how nested it is<br>
&lt;dael> TabAtkins: Suggested syntax is :> for child pseudo combinator and :>> for the new descendant that goes asdeep as needed<br>
&lt;astearns> 'arrow' being '>', not '->'<br>
&lt;dael> TabAtkins: Specifics is when you use this combinator pseudo elements are elements with tag that is their element. :: is not part of the name<br>
&lt;heycam> q+<br>
&lt;dael> TabAtkins: I think that's the specifics. Allows us to greatly simplify and write code targetting, for example, ::marker<br>
&lt;dael> TabAtkins: Thoughts?<br>
&lt;dael> heycam: Can you summerize why not possible to use regular child and descendants once past first ::? If we're considering things inside top level can we use regular tag name matching?<br>
&lt;fantasai> heycam++<br>
&lt;dael> TabAtkins: Issue with doing that, first is would not let you generically select into psuedo trees. That feels not great that you have to enter the pseudo tree with a specific name and then you can do arbitary.<br>
&lt;Rossen_> ack heycam<br>
&lt;dael> TabAtkins: Slightly more important issue is it presupposes we don't event use child relationships in any other way which I'm not certain we want to guarantee. Some pseudo elements refer to real elements like ::slotted. Right now can't access further into tree but I don't know why we wouldn't do that in the future<br>
&lt;fantasai> See also https://www.w3.org/TR/2014/WD-css-scoping-1-20140403/#fragment-scoping<br>
&lt;dael> TabAtkins: instead idea here is there's a separate relationship and this combinator only goes across pseudo/child relationship<br>
&lt;dael> heycam: Makes sense<br>
&lt;dael> fantasai: one specific area we thought about this is ::page or ::colun type things and being able to pick elemental fragments in that fragmented region.<br>
&lt;dael> fantasai: We had thought about doing something where you can style black and white columns differently which needs you to enter the tree<br>
&lt;dael> Rossen_: fantasai I saw your last comment lifting BradK's old response. Is this something we want to repeat here?<br>
&lt;dael> fantasai: I think I was pulling up old comments. Haven't thought deeply to have a conclusion. Idea of going deeper into pseudo tree makes sense. I think bradk comment was we ID psuedo elements with a name that begins ::. The pseudo element is named :: which is how we know it's not real. This prop breaks that naming association<br>
&lt;dael> fantasai: I think it's a comment worth thinking about.<br>
&lt;dael> fantasai: Idea of using combinator syntax I can see benefits to it. I'm trying to think what's a way of keeping these considerations and bring together. Maybe instead of :> we do ::> so maybe still association with pseudo element so at least you've got two :s<br>
&lt;dael> TabAtkins: Using ::>?<br>
&lt;dael> fantasai: Yeah<br>
&lt;dael> TabAtkins: That would be fine. I suggested : to suggest pseudo, but more explict ::> is fine<br>
&lt;vmpstr> q+<br>
&lt;dael> TabAtkins: Obvious solution is :: as combinator and for reasons I explored years ago that's unfortunately impossible due to selector syntax. But it would be fine with ::> and ::>><br>
&lt;Rossen_> ack vmpstr<br>
&lt;dael> vmpstr: I wanted to ask how would this interact with :has?<br>
&lt;dael> vmpstr: Presumably to know if there is a pseudo element you need up to date style and I don't think we do this now. And with :has you can make it display:none<br>
&lt;dael> TabAtkins: Good question. B/c pseudo elements always exist or conditionally exist I suggest answer is :has can't see pseudo elements when you select that deep. We can address it in the future if there's a need, but I would say we should make it invalid to use the combinator<br>
&lt;dael> fantasai: Should we also make pseudo elements invalid in has in general?<br>
&lt;Rossen_> ч?<br>
&lt;dael> TabAtkins: I don't know<br>
&lt;dael> fantasai: Has the same problem<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: Not sure you can write selectors that are problematic. If you can we should<br>
&lt;dael> fantasai: I suggest we make both invalid for now<br>
&lt;dael> Rossen_: Additional feedback for TabAtkins or Jake?<br>
&lt;dael> fantasai: I'd like to have a few more people weigh in but this overall makes sense to do this<br>
&lt;dael> TabAtkins: I can start laying down details in spec and we can get eyes once there's text. As long as no obvious objection now I'm happy<br>
&lt;dael> Rossen_: Not hearing any such objection from dozen or so people on the call<br>
&lt;dael> Rossen_: Let's move forward with spec. Once you have that hopefully more people will provide feedback<br>
&lt;dael> fantasai: RElated question, do we want to take a cut of selectors 4 to CR and redraft selectors 5?<br>
&lt;dael> TabAtkins: Think so and happy to put this in selectors 5<br>
&lt;dael> fantasai: Okay. Let's do that and you and I can work on taking a cut of selectors 4<br>
&lt;dael> TabAtkins: sgtm<br>
&lt;dael> Rossen_: Let's resolve on starting selectors 5 with the experimental work from this issue<br>
&lt;dael> Rossen_: Obj?<br>
&lt;dael> RESOLVED: Start selectors 5 with the experimental work from this issue<br>
&lt;dael> Rossen_: For selectors 4, any resolution for that at this point?<br>
&lt;dael> fantasai: We were going to make it invalid to use a pseudo element inside :has<br>
&lt;dael> Rossen_: Is this part of the issue or part of moving selectors 4?<br>
&lt;dael> fantasai: Related to this issue b/c this issue brought what happens if you put pseudo element in :has<br>
&lt;dael> jensimmons: We should open a new issue for that and give it more time<br>
&lt;dael> jensimmons: I don't think we should do it ahead of time b/c we think this is going to go through. We should look at present state<br>
&lt;astearns> +1 to a separate issue to discuss async and bring it back for a resolution<br>
&lt;dael> fantasai: Yes, looking at current and think it's a problem for the same reason as in context of this discussion. I think it's something we didn't consider. Allowing url:has(::marker) is confusion and shouldn't be possible<br>
&lt;fantasai> ol:has(li::marker) is confusing and shouldn't be possible<br>
&lt;dael> jensimmons: Cool. How about open an issue for next week's agenda<br>
&lt;dael> Rossen_: I don't mind that at all since the proposed resolution also didn't come through to me clearly from the previous converation<br>
&lt;dael> Rossen_: Do we want to fork that into a new issue and slot it for next week? It will fit nicely with some other items we're skipping this week<br>
&lt;dael> fantasai: Okay<br>
&lt;dael> Rossen_: Next week we can take all the resolutions to move selectors 4 forward<br>
&lt;dael> Rossen_: fantasai will you open?<br>
&lt;dael> fantasai: Sure<br>
&lt;dael> Rossen_: Anything else on this issue?<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/7463<br>
</details>


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


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

Received on Wednesday, 6 July 2022 23:37:03 UTC