Граф коммитов

9081 Коммитов

Автор SHA1 Сообщение Дата
Morgan Reschenberg 36e9e6e30a Bug 1694569: Introduce tree size logging under A11YLOG r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D114168
2021-05-05 20:56:06 +00:00
Iulian Moraru 1e02685f75 Backed out 2 changesets (bug 1706910) for accessibility crashes. CLOSED TREE
Backed out changeset e0769fe4d6fd (bug 1706910)
Backed out changeset 67c05979577e (bug 1706910)
2021-05-05 18:50:58 +03:00
James Teh 1c2bc0ce07 Bug 1709250: Null check LocalAcc() in GeckoCustom. r=morgan
We didn't do defunct checks previously, but it seems the methods we were calling were safe on defunct accessibles.
Now that retrieving the accessible returns null once it's shut down, we need to explicitly null check it.

Differential Revision: https://phabricator.services.mozilla.com/D114197
2021-05-04 21:59:03 +00:00
Eitan Isaacson 6f52e37071 Bug 1513447 - Use generated marker elements for list bullet accessibles. r=Jamie
In 1513447 there is a demonstrated instance in which the generated
marker is replaced with another one and throws the list item bullet
state into an unknown state. To remedy this we need to observe when such
elements are removed and added.

Instead of that, I opted to finally make the bullet accessible a real
content-backed accessible. This should help with other issues that pop
up when the list item overrides children management and keeps an
artificial accessible as its first child.

Differential Revision: https://phabricator.services.mozilla.com/D110719
2021-05-04 19:07:59 +00:00
James Teh c2a4380cef Bug 1706851: Remove Windows HyperTextProxyFor() function. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D113063
2021-05-03 23:32:24 +00:00
Morgan Reschenberg a0703b0672 Bug 1706910: Introduce testing for AXFrame, accessibilityFrame r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D113185
2021-05-03 23:21:32 +00:00
Morgan Reschenberg ab5a074a02 Bug 1706910: Implement AXFrame, accessibilityFrame for VoiceOver r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D113585
2021-05-03 23:21:31 +00:00
James Teh c33d1b0837 Bug 1694865 part 25: Remove inheritance of Msaa*Accessible/ia2*Accessible into *AccessibleWrap! r=morgan
1. ia2AccessibleApplication is instantiated for ApplicationAccessible, so it now inherits from MsaaAccessible.
2. ia2AccessibleHypertext is instantiated for HyperTextAccessible, so it now inherits from MsaaAccessible.
3. ia2AccessibleImage is instantiated for ImageAccessible, so it inherits from MsaaAccessible.
4. ia2AccessibleTable is instantiated for TableAccessible, so it inherits from ia2AccessibleHypertext (since most TableAccessible implementations implement HyperTextAccessible).
5. ia2AccessibleTableCell is instantiated for TableCellAccessible, so it inherits from ia2AccessibleHypertext (since most TableCellAccessible implementations implement HyperTextAccessible).
6. All of the above override QueryInterface as appropriate, replacing the QueryInterface implementations from all *AccessibleWrap classes.
7. 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.
8. 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.
9. AccessibleWrap now holds a strong reference to MsaaAccessible and MsaaAccessible holds a weak reference to AccessibleWrap.
10. An MsaaAccessible (or derived class) is instantiated by MsaaAccessible::Create.
11. MsaaAccessible now implements its own COM reference counting using DECL_IUNKNOWN, since it does not need nsISupports (XPCOM).

Differential Revision: https://phabricator.services.mozilla.com/D112956
2021-05-03 11:31:04 +00:00
James Teh 1d4975717e Bug 1694865 part 24: Change uiaRawElmProvider to not rely on AccessibleWrap inheritance. r=morgan
It now uses GetNativeInterface when returning IAccessibles to clients.

Differential Revision: https://phabricator.services.mozilla.com/D112955
2021-05-01 22:29:27 +00:00
James Teh 4c07d821c8 Bug 1694865 part 23: Support inheritance/overriding of reference counting in IUnknownImpl. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112954
2021-05-01 22:29:27 +00:00
James Teh 812dc1cf7c Bug 1694865 part 22: Change LazyInstantiator to aggregate MsaaRootAccessible instead of RootAccessibleWrap. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112953
2021-05-01 22:29:26 +00:00
James Teh 0613e5347a Bug 1694865 part 21: Move QueryInterface implementation from AccessibleWrap to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112951
2021-05-01 22:29:26 +00:00
James Teh b7d47b6dde Bug 1694865 part 20: Change ServiceProvider to not rely on AccessibleWrap inheritance. r=morgan
It now aggregates MsaaAccessible and uses GetNativeInterface when returning accessibles to clients.

