Commit Graph

822 Commits

Author SHA1 Message Date
James Teh
0156e587e9 Bug 1896816: Fail gracefully if a naughty client tries to QueryInterface on an MsaaAccessible from the wrong thread. r=eeejay
JAWS apparently does this sometimes.
In particular, this was causing a crash when we tried to check the UIA pref because that pref can only be accessed from the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D210417
2024-05-15 21:59:03 +00:00
James Teh
1ad35e5b84 Bug 1895428: Fix MinGW build error and warning in accessibility code. r=yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D210401
2024-05-15 09:08:07 +00:00
James Teh
b44b91602f Bug 1887790 part 5: Fire UIA LiveRegionChanged events. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D209661
2024-05-13 09:16:46 +00:00
James Teh
8758206ae8 Bug 1887790 part 4: Treat a live region root as a UIA control element. r=nlapre
Otherwise, Narrator will fail to traverse the live region when looking for its content.

Differential Revision: https://phabricator.services.mozilla.com/D209660
2024-05-13 09:16:46 +00:00
James Teh
1313145f70 Bug 1887790 part 3: Expose aria-atomic via the UIA AriaProperties property. r=nlapre
UIA doesn't have a native property to expose aria-atomic, so we need to expose this via AriaProperties.
If it's not exposed, Narrator will assume true, so we must expose it even if it's not explicitly present.

As part of this, I removed the local-only implementation of AriaProperties.
While it was more complete, it's not useful to have this supported only for LocalAccessible.
In addition, it didn't expose implicit default values, which this atomic case proves we need in some cases.
We'll add more properties as needed.

Differential Revision: https://phabricator.services.mozilla.com/D209659
2024-05-13 09:16:45 +00:00
James Teh
5d74e412f4 Bug 1887790 part 2: Implement the UIA LiveSetting property. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D209658
2024-05-13 09:16:45 +00:00
James Teh
4ca5cb765e Bug 1887789 part 3: Implement the UIA LocalizedLandmarkType property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D209101
2024-05-08 06:04:48 +00:00
James Teh
10a98f4e5f Bug 1887789 part 2: Implement the UIA LandmarkType property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D209100
2024-05-08 06:04:48 +00:00
Cristian Tuns
61fc92dc45 Backed out 3 changesets (bug 1887789) for causing wpt failures in form-roles.html CLOSED TREE
Backed out changeset 7b0ce9557ebf (bug 1887789)
Backed out changeset c39acac075fa (bug 1887789)
Backed out changeset 670a7e6fd98d (bug 1887789)
2024-05-07 03:25:18 -04:00
James Teh
aaa495613f Bug 1887789 part 3: Implement the UIA LocalizedLandmarkType property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D209101
2024-05-07 02:54:01 +00:00
James Teh
f9b6e0f0f2 Bug 1887789 part 2: Implement the UIA LandmarkType property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D209100
2024-05-07 02:54:01 +00:00
James Teh
b3e1459afa Bug 1894165: When there is no explicit ARIA role, expose the computed ARIA role via the AriaRole UIA property. r=morgan
Previously, we didn't expose AriaRole at all if there was no explicit ARIA role (as specified by the role attribute).
However, there are quite a few ARIA roles where the UIA control type and other properties don't expose sufficient semantics alone.
Exposing AriaRole in these cases allows clients to perceive these semantics if they wish.

Differential Revision: https://phabricator.services.mozilla.com/D208973
2024-05-03 11:12:08 +00:00
James Teh
d48615b61b Bug 1887800 part 2: Support the UIA LabeledBy property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D208852
2024-05-03 11:08:46 +00:00
James Teh
29645bd082 Bug 1887800 part 1: Support the UIA ControllerFor, DescribedBy, FlowsFrom and FlowsTo properties. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D208851
2024-05-03 11:08:45 +00:00
James Teh
330728d677 Bug 1887786 part 2: Implement the UIA SelectionItem pattern. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D208435
2024-04-26 01:08:57 +00:00
James Teh
eeb9689caf Bug 1887786 part 1: Implement the UIA Selection pattern. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D208434
2024-04-26 01:08:57 +00:00
James Teh
15de2d408e Bug 1887799 part 5: Implement the UIA Table pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D208278
2024-04-23 06:07:44 +00:00
James Teh
979b3a6c2c Bug 1887799 part 4: Implement the UIA TableItem pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D208277
2024-04-23 06:07:44 +00:00
James Teh
8985774454 Bug 1887799 part 3: Support returning arrays of UIA elements. r=nlapre
This will be used to implement the Table and TableItem patterns, but will also be useful for other patterns implemented in future.

