Closed Bug 1493824 Opened 6 years ago Closed 6 years ago

Empty HyperTextAccessible child screws with word boundary offsets

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1149415

People

(Reporter: eeejay, Unassigned)

Details

Attachments

(1 file)

Given the following markup:

<div><div></div>Shalom Olam</div>

getTextAtOffset(0, div) will return start and end of 0. It should return 0, 6.

If the inner div is replaced with a span, or has an inline style, it works as expected. For example:

<div><div style="display: inline;"></div>Shalom Olam</div> will return 0,6.

This has to do with the child div being an empty Hypertext accessible.
Attached patch test caseSplinter Review
This also breaks line offsets. It's a duplicate of bug 1149415, though that bug mentions inline objects. In reality, it's any empty HyperTextAccessible as you describe.

(In reply to Eitan Isaacson [:eeejay] from comment #0)
> If the inner div is replaced with a span, or has an inline style, it works
> as expected.

Note that this only works because the inline thing has no accessible. If you force an accessible to be created for it (e.g. by giving it an ARIA role or using an HTML tag with semantic value), it breaks.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: