Commit Graph

11037 Commits

Author SHA1 Message Date
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
db2987a0a1 Bug 1886618 part 1: Teach the test harness how to listen for UIA events. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D205283
2024-03-25 11:55:31 +00:00
James Teh
47a0a01e1f Bug 1886371 part 8: Tweak the test harness so that it uses native UIA when it is enabled. r=nlapre
See the code comments for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D205186
2024-03-25 03:28:06 +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
Eitan Isaacson
6b7a14d337 Bug 1876150 - Filter out collapsed XUL menus when concatinating text ranges. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D205391
2024-03-22 21:30:32 +00:00
James Teh
0bee4b625e Bug 1305428: Don't set ARIA DOM attributes due to accessibility API calls. r=eeejay
Per the spec, with respect to ARIA, "accessibility APIs operate in one direction only. User agents publish WAI-ARIA information (roles, states, and properties) via an accessibility API, and an AT can acquire that information using the same API. However, the other direction is not supported."
Although Firefox has not complied with this part of the spec for many years, this can cause problems for some ARIA widgets which aren't expecting ARIA attributes to be changed by the browser (nor should they, per the spec).
This might change one day, but for now, we should align with the spec.

Differential Revision: https://phabricator.services.mozilla.com/D204559
2024-03-22 10:39:55 +00:00
Dave Townsend
71420d91a6 Bug 1864896: Enable unused argument lint rule. r=Standard8,perftest-reviewers,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,nchevobbe,robwu,sparky,issammani,sgalich,owlish,migration-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D195632
2024-03-21 08:50:00 +00:00
Dave Townsend
24896877ad Bug 1864896: Fix unused arguments for accessibility. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D205192
2024-03-21 08:35:36 +00:00
Morgan Rae Reschenberg
fcda9357b6 Bug 1884733: Add support for HTML placeholder, aria-placeholder via AXPlaceholderValue r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D204438
2024-03-20 22:46:18 +00:00
Gijs Kruitbosch
999878b497 Bug 1705440 - remove old modal prompt implementation, r=mconley,webdriver-reviewers,extension-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,whimboo,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204759
2024-03-20 17:47:47 +00:00
Butkovits Atila
8fd100bae7 Backed out 2 changesets (bug 1883557, bug 1705440) for causing failures at browser_ext_sidebarAction_contextMenu.js. CLOSED TREE
Backed out changeset 89f62e190e69 (bug 1705440)
Backed out changeset 79dfddac72f9 (bug 1883557)
2024-03-20 14:17:11 +02:00
Gijs Kruitbosch
a3568826b0 Bug 1705440 - remove old modal prompt implementation, r=mconley,webdriver-reviewers,extension-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,whimboo,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204759
2024-03-20 10:10:26 +00:00
Gijs Kruitbosch
54f616ffdb Bug 1885547 - add a11y test for prompt relations, r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D204908
2024-03-20 10:08:13 +00:00
Sandor Molnar
30c9f381bc Backed out changeset d5975ef266e6 (bug 1305428) for causing bc failures @ accessible/tests/browser/<...> CLOSED TREE 2024-03-19 12:49:04 +02:00
Mark Banner
7e23645488 Bug 1885723 - Cleanup remaining jsm references in accessible/. r=Jamie,accessibility-frontend-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D204842
2024-03-19 08:59:10 +00:00
James Teh
c0b30241a5 Bug 1305428: Don't set ARIA DOM attributes due to accessibility API calls. r=eeejay
Per the spec, with respect to ARIA, "accessibility APIs operate in one direction only. User agents publish WAI-ARIA information (roles, states, and properties) via an accessibility API, and an AT can acquire that information using the same API. However, the other direction is not supported."
Although Firefox has not complied with this part of the spec for many years, this can cause problems for some ARIA widgets which aren't expecting ARIA attributes to be changed by the browser (nor should they, per the spec).
This might change one day, but for now, we should align with the spec.

Differential Revision: https://phabricator.services.mozilla.com/D204559
2024-03-19 04:53:47 +00:00
Nathan LaPre
ee1205dd19 Bug 1878355: Include display: inline-block when adding spaces between text alternatives, r=Jamie
When Gecko computes the text alternative for accessibles, it avoids jamming
names together without spaces between them for elements with block-like CSS
display styles. This revision adds "inline-block" to that block-like list. It
also removes the relevant expected failures from the WPT meta file.

