Consider unifying creation of OS objects for LocalAccessible
Categories
(Core :: Disability Access APIs, task)
Tracking
()
People
(Reporter: Jamie, Unassigned)
References
(Blocks 1 open bug)
Details
The OS object for a RemoteAccessible is always created when the RemoteAccessible is added to the tree. This happens in a11y::ProxyCreated. In contrast, on most platforms, the OS object for a LocalAccessible is created on demand when the OS code first needs it: AccessibleWrap::GetMsaa on Windows, AccessibleWrap::GetNativeObject on Mac, AccessibleWrap::GetNativeInterface on Linux. The only OS that differs is Android, where we register with the session in the AccessibleWrap constructor.
For the most part, this difference shouldn't (and doesn't) really matter. However, I'm concerned that it could lead to obscure bugs that are difficult to diagnose. Since we have a unified tree and even event firing is now unified, it seems like a consistent point at which OS objects are created would make things easier to reason about. This would also allow us to unify the creation function and where it gets called; i.e. we would have a11y::PlatformCreated taking an Accessible
instead of a11y::ProxyCreated taking a RemoteAccessible
, just like we do for events (a11y::PlatformEvent and friends).
Reporter | ||
Comment 1•10 months ago
|
||
I looked into this a bit. As usual, it's harder than it seems.
- The most logical place to do this is DocAccessible::BindToDocument, which gets called whenever we create a new LocalAccessible.
- But! ATK needs the parent in order to determine whether to expose the HyperLink interface, but we aren't bound to the parent yet when BindToDocument happens.
- In contrast, when ProxyCreated is called for RemoteAccessible, it's already bound to its parent.
- LocalAccessible::BindToParent might be another place we could do this, but:
- That also gets called when an Accessible is moved, but we have no way of determining whether the OS object was created yet in cross-platform code. We obviously don't want to create it again if it was already created once.
- XUL tree item Accessibles don't use BindToParent. They mess with mParent themselves.
Description
•