Closed Bug 1666998 Opened 5 years ago Closed 5 years ago

Paragraph boundary doesn't work in Google Docs braille mode

Categories

(Core :: Disability Access APIs, defect, P2)

defect

Tracking

()

VERIFIED FIXED
83 Branch
Tracking Status
firefox83 --- verified

People

(Reporter: Jamie, Assigned: MarcoZ)

References

Details

Attachments

(1 file)

Bug 1520779 added support for the paragraph boundary. This works well in normal textareas and contentEditables. Unfortunately, it doesn't work in Google Docs braille mode. Instead, retrieving the paragraph returns only a line.

While there are no line break characters in the text, inspecting the DOM reveals that Docs is using <br role="presentation"> to force a line break without exposing it to a11y. I guess they do this because their contentEditable is faked for a11y and it's very difficult to ensure that lines correspond exactly to what is visually rendered. (I'm pretty sure I saw bugs in the past where lines were out of sync, so that's probably why this change was made.)

STR (with NVDA):

  1. Open this test case:
    data:text/html,<p style="white-space: pre-wrap;">a<span> <br role="presentation"></span>b
  2. Press control+home to move the review cursor to the paragraph.
  3. Press NVDA+control+z to open the NVDA Python console.
  4. Enter this command and press enter:
    nav.IAccessibleTextObject.textAtOffset(0, 3)
    • Expected: (0, 3, 'a b')
    • Actual: (0, 2, 'a ')

The reason this happens is that layout stops on the <br> as it should, since it still exists in the DOM even though it's pruned for a11y.

This works as expected in Chrome. That suggests they don't use layout for paragraph boundaries. This is not unreasonable, since paragraphs don't really depend on visual information other than block vs inline.

I think we could do something similar. Rather than using FindOffset, we would walk the a11y tree back and forth, stopping at line break accessibles or display: block/inline-block, ensuring we don't walk out of the Accessible on which we were called. We would then call Transformoffset directly to convert any descendant offsets into offsets relative to the calling Accessible.

We might be able to make use of the Pivot class with our own custom match rule to walk the tree back and forth, since Pivot already knows how to walk the tree restricted to a specified root.

Adding P2 priority, based on what bug 1520779 was, feel free to change.

Severity: -- → S3
Priority: -- → P2

This uses the Pivot class to search backwards and forwards from the current offsets until either end is reached, or an accessible that is either a line break or has a block frame, is found, and therefore constitutes a boundary of interest.

Assignee: nobody → mzehe
Status: NEW → ASSIGNED
Pushed by mzehe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1b8515b4548c Implement layout-independent paragraph offset search, r=Jamie
Backout by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2fbd8c58de2a Backed out changeset 1b8515b4548c for bustages on HyperTextAccessible.cpp. CLOSED TREE
Flags: needinfo?(mzehe)
Pushed by mzehe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a72b40ba26a Implement layout-independent paragraph offset search, r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Verified fixed (using Google Docs) in Firefox 83 Nightly build 20201004212809 on Windows with NVDA's "Read by paragraph" braille setting enabled.

Status: RESOLVED → VERIFIED
Regressions: 1670846

Based on comment 8, I will set firefox83 flag as verified.

Regressions: 1672593
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: