Re: [csswg-drafts] [selectors-4] Disallow pseudo-elements inside :has() (#7463)

:has(::before) probably won't be useful since the answer is always the same but returning true seems more correct.

The pseudo-elements being introduced for page-transition would satisfy this constraint, "pseudos which, while they may or may not depend on CSS properties for their original creation, do not depend on CSS for their continued existence, so any styles you set won't affect their lifetime."

Their creation is dependent on CSS (page-transition-tag) but once the elements are created their existence can not be toggled using CSS for the duration of a transition. There is some subtlety in that tearing down the whole setup relies on checking if these pseudo-elements have an active animation, which itself can be controlled by CSS. But once we detect that there are no active animations, the pseudo-elements are torn down irrespective of if the style changes to add an animation again.

I think it makes sense to add an exception for page-transition pseudo-elements once that has been spec'd.

Are there any existing pseudo elements which would fit in this category, to motivate introducing this concept. ::before/::after don't seem as motivating since they'll always have the same answer.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7463#issuecomment-1190367106 using your GitHub account


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

Received on Wednesday, 20 July 2022 14:35:24 UTC