Differential Revision: https://phabricator.services.mozilla.com/D112950
2021-05-01 22:29:25 +00:00
James Teh 463cee1200 Bug 1694865 part 19: Make EnumVariant, GeckoCustom and sdn*Accessible classes aggregate MsaaAccessible/MsaaDocAccessible instead of AccessibleWrap/DocAccessibleWrap. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112949
2021-05-01 22:29:25 +00:00
James Teh 7afd94a329 Bug 1694865 part 18: Prepare ia2AccessibleEditableText/Hypertext/Image/Text to not rely on AccessibleWrap inheritance. r=morgan
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 direct static_casting, MsaaAccessible::GetFrom is used.
ia2AccessibleText was calling AccessibleWrap::ConvertToIA2Attributes, but this is actually declared in ia2Accessible, so we just add the necessary include and change the call.
Finally, calls to HyperTextProxyFor() in ia2AccessibleEditableText/Hypertext/Text assertions were replaced with calls to LocalAccessible::IsProxy(), since HyperTextProxyFor statically asserts the inheritance we're removing and isn't otherwise useful.

Differential Revision: https://phabricator.services.mozilla.com/D112942
2021-05-01 02:51:24 +00:00
James Teh 98c0f0589f Bug 1694865 part 17: Add various functions to get an MsaaAccessible/MsaaDocAccessible and use them where appropriate. r=morgan
In this patch, these new functions just static_cast, but they'll soon be returning a different object.

Differential Revision: https://phabricator.services.mozilla.com/D112952
2021-05-01 02:51:23 +00:00
James Teh 19e006d017 Bug 1694865 part 16: Transitional implementation of IUnknown in MsaaAccessible/MsaaDocAccessible which delegates to AccessibleWrap. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112948
2021-05-01 02:51:23 +00:00
James Teh efaf13c0ed Bug 1694865 part 15: Move XULMenuitemAccessibleWrap's MSAA overrides to a new MsaaXULMenuitemAccessible class. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112947
2021-05-01 02:51:23 +00:00
James Teh eebe3a1f74 Bug 1694865 part 14: Move RootAccessibleWrap's MSAA overrides and other COM stuff to a new MsaaRootAccessible class. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112946
2021-05-01 02:51:22 +00:00
James Teh 29737325ac Bug 1694865 part 13: Move DocAccessibleWrap's MSAA overrides to a new MsaaDocAccessible class. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112945
2021-05-01 02:51:22 +00:00
James Teh fcf129c168 Bug 1694865 part 12: Move COM IAccessibleApplication implementation to new ia2AccessibleApplication class. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112944
2021-04-30 12:21:42 +00:00
James Teh dcfe338fb3 Bug 1694865 part 11: Prepare ia2AccessibleTable/TableCell to not rely on AccessibleWrap inheritance. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112943
2021-04-30 12:21:41 +00:00
James Teh 7a9c1af3d9 Bug 1694865 part 10: Prepare ia2Accessible/Action/Component/Hyperlink/Relation/Value to not rely on AccessibleWrap inheritance. r=morgan
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.
ia2AccessibleValue::QueryInterface was adjusted to AddRef the queried interface on `this`, not the AccessibleWrap.
Finally, calls to HyperTextProxyFor() in ia2AccessibleHyperlink assertions were replaced with calls to LocalAccessible::IsProxy(), since HyperTextProxyFor statically asserts the inheritance we're removing and isn't otherwise useful.

Differential Revision: https://phabricator.services.mozilla.com/D112941
2021-04-30 12:21:41 +00:00
James Teh d48596e5de Bug 1694865 part 9: Make MsaaAccessible::LocalAcc return null if defunct. r=morgan
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.

To allow for this, the assertion in IsDefunct() had to be changed to allow null mContent when IsProxy() is true.
Otherwise, calling IsDefunct() on a live RemoteAccessibleWrap asserts.
It seems we previously never called IsDefunct() in this case, but this patch now does due to the call to LocalAcc() in GetIAccessibleFor().

