Re: [csswg-drafts] [css-contain-2] Should CSS highlights make content relevant to the user? (#9277)

I suspect `::selection` is the important one here. The reason for making selection cause content to be relevant is because this is the copy target when the user hits cmd-c or ctrl-c, so even if content is off-screen, it should still be selected with up to date rendering.

It's not as straightforward to say that the element with `::selection` pseudo element is the right one, since the highlight pseudos can be parented arbitrarily. This is  according to https://drafts.csswg.org/css-pseudo-4/#highlight-pseudos:

> The [highlight pseudo-elements](https://drafts.csswg.org/css-pseudo-4/#highlight-pseudo-element) do not necessarily fit into the element tree, and can arbitrarily cross element boundaries without honoring its nesting structure.

I'm not sure if there's a better spec text to explain what selection means though

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


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

Received on Wednesday, 30 August 2023 23:19:15 UTC