Closed Bug 1670541 Opened 4 years ago Closed 4 years ago

Line break inside embedded object breaks line offsets in parent

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: Jamie, Assigned: MarcoZ)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR (with the NVDA screen reader):

  1. Open this test case:
    data:text/html,<button>before</button><div contenteditable>a <a href="https://mozilla.org/">b<br>c</a> d
  2. Tab to the contenteditable.
  3. Press control+home.
    • Observe: NVDA says "a"
  4. press down arrow.
    • Expected: NVDA should say "link c d"
    • Actual: NVDA says "blank"

This happens because if you query the line at offset 2 (the embedded object) on the div, Gecko reports (0, 2, "a "). It should report (0, 5, "a * d"), where * is an embedded object character.

Note that this also happens with word wrap; i.e. it doesn't have to be a forced line break (which is probably less common inside a link). Example:
data:text/html,<button>before</button><div contenteditable style="width: 20px; word-wrap: break-word;">a <a href="https://mozilla.org/">b c</a> d

If the offset for an embedded character is queried, and it is an inline element, such as a link, and it contains a line break, return the full parent line.

Assignee: nobody → mzehe
Status: NEW → ASSIGNED
Attachment #9182430 - Attachment description: Bug 1670541 - Return the full line of an element if an inline embedded character offset contains a line break, r?jamie! → Bug 1670541 - Return the parent line of an embedded character offset if that contains a line break, r?jamie!
Attachment #9182430 - Attachment description: Bug 1670541 - Return the parent line of an embedded character offset if that contains a line break, r?jamie! → Bug 1670541 - Return the parent line end offset if an embedded character contains a line break, r?jamie!
Pushed by mzehe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5893300d26cb
Return the parent line end offset if an embedded character  contains a line break, r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: