Closed Bug 567553 Opened 14 years ago Closed 9 years ago

add GetAccessibleAtCaret method

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: surkov, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file)

Attached patch patchSplinter Review
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.
we have now SelectionManager::AccessibleWithCaret() method
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: