From bug 178324, it should instead be retrieved from the focus manager when needed. A cached value is likely to be inaccurate.
Why don't we use nsDocument::GetActiveElement?
Note Enn comments in our code:
NS_IMETHODIMP nsDocAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
// XXXndeakin P3 accessibility shouldn't be caching the focus
In any event we should investigate when our cached node is different from what
this API gives us. For cases it should be the same we should add test coverage.
*** Bug 545436 has been marked as a duplicate of this bug. ***
(In reply to comment #1)
> Why don't we use nsDocument::GetActiveElement?
> In any event we should investigate when our cached node is different from what
> this API gives us.
Yep, it's different, for example, menuitems and etc. I don't have clever idea how we could combine gecko cached focused node with our rules.
Also we cache frame type of the focused node, it's kind of related with cached focused node.
Yeah I keep mid air colliding with you :)
Note we also store:
We probably need a hybrid of storing what we thought the last focus state was, and asking what currently the focus state is.
fixed by bug 673958