Differential Revision: https://phabricator.services.mozilla.com/D208276
2024-04-23 06:07:43 +00:00
James Teh
ff9beda594 Bug 1887799 part 2: Implement the UIA GridItem pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D208275
2024-04-23 06:07:43 +00:00
James Teh
24ffdc9724 Bug 1887799 part 1: Implement the UIA Grid pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D208274
2024-04-23 06:07:42 +00:00
James Teh
56f7d50bd9 Bug 1887785: Implement UIA RangeValue pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D207950
2024-04-20 05:28:09 +00:00
James Teh
e87b5632d8 Bug 1886937: Support UIA in LazyInstantiator. r=nlapre
This allows UIA client detection and blocking to work with the native UIA implementation.

Differential Revision: https://phabricator.services.mozilla.com/D207673
2024-04-18 23:39:52 +00:00
James Teh
20f5c199f0 Bug 1887788 part 2: Implement the UIA ClassName property. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D207507
2024-04-17 03:32:17 +00:00
James Teh
61d13ab945 Bug 1887787: Implement the UIA FrameworkId property. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D207505
2024-04-16 04:58:56 +00:00
James Teh
9cd86f5e84 Bug 1887784: Implement the UIA Level, PositionInSet and SizeOfSet properties. r=nlapre
Note that even though UIA has a dedicated HeadingLevel property, Chromium doesn't implement it and the documentation says the Level property can be used for headings as well.

Differential Revision: https://phabricator.services.mozilla.com/D207399
2024-04-15 22:34:27 +00:00
James Teh
e84478d977 Bug 1887780 part 2: Implement the UIA Value pattern. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D206449
2024-04-05 00:19:23 +00:00
James Teh
2d6b956c61 Bug 1889290: Implement the UIA IsEnabled property. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D206459
2024-04-03 23:32:44 +00:00
James Teh
e274b95ebd Bug 1887782: Implement the UIA ScrollItem pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205785
2024-04-03 03:40:39 +00:00
Natalia Csoregi
5824f64258 Backed out changeset 2dd2d24044af (bug 1887782) for causing bustage on uiaRawElmProvider.cpp CLOSED TREE 2024-04-03 05:01:04 +03:00
James Teh
d23342d3a1 Bug 1887782: Implement the UIA ScrollItem pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205785
2024-04-02 21:50:48 +00:00
James Teh
a362714f8a Bug 1887777: Implement the UIA ExpandCollapse pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205676
2024-04-02 05:53:44 +00:00
James Teh
2ac0262f68 Bug 1886711: Implement the UIA Toggle pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205552
2024-03-27 00:36:29 +00:00
James Teh
ccdaa5c364 Bug 1887579: Implement the UIA FullDescription property. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205537
2024-03-26 10:53:42 +00:00
James Teh
bf353f3ed5 Bug 1886709 part 2: Implement the UIA Invoke pattern. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205432
2024-03-26 04:25:41 +00:00
James Teh
6a3e14495b Bug 1887590: static_cast when returning in uiaRawElmProvider::get_ProviderOptions. r=nlapre
Per the IDL, this method returns enum ProviderOptions.
Strictly speaking, that's not correct because this is actually a bit field combining values from the enum, rather than returning only a single value from the enum.
It seems some compilers are more strict about this and thus fail with an error like: assigning to 'enum ProviderOptions' from incompatible type 'int'
To work around this, static_cast the value before returning it.

Differential Revision: https://phabricator.services.mozilla.com/D205667
2024-03-26 03:36:57 +00:00
James Teh
ad359a1e5d Bug 1886619 part 2: Implement UIA Name property and fire event when it changes. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205295
2024-03-25 22:31:14 +00:00
James Teh
e9194b79e4 Bug 1886618 part 2: Implement UIA focus event and properties. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205284
2024-03-25 11:55:32 +00:00
James Teh
d805d7227b Bug 1886371 part 7: Implement UIA ControlType property. r=nlapre
Aside from being a fundamental part of semantics, this is needed for our tests.
These mappings are based on the Core AAM and HTML AAM specs, plus some personal judgement where Gecko roles weren't covered by these specs.
UIA control types are rather limited and they apparently expect us to expose a lot of things using LocalizedControlType, but that isn't implemented for now.
I expect these will need to be revised in future, but this is a starting point.

Differential Revision: https://phabricator.services.mozilla.com/D205185
2024-03-25 03:28:06 +00:00
James Teh
55684ad8e9 Bug 1886371 part 6: Add UIA control types to RoleMap. r=nlapre
The actual ControlType property implementation is the subject of a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D205184
2024-03-25 03:28:05 +00:00
James Teh
a93f20a1ad Bug 1886371 part 5: Implement the UIA AutomationId property. r=nlapre
We need this for our tests so they can find elements they're testing.

Differential Revision: https://phabricator.services.mozilla.com/D205183
2024-03-25 03:28:05 +00:00
James Teh
12770de85d Bug 1886371 part 4: Implement IRawElementProviderFragmentRoot. r=nlapre
This identifies the root of our implementation and allows for focus querying and hit testing.
We also implement IRawElementProviderSimple::get_HostRawElementProvider to connect to UIA's HWND provider.

