Separate Windows MSAA implementation into its own class hierarchy
Categories
(Core :: Disability Access APIs, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
Details
Crash Data
Attachments
(25 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1694865 part 11: Prepare ia2AccessibleTable/TableCell to not rely on AccessibleWrap inheritance.
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently, MSAA and IA2 are implemented by inheritance into AccessibleWrap and friends. Although other OS do use the Wrap classes to provide some platform specific functionality, Windows is the only platform to implement all of the actual OS calls in the Wrap classes. While this has worked well enough until now, it becomes problematic in our aim to unify local and remote accessibles because we need both local and remote to use the MSAA/IA2 code.
If it were just AccessibleWrap, we could probably solve this by making AccessibleWrap a subclass of Accessible (instead of LocalAccessible). We'd then have LocalAccessible and RemoteAccessible subclass AccessibleWrap. However, this becomes problematic for HyperTextAccessible, TableAccessible, etc., since they will eventually be base interfaces supported by both local and remote.
Eventually, we also won't need the MSAA stuff in the content process. While having it there doesn't really do any harm, it's pointless and confusing.
So, we are going to create a separate class hierarchy: MsaaAccessible, MsaaDocAccessible, etc. These will only inherit the COM interfaces, not Gecko classes. There will be pointers to move between the two.
Assignee | ||
Comment 1•4 years ago
|
||
This simply adds the new MsaaAccessible class, moves the inheritance of ia2Accessible, etc. to that class, and makes AccessibleWrap inherit from MsaaAccessible.
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Comment 9•4 years ago
|
||
Once MsaaAccessible is no longer inherited into AccessibleWrap, we'll null the AccessibleWrap pointer when the AccessibleWrap shuts down.
At that point, MsaaAccessible won't deal with defunct AccessibleWraps.
Prepare for this by removing defunct special cases from most callers.
Assignee | ||
Comment 10•4 years ago
|
||
Rather than static_casting this
, there is now a LocalAcc() method which in turn calls MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
For LocalAccessibles other than this
, rather than static_casting, GetNativeInterface is now used.
Finally, ia2AccessibleValue::QueryInterface was adjusted to AddRef the queried interface on this
, not the AccessibleWrap.
Assignee | ||
Comment 11•4 years ago
|
||
Rather than static_casting this
, there is now an ImageAcc/TextAcc() method which in turn calls MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
For LocalAccessibles other than this
, rather than static_casting, GetNativeInterface is now used.
ia2AccessibleText was calling AccessibleWrap::ConvertToIA2Attributes, but this is actually declared in ia2Accessible, so we just add the necessary include and change the call.
Assignee | ||
Comment 12•4 years ago
|
||
For now, we can't use MsaaAccessible::LocalAcc() because these are inherited into multiple Wrap classes, but we don't know which at runtime.
However, we can still prepare by creating a Table/CellAcc() method which can be easily replaced once we kill the Wrap inheritance.
For LocalAccessibles other than this
, rather than static_casting, GetNativeInterface is now used.
Assignee | ||
Comment 13•4 years ago
|
||
For now, ApplicationAccessibleWrap inherits from the new class.
ApplicationAccessible calls are made via an AppAcc() method which in turn calls MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
Assignee | ||
Comment 14•4 years ago
|
||
For now, DocAccessibleWrap inherits from MsaaDocAccessible and MsaaDocAccessible inherits from DocAccessible.
DocAccessible calls are made via a DocAcc() method which in turn calls MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
Assignee | ||
Comment 15•4 years ago
|
||
For now, RootAccessibleWrap inherits from MsaaRootAccessible and MsaaRootAccessible inherits from RootAccessible.
RootAccessible calls are made via a RootAcc() method which in turn calls MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
Assignee | ||
Comment 16•4 years ago
|
||
For now, XULMenuitemAccessibleWrap inherits from MsaaXULMenuitemAccessible and MsaaXULMenuitemAccessible inherits from XULMenuitemAccessible.
Accessible calls are made via MsaaAccessible::LocalAcc().
Since MsaaAccessible::LocalAcc() returns null if defunct, defunct checks have been adjusted accordingly.
Assignee | ||
Comment 17•4 years ago
|
||
This is necessary to enable COM objects which aggregate AccessibleWrap/DocAccessibleWrap to aggregate MsaaAccessible/MsaaDocAccessible instead.
Ultimately, the IUnknown implementation will be moved out of AccessibleWrap altogether and into MsaaAccessible, but we can't do that yet.
Even though MsaaDocAccessible indirectly inherits from MsaaAccessible, we have to override QueryInterface due to the naming conflict with nsISupports.
Assignee | ||
Comment 18•4 years ago
|
||
These objects need to aggregate the primary COM object (MsaaAccessible).
Once the IUnknown implementation moves out of AccessibleWrap, it won't be possible to aggregate *AccessibleWrap any more.
Assignee | ||
Comment 19•4 years ago
|
||
It now aggregates MsaaAccessible and uses GetNativeInterface when returning accessibles to clients.
Assignee | ||
Comment 20•4 years ago
|
||
Assignee | ||
Comment 21•4 years ago
|
||
In this patch, these new functions just static_cast, but they'll soon be returning a different object.
Assignee | ||
Comment 22•4 years ago
|
||
Assignee | ||
Comment 23•4 years ago
|
||
Until now, our a11y COM implementation has relied on AddRef and Release from nsISupports, but this soon won't be possible.
Instead, MsaaAccessible will implement its own reference counting using DECL_IUNKNOWN.
DECL_IUNKNOWN previously declared AddRef and Release as final.
This doesn't work for MsaaAccessible because there is an aggregatable subclass (MsaaRootAccessible) and because some subclasses will inherit additional interfaces (ia2AccessibleApplication, etc.).
When subclasses inherit additional interfaces, they inherit an additional IUnknown, so the compiler doesn't know which AddRef/Release to call.
To support this, IMPL_IUNKNOWN_REFCOUNTING_INHERITED HAS BEEN ADDED to specify which base class implements reference counting.
Assignee | ||
Comment 24•4 years ago
|
||
It now uses GetNativeInterface when returning IAccessibles to clients.
Assignee | ||
Comment 25•4 years ago
|
||
- ia2AccessibleApplication is instantiated for ApplicationAccessible, so it now inherits from MsaaAccessible.
- ia2AccessibleHypertext is instantiated for HyperTextAccessible, so it now inherits from MsaaAccessible.
- ia2AccessibleImage is instantiated for ImageAccessible, so it inherits from MsaaAccessible.
- ia2AccessibleTable is instantiated for TableAccessible, so it inherits from ia2AccessibleHypertext (since most TableAccessible implementations implement HyperTextAccessible).
- ia2AccessibleTableCell is instantiated for TableCellAccessible, so it inherits from ia2AccessibleHypertext (since most TableCellAccessible implementations implement HyperTextAccessible).
- All of the above override QueryInterface as appropriate, replacing the QueryInterface implementations from all *AccessibleWrap classes.
- The ARIAGridAccessibleWrap, HTMLTableAccessibleWrap, ImageAccessibleWrap, XULListboxAccessibleWrap and XULTreeGridAccessibleWrap classes previously served only to host ia2AccessibleImage, ia2AccessibleTable, etc. Since these ia2 classes are now instantiated via MsaaAccessible, these Wrap classes have been removed and replaced with aliases.
- The QueryInterface handling for ISimpleDOMText has been moved into MsaaAccessible. Since this was the only purpose of TextLeafAccessibleWrap, this too has been removed and replaced with an alias.
- AccessibleWrap now holds a strong reference to MsaaAccessible and MsaaAccessible holds a weak reference to AccessibleWrap.
- An MsaaAccessible (or derived class) is instantiated by MsaaAccessible::Create.
- MsaaAccessible now implements its own COM reference counting using DECL_IUNKNOWN, since it does not need nsISupports (XPCOM).
Assignee | ||
Comment 26•4 years ago
•
|
||
Assignee | ||
Updated•4 years ago
|
Comment 27•4 years ago
|
||
Comment 28•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9d27bb4a4ab4
https://hg.mozilla.org/mozilla-central/rev/f283f3cf03cf
https://hg.mozilla.org/mozilla-central/rev/ba238a1e12df
https://hg.mozilla.org/mozilla-central/rev/5dcd83a1c82c
https://hg.mozilla.org/mozilla-central/rev/86c1ddcc8e31
https://hg.mozilla.org/mozilla-central/rev/7c345ab7e3be
Comment 29•4 years ago
|
||
Comment 30•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7dfb88fc34a1
https://hg.mozilla.org/mozilla-central/rev/40c7e0bcfcfd
https://hg.mozilla.org/mozilla-central/rev/acafc5835608
https://hg.mozilla.org/mozilla-central/rev/461b46e1a2cb
https://hg.mozilla.org/mozilla-central/rev/309f737d3bc3
https://hg.mozilla.org/mozilla-central/rev/53ed762843ec
Comment 31•4 years ago
|
||
![]() |
||
Comment 32•4 years ago
|
||
Backed out changes 7-12 for accessibility crashes (part 13-18 will be backed in a few minutes together with the merge of the backout of 7-12 to central):
https://hg.mozilla.org/mozilla-central/rev/d9e30da70def144c22f40e7debc5b190a31eb1f1
Crashes:
https://crash-stats.mozilla.org/signature/?build_id=%3E20210429000000&product=Firefox&version=90.0a1&date=%3E%3D2021-04-26T00%3A00%3A00.000Z&date=%3C2021-04-29T23%3A59%3A00.000Z&_sort=-date&signature=mozilla%3A%3Aa11y%3A%3AMsaaAccessible%3A%3Aget_accValue
https://crash-stats.mozilla.org/signature/?build_id=%3E20210429000000&product=Firefox&version=90.0a1&signature=mozilla%3A%3Aa11y%3A%3AMsaaAccessible%3A%3Aget_accDescription&date=%3E%3D2021-04-26T00%3A00%3A00.000Z&date=%3C2021-04-29T23%3A59%3A00.000Z&_columns=date&_columns=product&_columns=version&_columns=build_id&_columns=platform&_columns=reason&_columns=address&_columns=install_time&_columns=startup_crash&_sort=-date&page=1#summary
Comment 33•4 years ago
|
||
Backed out changes 13-18 for causing merge conflict.
https://hg.mozilla.org/integration/autoland/rev/2a4d3f13161de6a01d6c29b7c92658d74748ff67
![]() |
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 34•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 35•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/de1f048e7f59
https://hg.mozilla.org/mozilla-central/rev/d88639c490d2
https://hg.mozilla.org/mozilla-central/rev/16e294b866a6
https://hg.mozilla.org/mozilla-central/rev/d215650648ea
https://hg.mozilla.org/mozilla-central/rev/eaee7f4386eb
https://hg.mozilla.org/mozilla-central/rev/5a74388d847a
Comment 36•4 years ago
|
||
Comment 37•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eb4b8e688202
https://hg.mozilla.org/mozilla-central/rev/f967d16a75ae
https://hg.mozilla.org/mozilla-central/rev/bec6aca2ad6a
https://hg.mozilla.org/mozilla-central/rev/262aaf0142f7
https://hg.mozilla.org/mozilla-central/rev/ae2dd5aeb7bf
https://hg.mozilla.org/mozilla-central/rev/0d57c4867cea
Comment 38•4 years ago
|
||
Comment 39•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a53fb045a8e3
https://hg.mozilla.org/mozilla-central/rev/63f10db368c8
https://hg.mozilla.org/mozilla-central/rev/81587e0240ca
https://hg.mozilla.org/mozilla-central/rev/40805a1f2c1e
https://hg.mozilla.org/mozilla-central/rev/893c83f82c16
https://hg.mozilla.org/mozilla-central/rev/f478ad97306a
Assignee | ||
Updated•4 years ago
|
Comment 40•4 years ago
|
||
Comment 41•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•