Re: [csswg-drafts] [selectors-4] Consider disallowing :has() outside the rightmost compound (#6845)

I'm not sure that this understanding helps this discussion, but I think it depends on the authors intention.

If an author needs to use `:has(.foo) div { ... }`, it means that the intention of the author is styling every `div` in the document according to the class value `.foo` in any elements. If we place the limitation, then anyway the author need to select every `div` elements and style those elements with some JavaScript codes whenever the class value `.foo` is changed.

If the author's intention is to style `div` elements inside some elements with certain condition (e.g. `.bar`), then he can add additional condition for the `:has(.foo)` affecting element (e.g. `.bar:has(.foo) div {...}`) to make the invalidation scope smaller. 

Like this, I think that, there can be some options that authors can choose to handle some trade-offs.

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


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

Received on Wednesday, 1 December 2021 03:47:59 UTC