Differential Revision: https://phabricator.services.mozilla.com/D205182
2024-03-25 03:28:05 +00:00
James Teh
a518e894f6 Bug 1886371 part 3: Implement IRawElementProviderFragment. r=nlapre
This is how UIA traverses the tree.

Differential Revision: https://phabricator.services.mozilla.com/D205181
2024-03-25 03:28:04 +00:00
James Teh
72ff2b7583 Bug 1886371 part 2: Refactor uiaRawElmProvider::QueryInterface. r=nlapre
Our IUnknownImpl macros avoid boilerplate, but they weren't designed to handle the quirky inheritance of our MSAA/UIA implementation.
Among other things, using these macros required us to override AddRef and Release in uiaRawElmProvider, which was a bit confusing.
Rather than perpetuating this weirdness as things get more complex, just implement what we need by hand.

Differential Revision: https://phabricator.services.mozilla.com/D205180
2024-03-25 03:28:04 +00:00
James Teh
0ea4812cf2 Bug 1886371 part 1: Hook up our native UIA tree. r=nlapre,win-reviewers,rkraesig
1. Respond to WM_GETOBJECT with our IRawElementProviderSimple implementation for the root Accessible of the HWND.
2. Don't allow QueryInterface to UIA interfaces if the UIA pref is disabled. This stops WM_GETOBJECT from returning our UIA implementation in this case.
3. Specify the appropriate provider options.

Differential Revision: https://phabricator.services.mozilla.com/D205179
2024-03-25 03:28:03 +00:00
Emilio Cobos Álvarez
6c57980b8f Bug 1883132 - Suppress a11y instantiation on Win11 for the snap layouts feature. r=Jamie
This is not ideal, because they fall back to position the popup under
the cursor, but it's probably better.

The right thing to do would be for Windows to use the TITLEBARINFOEX
message. We should probably still land that code just so they can
eventually use it, seems worth doing anyways.

Differential Revision: https://phabricator.services.mozilla.com/D203423
2024-03-06 15:13:58 +00:00
Eitan Isaacson
49fbd63cf8 Bug 1861211 - Make isAccessibilityElement conditional on a per-role basis. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D191882
2024-03-04 21:19:09 +00:00
James Teh
5ea5ad1b92 Bug 1881195: Implement IsControlElement and IsContentElement UIA properties. r=nlapre
Exactly what should be a control element on the web and what shouldn't isn't really documented anywhere.
So, this is a little based on ideas from Chromium and a little based on my own understanding of how this should ideally work.
This will definitely need to be tweaked as we further develop UIA.
For now, the primary aim is to avoid the performance cliff caused by the UIA -> IA2 proxy's suboptimal implementation of IsControlElement.
We map IsContentElement to IsControlElement, just as Chromium does.

Differential Revision: https://phabricator.services.mozilla.com/D202923
2024-03-04 11:36:15 +00:00
Gabriele Svelto
aa43fa218e Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one,
unfotunately I couldn't find a way to pull them apart:
- First of all annotations now can either recorded (that is, we copy the value
  and have the crash reporting code own the copy) or registered. Several
  annotations are changed to use this functionality so that we don't need to
  update them as their value change.
- The code in the exception handler is modified to read the annotations from
  the mozannotation_client crate. This has the unfortunate side-effect that
  we need three different bits of code to serialize them: one for annotations
  read from a child process, one for reading annotations from the main process
  outside of the exception handler and one for reading annotations from the
  main process within the exception handler. As we move to fully
  out-of-process crash reporting the last two methods will go away.
- The mozannotation_client crate now doesn't record annotation types anymore.
  I realized as I was working on this that storing types at runtime has two
  issues: the first one is that buggy code might change the type of an
  annotation (that is record it under two different types at two different
  moments), the second issue is that types might become corrupt during a
  crash, so better enforce them at annotation-writing time. The end result is
  that the mozannotation_* crates now only store byte buffers, track the
  format the data is stored in (null-terminated string, fixed size buffer,
  etc...) but not the type of data each annotation is supposed to contain.
- Which brings us to the next change: concrete types for annotations are now
  enforced when they're written out. If an annotation doesn't match the
  expected type it's skipped. Storing an annotation with the wrong type will
  also trigger an assertion in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D195248
2024-03-04 10:24:43 +00:00
James Teh
08b40ceb27 Bug 1881191 part 3: Support RemoteAccessible in uiaRawElmProvider. r=nlapre
KeyboardShortcut is only implemented for LocalAccessible because KeyboardShortcut isn't currently relevant (or supported) for RemoteAccessible.
AriaProperties can't be supported for RemoteAccessible currently.
See the code comment for details.

Differential Revision: https://phabricator.services.mozilla.com/D202551
2024-02-28 06:50:01 +00:00