Closed Bug 1787101 Opened 2 years ago Closed 2 years ago

[CTW] OffsetAtPoint doesn't transform to HyperText offsets

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

(Whiteboard: [ctw-m3])

Attachments

(1 file)

STR:

  1. Open this test case:
    data:text/html,<p>a<span>b</span></p>
  2. Get the coordinates for the "b" character.
  3. Call OffsetAtPoint on the paragraph with the coordinates from 2).
    • Expected: It should return 1.
    • Actual: It returns 0.

The reason for this is simple: we return a TextLeafPoint offset without transforming it to a HyperText offset. I totally should have caught that during review, but I clearly didn't. We need to call TransformOffset on that offset before returning it.

The fix is easy. Testing it is going to be more annoying because of the usual pain that comes with dealing with coordinates.

Otherwise, the returned offset is incorrect if the point is in a child other than the first.

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0be134b13d29
HyperTextAccessibleBase::OffsetAtPoint: Transform the offset before returning it. r=morgan
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: