Open Bug 1849305 Opened 2 years ago Updated 5 months ago

Soft hyphens are included by a11y but not rendered by layout

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: Jamie, Unassigned)

References

(Blocks 1 open bug)

Details

Discovered while working on bug 1849007.

STR (with a screen reader):

  1. Open this test case:
    data:text/html,<p contenteditable>a&shy;b</p>
  2. Move to the end of the text box.
  3. Press backspace.
    • Expected: The screen reader should tell you that you've erased "b".
    • Actual: The screen reader tells you that you've erased the soft hyphen.

Accessibility text exposure is supposed to present what is rendered. TextLeafAccessibles include the soft hyphen character, but this isn't actually rendered by layout as far as I can tell. It is certainly skipped by editor. The major problem isn't so much the inclusion of the character, but rather, the fact that our offsets get out of sync when editing. The caret offset reports that we're positioned on the soft hyphen when we're in fact one past it and so on.

I think this might be because even though layout skips a soft hyphen while dealing with white space as it builds text runs, it still outputs them in the text returned by GetRenderedText. I think we might need to add a flag to GetRenderedText to discard these.

Interestingly, Chromium also renders soft hyphens to accessibility, but its editor doesn't skip them.

See Also: → 1756081
You need to log in before you can comment on or make changes to this bug.