add GetAccessibleAtCaret method

RESOLVED WORKSFORME

Status

()

Core
Disability Access APIs
RESOLVED WORKSFORME
7 years ago
2 years ago

People

(Reporter: surkov, Unassigned)

Tracking

(Blocks: 2 bugs, {access})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 446883 [details] [diff] [review]
patch

Hyper text accessible methods take magic number -2 to start working relative caret offset, for example, get text at offset method. It makes us traverse the children twice: first time to calculate caret offset and the second time to find an accessible at offset.

Also current implementation of GetCaretOffset isn't very perfromant.
1) it doesn't ensure the focused node is in the document of hypertext accessible
2) it makes some unnecessary computations
2.1) IsAncestorOf() while hypertext accessible is focused
2.2) It gets selection and transforms it into hypertext offset while focus in in subtree of hypertext accessible which means embedded character is focused and all we need is to its offset 
3) it traverses DOM tree, however a11y tree would be more performance since it's shorter.

I'm putting wip patch. I'll get back to it when we'll make sure we expose correct accessible tree, otherwise it bothers me if we can trust a11y tree during traversal.
Blocks: 573719
(Reporter)

Comment 1

2 years ago
we have now SelectionManager::AccessibleWithCaret() method
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.