Paragraph boundary doesn't work in Google Docs braille mode
Categories
(Core :: Disability Access APIs, defect, P2)
Tracking
()
| 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):
- Open this test case:
data:text/html,<p style="white-space: pre-wrap;">a<span> <br role="presentation"></span>b - Press control+home to move the review cursor to the paragraph.
- Press NVDA+control+z to open the NVDA Python console.
- 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.
Comment 1•5 years ago
|
||
Adding P2 priority, based on what bug 1520779 was, feel free to change.
| Assignee | ||
Comment 2•5 years ago
|
||
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.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=317265501&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/2fbd8c58de2a
| Assignee | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 8•5 years ago
|
||
Verified fixed (using Google Docs) in Firefox 83 Nightly build 20201004212809 on Windows with NVDA's "Read by paragraph" braille setting enabled.
Description
•