Differential Revision: https://phabricator.services.mozilla.com/D112940
2021-04-30 12:21:41 +00:00
James Teh b02ab50193 Bug 1694865 part 8: Remove some dead code from AccessibleWrap. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112939
2021-04-30 12:21:40 +00:00
James Teh 5b13a306ae Bug 1694865 part 7: Move all IAccessible and IDispatch methods to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112938
2021-04-30 12:21:40 +00:00
Sebastian Hengst 0581f97eef Backed out 6 changesets (bug 1694865) for Windows accessibility crashes. a=backout
Backed out changeset 53ed762843ec (bug 1694865)
Backed out changeset 309f737d3bc3 (bug 1694865)
Backed out changeset 461b46e1a2cb (bug 1694865)
Backed out changeset acafc5835608 (bug 1694865)
Backed out changeset 40c7e0bcfcfd (bug 1694865)
Backed out changeset 7dfb88fc34a1 (bug 1694865)
2021-04-29 14:29:25 +02:00
James Teh f66f7a0724 Bug 1694865 part 12: Prepare ia2AccessibleTable/TableCell to not rely on AccessibleWrap inheritance. r=morgan
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.

Differential Revision: https://phabricator.services.mozilla.com/D112943
2021-04-28 10:49:52 +00:00
James Teh 7c59537465 Bug 1694865 part 11: Prepare ia2AccessibleEditableText/Hypertext/Image/Text to not rely on AccessibleWrap inheritance. r=morgan
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.
Finally, calls to HyperTextProxyFor() in ia2AccessibleEditableText/Hypertext/Text assertions were replaced with calls to LocalAccessible::IsProxy(), since HyperTextProxyFor statically asserts the inheritance we're removing and isn't otherwise useful.

Differential Revision: https://phabricator.services.mozilla.com/D112942
2021-04-28 10:49:51 +00:00
James Teh 6fffe0fca4 Bug 1694865 part 10: Prepare ia2Accessible/Action/Component/Hyperlink/Relation/Value to not rely on AccessibleWrap inheritance. r=morgan
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.
ia2AccessibleValue::QueryInterface was adjusted to AddRef the queried interface on `this`, not the AccessibleWrap.
Finally, calls to HyperTextProxyFor() in ia2AccessibleHyperlink assertions were replaced with calls to LocalAccessible::IsProxy(), since HyperTextProxyFor statically asserts the inheritance we're removing and isn't otherwise useful.

Differential Revision: https://phabricator.services.mozilla.com/D112941
2021-04-28 10:49:51 +00:00
James Teh d458d62b7e Bug 1694865 part 9: Make MsaaAccessible::LocalAcc return null if defunct. r=morgan
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.

To allow for this, the assertion in IsDefunct() had to be changed to allow null mContent when IsProxy() is true.
Otherwise, calling IsDefunct() on a live RemoteAccessibleWrap asserts.
It seems we previously never called IsDefunct() in this case, but this patch now does due to the call to LocalAcc() in GetIAccessibleFor().

