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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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