Cache initial focus, caret and text selection
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
People
(Reporter: Jamie, Unassigned)
References
(Blocks 1 open bug)
Details
The cache gets updated for focus, caret and text selection using a11y events. However, this doesn't necessarily handle the initial state if the a11y engine starts after one of these has already happened.
It's unclear to me how initial focus is handled even without the cache. While the focus is fetched on demand for the most part, I don't think this is true for mActiveItem. So, for example, what happens if a list box with an active item is focused when the a11y engine starts?
There are a couple ways to handle this:
- Fire relevant events on the LocalAccessibles when the engine starts. This will change the behaviour for clients, but I don't think this will be a bad thing.
- Send the initial state via the IPDL methods, adding an argument to suppress firing the event.
One gotcha with text selection is that calling SelectionRanges on the DocAccessible doesn't work correctly when the selection is within an HTML input or textarea. This works fine for contentEditables. Apparently, this is a known Gecko quirk. We can probably work around this by checking if such a control has focus and fetching the selection from that if so.
Description
•