[csswg-drafts] [css-highlight-api] Use marker nodes to declaratively annotate highlights (#13381)

noamr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-highlight-api] Use marker nodes to declaratively annotate highlights ==
An emerging feature in HTML, [out of order streaming](https://github.com/whatwg/html/issues/11542), is converging towards creating a new node type called "marker", currently proposed as something like:

```html
<!mark name="some-void-range">
<!start name="some-range">
Stuff
<!end name="some-range">
```

This marker annotates a range, and is used by a corresponding template to "patch" that range declaratively.

This feature can be extended to work nicely with highlights, as it uses the same concepts of naming ranges, though with slightly different semantics (range names are scoped to an element and patching only finds flat ranges), and with missing semantics related to highlights in particular (type, priority).

Opening this issue to start this thinking going, as using this can relieve the use of JS for creating ranges for the purposes of highlighting.

We would need to:
1. See if this makes sense in general
2. See how to coordinate the scope of resolving the name
3. We might need a new type of `AbstractRange`, as those ranges are not exactly live ranges.
4. See how we can express priority/type.



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13381 using your GitHub account


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

Received on Thursday, 22 January 2026 13:16:51 UTC