Closed Bug 1670846 Opened 5 years ago Closed 5 years ago

Paragraph boundary doesn't stop at line breaks in textareas

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox81 --- unaffected
firefox82 --- unaffected
firefox83 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

STR (with the NVDA screen reader):

  1. Open this test case:
    data:text/html,<textarea>a%0ab
  2. Focus the textarea.
  3. Press NVDA+control+z to open the NVDA python Console.
  4. Enter the following command and press enter:
    focus.IAccessibleTextObject.textAtOffset(0, 3)
    • Expected: (0, 2, 'a\n')
    • Actual: (0, 3, 'a\nb')

It seems that textareas contain only a single text node (pruned for OS APIs via MustPrune) which contains the full text. It's also valid to add additional text nodes to textareas using the DOM. Furthermore, we have the same problem with other pre-formatted text:
data:text/html,<pre>a%0ab
data:text/html,<div style="white-space: pre;">a%0ab

So this means that in addition to walking the tree, we also need to check text nodes for rendered line breaks. 😩

Set release status flags based on info from the regressing bug 1666998

S3 and we are nearing the end of the nightly cycle, fix-optional for 83.

In pre-formatted text (including textareas), text leaf nodes can contain line break characters ("\n").
Therefore, when searching for a paragraph boundary, we must match these.
Pivot can't return an ofset, only an Accessible, so we store the offset for the last match on the rule.
Because our origin point might be within a text leaf which contains a line break before/after it, we must also pass in the offset in our origin in this case so we can begin the text search from the right place.

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Pushed by mzehe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1929ad3775f9 Treat line break characters in pre-formatted text as a11y paragraph boundaries. r=MarcoZ
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Regressions: 1673919
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: