- From: Robert Flack via GitHub <sysbot+gh@w3.org>
- Date: Tue, 02 Aug 2022 14:56:25 +0000
- To: public-css-archive@w3.org
I suspect that if you have multiple highlight ranges with different behavior that they should maybe be different highlight instances, in which case maybe `CSS.highlights` should support adding multiple highlight instances to a single named highlight, e.g. something like this:
```js
// Get array of Highlight instances for found text.
let results = findText(text);
CSS.highlights.clear("find-highlights");
for (result of results)
CSS.highlights.add("find-highlights", result);
```
This way the developer can attach behavior based on the particular find result, which in some cases may be based on additional context gathered from around the result.
--
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7512#issuecomment-1202752510 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 2 August 2022 14:56:27 UTC