W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

Re: [csswg-drafts] [css-highlight-api] Specifying behavior for Highlights involving multiple documents (#6417)

From: Sanket Joshi via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Jul 2021 17:51:21 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-880091417-1626285079-sysbot+gh@w3.org>
RE priority: See the full discussion here: https://github.com/w3c/csswg-drafts/issues/4591#issuecomment-790012016. Priority can't be CSS property because that would allow two highlight pseudos to be stacked differently in different locations within the document, which would violate the "single overlay per highlight for the whole document" principle layed out by the CSS pseudo spec. We also discussed other options for modeling priority, but amongst the options we came up with, a priority attribute on Highlight still seemed to be the best way forward.

Additionally, in the future, when we spec highlight events, it will be beneficial to have the `Highlight` object and make it an event target. This will make it easier for authors to write event handlers that target any range in a highlight. Ex: The author may want to show a corrections card when the user clicks on spelling errors (implemented via custom highlights) on the page. By making `Highlight` an event target, the author can write a handler that targets all spelling errors, rather than having to write one per range.

RE the cross-document cases: Yes, we should update the spec to describe how cross-document cases should be handled. I don't believe there are actual use cases for doing this, therefore I'm okay just doing something simple to handle these reasonably. The suggested solution sound reasonable to me: (1) allow highlights to be registered in multiple highlight registries, and (2) when painting highlights registered within a given registry, do not paint ranges that are associated with a different document. In Chromium at least, I don't believe this will be too hard to implement.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 14 July 2021 17:51:22 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:39 UTC