Open Bug 1944217 Opened 1 month ago Updated 29 days ago

Fix exposure of overlapping spelling and grammar errors

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: Jamie, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

Bug 1909142 implements accessibility support for CSS custom highlights. However, it doesn't correctly handle exposure of overlapping spelling and grammar errors.

The way we expose spelling and grammar errors is based on IA2 and ATK. For a spelling error, we expose the object attribute invalid:spelling. Similarly, for a grammar error, we expose the object attribute invalid:grammar. IA2 and ATK want us to expose invalid:spelling,grammar when they overlap, but that doesn't work well for other API code such as Mac, which ideally needs to be able to check for a spelling error regardless of whether it is also a grammar error.

For now, we expose the one we most recently encountered. We need to find a way to fix this.

I've thought of two solutions:

  1. Add a new static atom for "spelling,grammar". The Mac code can then check for this as well as spelling. This is really hacky and I'm a bit reluctant to pollute the static atom table with such ugliness, even though it doesn't really cost us anything.
  2. Split spelling and grammar into separate attributes; e.g. spelling:true, grammar:true. We'd then need code to massage this to invalid:spelling/grammar/spelling,grammar for IA2 and ATK. This is a bit annoying because we'd need this code in two places, plus our tests currently depend on invalid:spelling, so we'd have to tweak all of those too (or make XPCOM expose invalid like IA2 and ATK).

I think it's unlikely that spelling and grammar errors will overlap. From what I've seen, word processors don't tend to report a grammar error in the presence of a spelling error. So, I don't think fixing this is high priority, but I thought it worth filing nevertheless.

Blocks: texta11y

Eitan, might you have an idea for a solution that sucks less than the two I've proposed?

Flags: needinfo?(eitan)
You need to log in before you can comment on or make changes to this bug.