- From: Noam Rosenthal via GitHub <noreply@w3.org>
- Date: Thu, 22 Jan 2026 19:54:53 +0000
- To: public-css-archive@w3.org
> This is a nice idea. My main question is whether marks can select specific ranges of text within a single text node like this: > > <div> > Earlier stuff<!start name="some-range">Stuff<!end name="some-range">Later stuff > </div> > If not, it might not work for most usage of highlight API. That ability to style a substring in a text node without wrapping the substring in another element is the main point of Highlight API, because if the substring is wrapped in another element then that element can be styled directly. This would split the text node to multiple nodes, but it would remain the same element, which means it won't affect styling. It would behave the same as this as far as styiling is concerned: ```html <div> Earlier stuff<!-- start -->Stuff<!-- end -->Later stuff </div> ``` Is this workable? > > > 2. See how to coordinate the scope of resolving the name > > Names in the [HighlightRegistry](https://developer.mozilla.org/en-US/docs/Web/API/HighlightRegistry) are global to the document (including shadow roots), so that might need to be the scoping for the declarative approach too. > > > 3. We might need a new type of AbstractRange, as those ranges are not exactly live ranges. > > Can it be `StaticRange`? Probably not because the DOM might change in a way where more markers with that name are added. > > > 4. See how we can express priority/type. > > Attributes on `<!mark>`, maybe? > > <!start name="some-range" type="spelling-error" priority="2"> > Stuff > <!end name="some-range"> Yea that's an option. Or maybe that can be in a CSS rule somehow? -- GitHub Notification of comment by noamr Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13381#issuecomment-3786393539 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 19:54:54 UTC