Differential Revision: https://phabricator.services.mozilla.com/D112940
2021-04-28 10:49:50 +00:00
James Teh 4667179d00 Bug 1694865 part 8: Remove some dead code from AccessibleWrap. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112939
2021-04-28 10:49:50 +00:00
James Teh 13a18247fe Bug 1694865 part 7: Move all IAccessible and IDispatch methods to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112938
2021-04-28 10:49:49 +00:00
James Teh 3cb7e65d55 Bug 1694865 part 6: Move event firing code to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112937
2021-04-28 06:21:45 +00:00
James Teh 7aa8ea0a24 Bug 1694865 part 5: Move shutdown code into MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112936
2021-04-28 06:21:45 +00:00
James Teh 6e9e04fb17 Bug 1694865 part 4: Move foundational helper functions for retrieving descendant accessibles to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112935
2021-04-28 06:21:45 +00:00
James Teh 431c171587 Bug 1694865 part 3: Move id management to MsaaAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112934
2021-04-28 06:21:44 +00:00
James Teh 539707ee5f Bug 1694865 part 2: Add missing includes and forward declarations to fix build errors when unified build order is changed in subsequent patches. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112933
2021-04-28 06:21:44 +00:00
James Teh 65d43aeccf Bug 1694865 part 1: Create new skeleton MsaaAccessible class. r=morgan
This simply adds the new MsaaAccessible class, moves the inheritance of ia2Accessible, etc. to that class, and makes AccessibleWrap inherit from MsaaAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D112932
2021-04-28 06:21:43 +00:00
Markus Stange 1fd143238a Bug 1706750 - Scroll img into view manually if the context menu test is skipped. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D113019
2021-04-21 23:33:43 +00:00
Markus Stange a8034af02e Bug 1706389 - Disable the parts of accessible/tests/mochitest/events/test_focus_general.html that interact with context menus, if native context menus are used. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D112778
2021-04-20 21:22:48 +00:00
Mike Hommey 693d7516ba Bug 1377445 - Use dlsym for atk_bridge_adaptor_init. r=eeejay
Currently, we use a weak symbol to call atk_bridge_adaptor_init, but for
some reason, this stops working when removing the mozgtk stub library
(which we can do now that we don't need gtk+2 support at all), in a way
similar to bug 1368363.

We've been using a weak symbol because atk-bridge 2.0 was not guaranteed
to be enabled in gtk+3 back when this was added, but things have changed
since then, and gtk+3 always requires atk-bridge 2.0... ... on X11.
Unfortunately, that's not the case on Wayland, and a gtk+3 built with
Wayland support only will not depend on atk-bridge 2.0. So all in all,
we're back to square one, and because this fails to build, we need
another approach.

It turns out that other approach was in place for gtk+2, in the form of
dlopen/dlsym, the code for which somehow survived the years despite
Firefox not actually using gtk+2 for accessibility.

So we repurpose that code to load atk-bridge 2.0, which also happens to
not be a gtk+3 module, so we can remove the whole code path that tries to
load it from the gtk-3.0/modules path.

Differential Revision: https://phabricator.services.mozilla.com/D111996
2021-04-20 01:57:02 +00:00
Markus Stange fa3a5ecacc Bug 1705240 - Disable accessible/tests/mochitest/events/test_contextmenu.html when native context menus are used. r=Jamie
This test checks accessibility properties of a non-native context menu and sends
synthetic keyboard events to it.
With native context menus, accessibility and keyboard interaction are handled
natively and cannot be tested, so this test can be disabled in that configuration.

Differential Revision: https://phabricator.services.mozilla.com/D112107
2021-04-16 22:42:45 +00:00
Mark Striemer 9286d21658 Bug 1704868 - fix tests for lazy notificationbox creation r=florian
Depends on D111891

Differential Revision: https://phabricator.services.mozilla.com/D112359
2021-04-16 22:32:30 +00:00
Markus Stange d025eeaf2f Bug 1705253 - Partially disable accessible/tests/browser/mac/browser_app.js when native context menus are used. r=morgan
This test has a part where it expects AXMenuOpened events for context menus, which are not observable for us when native context menus are used.

It also has a part where it inspects the accessibility-exposed contents of a context menu. This is not testable with native context menus either, so that part of the test needs to be disabled.

Differential Revision: https://phabricator.services.mozilla.com/D112122
2021-04-15 19:58:16 +00:00
Morgan Reschenberg f2a97e6e11 Bug 1538991: Verify parent exists before calling ReorderEventTarget r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D112205
2021-04-15 17:30:43 +00:00
Markus Stange 96eefed115 Bug 1705245 - When native context menus are used, do not use keyboard events to interact with the URL bar context menu in accessible/tests/browser/events/browser_test_focus_urlbar.js. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D112112
2021-04-14 23:42:52 +00:00
James Teh 2a8e178211 Bug 1703600 part 5: Create mMathMLMarkupMap and use it for MathML elements. r=eeejay
Now, MathML elements (as well as XUL and SVG elements) will never use the HTML markup map.

Differential Revision: https://phabricator.services.mozilla.com/D111365
2021-04-14 04:11:18 +00:00
James Teh 244a85a2e3 Bug 1703600 part 4: Move MathML elements into MathMLMarkupMap.h. r=eeejay
For now, these are still inserted into mHTMlMarkupMap, but this will change soon.

Differential Revision: https://phabricator.services.mozilla.com/D111364
2021-04-14 04:11:18 +00:00
James Teh f6185ae351 Bug 1703600 part 3: Rename MarkupMap.h to HTMLMarkupMap.h. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D111363
2021-04-14 04:11:17 +00:00