Re: [csswg-drafts] [css-highlight-api] Figure out how highlights are exposed to the accessibility tree (#6498)

> For the use case of highlights in application-specific highlighting. Using this CSS API can an author define multiple different highlights and provide the associated text meaning of a particular color of highlight that can be relayed to AT using the CSS attributes? As an example, an app that scans through large amounts of text to highlight certain aspects particular to the search (e.g. to point out sentiments or emotions in text, such as positive, negative, neutral, happy, angry, etc.)

We’d explored adding a string property to `Highlight` to convey descriptive meanings, but have thus far avoided this in order to steer authors to built-in semantic types via the enum, which in the future can hopefully be expanded to encompass more use cases. These are preferable because some built-in types have direct representations on accessibility platform APIs, and won't suffer from localization issues. I want to stay open to the possibility of adding a string property in an L2 of the API if real-world usage demands it, but the group resolved [here](https://github.com/w3c/csswg-drafts/issues/6498#issuecomment-937321727) to start with just the enum for the initial version of the API.

> That makes sense, but how will colors specified as numbers become human-friendly words? With contrast requirements already restricting color choices for the highlights, background and text colors, I don't think being limited to the named colors will work well.

It should be possible for accessibility tools to turn colors specified with numbers back into human-friendly names. I confirmed that Windows Narrator does this for any random RGB values I try. Here's a small example where the colors are randomly typed RGB values: https://codepen.io/daniec/pen/xxLrqqo
If I set Narrator to [Verbosity Level 5](https://support.microsoft.com/en-us/windows/chapter-4-reading-text-8054c6cd-dccf-5070-e405-953f036e4a15#:~:text=Get%20more%20details%20about%C2%A0text) and read the sample text word-by-word I hear: "Background rosy-brown 'she', background dark-grey 'reads', background white 'the', background pale-green 'document". That seems like a pretty reasonable experience without any need for the author to specify the colors in two places that could potentially become out-of-sync.


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


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

Received on Thursday, 28 October 2021 16:21:26 UTC