Differential Revision: https://phabricator.services.mozilla.com/D204561
2024-03-18 19:23:48 +00:00
Norisz Fay
dcd457cb1e Backed out changeset 469d4a744966 (bug 1305428) for causing ba failures on browser_caching_value.js CLOSED TREE 2024-03-18 04:11:39 +02:00
James Teh
fbd72b154b Bug 1305428: Don't set ARIA DOM attributes due to accessibility API calls. r=eeejay
Per the spec, with respect to ARIA, "accessibility APIs operate in one direction only. User agents publish WAI-ARIA information (roles, states, and properties) via an accessibility API, and an AT can acquire that information using the same API. However, the other direction is not supported."
Although Firefox has not complied with this part of the spec for many years, this can cause problems for some ARIA widgets which aren't expecting ARIA attributes to be changed by the browser (nor should they, per the spec).
This might change one day, but for now, we should align with the spec.

Differential Revision: https://phabricator.services.mozilla.com/D204559
2024-03-18 01:11:45 +00:00
Eitan Isaacson
6d5114b3ba Bug 1885607 - P3: Flip pref for ariaActiveDescendantElement browser test.
Differential Revision: https://phabricator.services.mozilla.com/D204857
2024-03-17 00:46:51 +00:00
James Teh
271e7e6640 Bug 1883568 part 2: Ignore our window being focused until we've enabled our window after a Windows picker has been dismissed. r=rkraesig,nlapre,win-reviewers
We disable the root window when a picker opens.
When the picker closes, our window will get focus, but it will still be disabled.
This confuses the focus system.
Therefore, we ignore this focus and explicitly notify the focus system once we re-enable the window.
Since Windows picker dialogs have regressed accessibility several times now, I also added a Windows accessibility test.

Differential Revision: https://phabricator.services.mozilla.com/D203717
2024-03-13 21:26:30 +00:00
James Teh
78be54a8a4 Bug 1883568 part 1: Add the ability to wait for win events in Windows a11y tests. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D203716
2024-03-13 21:26:30 +00:00
Nathan LaPre
4bfe7ea529 Bug 1858048 - Part 2: Improve embedded control name computation, r=Jamie
This revision changes Gecko's embedded control name computation to hew to the
relevant piece of the name computation spec (currently part "C" as of writing
this, labelled "Embedded Control"). To accomplish this, this revision moves the
call to AppendFromValue ahead of the call to Name. We use AppendFromValue to do
the embedded control computation, so it's appropriate to place it before we
check aria-label and similar. LocalAccessible::Value (and similar) contain the
necessary means to calculate the things we need, except for in the case of
listbox. So, this revision contains a carveout for listbox. Finally, this change
removes the previously-marked expected-failures from the relevant WPT meta file.

Differential Revision: https://phabricator.services.mozilla.com/D204459
2024-03-13 20:46:43 +00:00
Nathan LaPre
02cd11e1df Bug 1858048 - Part 1: Give listbox role eNameFromValueRule, r=Jamie
This revision is a small preparatory change to the name rule for the listbox
role. With this change, Gecko will look to the listbox value to determine its
name.

Differential Revision: https://phabricator.services.mozilla.com/D204458
2024-03-13 20:46:42 +00:00
Norisz Fay
edd0ecc8d9 Backed out changeset bb96cef2989d (bug 1884733) for causing ba failure on browser_aria_placeholder.js CLOSED TREE 2024-03-13 01:58:53 +02:00
Morgan Rae Reschenberg
4aef1484e0 Bug 1884733: Add support for HTML placeholder, aria-placeholder via AXPlaceholderValue r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D204438
2024-03-12 23:09:47 +00:00
Eitan Isaacson
1196421a6c Bug 1883996 - P3: Hook up ariaActiveDescendantElement to accessibility. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D203851
2024-03-12 20:32:17 +00:00
Eitan Isaacson
2da285001d Bug 1883996 - P1: Add browser test for aria-activedescendant. r=Jamie
Remove EventQueue mochitest one.

Differential Revision: https://phabricator.services.mozilla.com/D203849
2024-03-12 20:32:16 +00:00
Nathan LaPre
10c7a982bd Bug 1878356: Trim non-breaking spaces from acc name prefixes, suffixes, r=Jamie
This revision modifies LocalAccessible::Name such that the function trims
non-breaking spaces from the beginning and end of accessible names. We already
compress all ASCII whitespace and trim it from the prefixes and suffixes of
accessible names - this change just extends that trimming to non-breaking spaces
for the exterior ends of the name string only. This revision implements a new
function, TrimNonBreakingSpaces, which does the trimming. Finally, this revision
removes five expected failures from the web platform tests.

Differential Revision: https://phabricator.services.mozilla.com/D203993
2024-03-11 17:53:01 +00:00
Nathan LaPre
26c564ffad Bug 1858046: Ignore aria-label, aria-labelledby for slot elements, r=Jamie
This revision modifies LocalAccessible::ARIAName such that it avoids checking
aria-label or aria-labelledby for HTML slot elements. Gecko should ignore these
attributes in name computation for slots. This revision also removes the
expected failure designations for relevant web platform tests.

Differential Revision: https://phabricator.services.mozilla.com/D203677
2024-03-06 21:38:38 +00:00
Nathan LaPre
de5e31da37 Bug 1878366: Implement fallback to next valid ARIA role, r=Jamie
The following markup is a problem for Gecko:
  <nav role="region group">x</nav>
The ARIA spec requires that "form" and "region" roles without accessible names
be treated as if no role had been provided. It requires that user agents find
a valid fallback role, or an implicit ARIA role if there's no fallback.
Currently, Gecko would see "region" but no accessible name and fall back
directly to the native role ("navigation"), skipping over the valid specified
fallback of "group."

This revision changes things. Now, if Gecko sees a region or form without an
accessible name, we'll search through the role attribute string for the next
valid (non-region, non-form) fallback role. If it doesn't find any, it will fall
back to the element's native role. This revision also updates the expectations
for a previously-failing web platform test.

Differential Revision: https://phabricator.services.mozilla.com/D203338
2024-03-06 20:10:09 +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
Nathan LaPre
ff4c89901f Bug 1865582: Include xlink:title in svg link name computation, r=Jamie
This revision implements HTMLLinkAccessible::NativeName, which, if the element
is present in an SVG context, checks the xlink:title attribute for the name, as
required by the accessible name specification. This revision also removes eight
expected failures from the relevant web platform test meta file.

Differential Revision: https://phabricator.services.mozilla.com/D203031
2024-03-05 19:04:46 +00:00
James Teh
6ce172f402 Bug 1866793: Implement extremely basic support for text caret accessibility on iOS. r=eeejay
1. Expose the IsEditing trait when a text field is focused.
2. Implement _accessibilitySelectedTextRange and _accessibilitySetSelectedTextRange to get/set the caret.

Differential Revision: https://phabricator.services.mozilla.com/D194761
2024-03-04 21:19:10 +00:00
James Teh
dd4120757f Bug 1866207: Implement iOS accessibilityValue. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D194457
2024-03-04 21:19:10 +00:00
Eitan Isaacson
82318e5aeb Bug 1864963 - Introduce accessibility traits. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D193702
2024-03-04 21:19:09 +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
Eitan Isaacson
1426e39fd3 Bug 1861207 - Use accessible name in accessibilityLabel. r=morgan
Allow the debug description to be exposed in the accessibility hint.

Differential Revision: https://phabricator.services.mozilla.com/D191880
2024-03-04 21:11:50 +00:00
Eitan Isaacson
6ea9f2f39d Bug 1851273 - P3: Implement minimal UIKit a11y. r=Jamie,morgan,nlapre,nika
Implement some UIAccessibility and UIAccessibilityContainer for gecko wrapper objects.

Differential Revision: https://phabricator.services.mozilla.com/D187330
2024-03-04 21:11:50 +00:00
Eitan Isaacson
ce4f836785 Bug 1851273 - P2: Add accessible NSObject wrappers to gecko accessibles. r=Jamie,morgan,nlapre,nika
Also create common protocol for the stub UIKit view to delegate a11y calls to the root
gecko accessible.

Differential Revision: https://phabricator.services.mozilla.com/D187329
2024-03-04 21:11:49 +00:00
Eitan Isaacson
25b310a6c2 Bug 1851273 - P1: Add accessible/ios directory. r=Jamie,morgan,nlapre
Differential Revision: https://phabricator.services.mozilla.com/D187328
2024-03-04 21:11:49 +00:00
Nathan LaPre
329ac88f51 Bug 1749505: Implement conditional role mapping for aside element, r=Jamie
This revision implements the HTML-AAM spec's rules for role mapping of the aside
element. The aside element might be either 'complementary' or 'generic'
depending on the ancestor and presence of accessible name. This revision
implements these rules via a new class, HTMLAsideAccessible, which has a
NativeRole override. This revision also updates the HTMLMarkupMap to map HTML
aside elements to HTMLAsideAccessible. Finally, this revision removes related
expected failures from web platform tests.

Differential Revision: https://phabricator.services.mozilla.com/D203192
2024-03-04 18:55:09 +00:00
Nathan LaPre
13906c252f Bug 1882909: Remove unnecessary uses of const_cast from accessibility module, r=morgan
This revision removes all removable instances of const_cast from the
accessibility module. Name() was previously non-const, but is now const. Same
for ActionWalk().

Differential Revision: https://phabricator.services.mozilla.com/D203207
2024-03-04 18:46:01 +00:00
Dave Townsend
42c576dea2 Bug 1864896: Autofix unused function arguments (accessible). r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D202948
2024-03-04 15:44:58 +00:00