Commit Graph

11323 Commits

Author SHA1 Message Date
James Teh
32cdecbd20 Bug 1911505: Expose highlighted text to Mac a11y. r=morgan,eeejay
We do this via the undocumented AXHighlight attribute, as gleaned from the WebKit and Chromium source code.

Differential Revision: https://phabricator.services.mozilla.com/D218513
2024-08-21 21:54:10 +00:00
Florian Quèze
f2cbd43752 Bug 1913624 - Remove expired telemetry histogram A11Y_UIA_DETECTION_TIMING_MS, r=TravisLong.
Depends on D219485

Differential Revision: https://phabricator.services.mozilla.com/D219486
2024-08-21 09:14:33 +00:00
Peter Van der Beken
2ddc0f8713 Bug 1912083 - Switch url argument to UTF8 string. r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D218947
2024-08-20 07:56:25 +00:00
Eitan Isaacson
03a9fd6883 Bug 1900668 - Use GDBusProxy for platform a11y enabled check. r=Jamie
Also, listen for changes in IsEnabled property.

Differential Revision: https://phabricator.services.mozilla.com/D212593
2024-08-09 16:17:17 +00:00
James Teh
786351922e Bug 1798620 part 2: Remove DocAccessibleParent::mParentDoc. r=eeejay
We have RemoteAccessible::mParent and RemoteAccessible::mDoc, so DocAccessibleParent::mParentDoc was redundant.
Aside from the redundancy, this was one extra thing we needed to keep up to date and reason about.

This involved changing the call to RemoveChildDoc in Destroy to use Unbind instead because Unbind clears the parent RemoteAccessible, but RemoveChildDoc didn't.
That meant we had a dangling RemoteAccessible::mParent pointer, which was always a problem, but is more problematic now that we no longer have mParentDoc and the destructor checks the parent document.
Since Unbind is the only caller of RemoveChildDoc, RemoveChildDoc has been merged into Unbind.
This means there is now only a single place where child documents are unbound from their parent, which should make things easier to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D218802
2024-08-09 01:45:31 +00:00
James Teh
7756c8f5dd Bug 1798620 part 1: Make RemoteAccessible::mParent a pointer instead of an id. r=eeejay
While an id was slightly safer, it also required a hash lookup every time we retrieved a parent.
This got expensive when there was a lot of tree walking, particularly given that we walk ancestors in some cases and we have to get the parent for NextSibling and PrevSibling.
Instead, mParent is now a RemoteAccessible pointer.
mChildren is already raw pointers (even when crossing documents) and we haven't encountered problems there recently, so I don't anticipate safety problems here.

Differential Revision: https://phabricator.services.mozilla.com/D218801
2024-08-09 01:45:31 +00:00
James Teh
0c667fd10a Bug 1910803: When checking if frames are on different lines in a11y, check if the frames are in different line lists before comparing their LineIterators. r=morgan
For example, one of the frames could be in the block's main in-flow line list and the other could be in an overflow list.
When this happens, it's not valid to compare LineIterators, so we must compare the line lists first.

Differential Revision: https://phabricator.services.mozilla.com/D218613
2024-08-07 22:51:58 +00:00
Narcis Beleuzu
0fb8ac8e50 Backed out changeset de9fbd4835b7 (bug 1900668) for mochitest leakchecks. CLOSED TREE 2024-08-06 23:53:19 +03:00
Eitan Isaacson
17d06ccb0d Bug 1900668 - Use GDBusProxy for platform a11y enabled check. r=Jamie
Also, listen for changes in IsEnabled property.

Differential Revision: https://phabricator.services.mozilla.com/D212593
2024-08-06 18:36:11 +00:00
Anna Yeddi
39d02ec02f Bug 1884970 - Close current tab button is missing an accessible name and role. r=tabbrowser-reviewers,fluent-reviewers,dao,bolsson,flod
The [tab-close-button](https://searchfox.org/mozilla-central/rev/f9157a03835653cd3ece8d2dc713a782b7e4374e/browser/base/content/tabbrowser-tab.js#40) is not labeled and is missing an interactive role of button, while it is functioning as one.

Note: we do not want this control to be keyboard focusable, because keyboard-only user could close the tab via the context menu and we don't want to create an additional tab stop for the navigation as well, but making sure the control is marked up as a button with an accessible name would allow it to be actionable with speech-to-text software, with touch devices, with switch controls in scan mode, and for screen readers via their navigation shortcuts as well.

Differential Revision: https://phabricator.services.mozilla.com/D204413
2024-08-06 13:51:06 +00:00
Otto Länd
d148733a9d Bug 1905211: apply code formatting via Lando
# ignore-this-changeset
2024-08-05 02:58:07 +00:00
James Teh
b453f2a8d5 Bug 1905211 part 10: Expose target text as an a11y text attribute. r=morgan
This is now simply a matter of leveraging the work in the previous patches to support the new selection type and map it to the correct attribute.
There isn't an IAccessible2 or ATK attribute for this yet.
We use mark:true, based on <mark> and role="mark" which is used for a semantic highlight.
I've discussed this with Google, NV Access and Vispero and they all seem to be happy with this.

Differential Revision: https://phabricator.services.mozilla.com/D217071
2024-08-05 02:54:38 +00:00
James Teh
6652c8aa0d Bug 1905211 part 9: Add urlSuffix parameter to addAccessibleTask. r=morgan
We need this for the text fragment tests to load the page with an initial fragment.

Differential Revision: https://phabricator.services.mozilla.com/D217070
2024-08-05 02:54:38 +00:00
James Teh
7e1187c9e6 Bug 1905211 part 8: Move code to check whether text attribute ranges match out of browser_text_spelling.js and generalise it for use with other attributes. r=morgan
We will need this for the text fragment tests.

Differential Revision: https://phabricator.services.mozilla.com/D217069
2024-08-05 02:54:38 +00:00
James Teh
38e692da86 Bug 1905211 part 7: Notify accessibility about ranges that are added or removed from selections. r=smaug,morgan
nsISelectionListener isn't sufficient because it only notifies that the selection has changed.
A11y needs to know specifically which ranges were added or removed.
Previously, we handled this specifically for spelling errors in mozInlineSpellChecker.
That code has been removed and replaced with a more general approach.

Since we now have these notifications, rather than using nsISelectionListener just to fire events, we now use these notifications for that as well.
This avoids the need to add additional nsISelectionListeners, which would get messy particularly for custom highlights where there can be an arbitrary number of selections at any given time.

Differential Revision: https://phabricator.services.mozilla.com/D217068
2024-08-05 02:54:37 +00:00
James Teh
f3241d83cf Bug 1905211 part 6: Adjust names and comments to reflect that this code can now be used for more than spelling errors. r=morgan
There should be no functional change here.

Differential Revision: https://phabricator.services.mozilla.com/D217067
2024-08-05 02:54:37 +00:00
James Teh
8548fd59ea Bug 1905211 part 5: Generalise the a11y spelling error code to support multiple selection types. r=morgan
Previously, this code was specifically tied to the spell check selection.
Actually adding more selection types will come in subsequent patches.

Differential Revision: https://phabricator.services.mozilla.com/D217066
2024-08-05 02:54:36 +00:00
James Teh
146a1d8e33 Bug 1905211 part 4: Use TextOffsetAttribute for spelling errors. r=morgan
An array of ints is fine for spelling errors, but we need to support multiple attributes like this.
We could use an array of ints for each attribute and search each one, though that would require more work in the parent process.
Also, custom highlights can have multiple selections for a single highlight type.
This would be rather messy with int arrays, especially where multiple selections span beyond the Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D217065
2024-08-05 02:54:36 +00:00
James Teh
853bc7d6f2 Bug 1905211 part 3: Introduce TextOffsetAttribute struct and support it as a serialisable attribute value. r=morgan
See the code comments for details.
We will soon use this for spelling errors, etc.

Differential Revision: https://phabricator.services.mozilla.com/D217064
2024-08-05 02:54:36 +00:00
James Teh
84a6fe08c4 Bug 1905211 part 2: Use AbstractRange instead of nsRange for a11y spelling error code. r=morgan
This doesn't matter for spelling errors.
However, we will soon generalise this code for use with other attributes like this.
In particular, custom highlights require us to use AbstractRange.
While we aren't supporting custom highlights in this bug, it is more effective to do this as part of this major refactor rather than doing another refactor later.

Differential Revision: https://phabricator.services.mozilla.com/D217063
2024-08-05 02:54:35 +00:00
James Teh
e71347a74f Bug 1905211 part 1: Remove unnecessary script load in browser_text_spelling.js so that it can actually run. r=morgan
This test is disabled on CI because it's a bit fragile and we've never been able to work out how to fix that.
However, it's still useful locally.
Unfortunately, because it's disabled on CI, this problem wasn't caught when tests were moved around.

Differential Revision: https://phabricator.services.mozilla.com/D217062
2024-08-05 02:54:35 +00:00
Masayuki Nakano
33a24a0600 Bug 1909577 - Make some nsFocusManager::GetFocusedElement() users use its static version instead r=emilio,credential-management-reviewers,issammani
Now, we have `nsFocusManager::GetFocusedElementStatic()` which returns focused
element if the `nsFocusManager` instance is available.  Therefore, if
`nsFocusManager::GetFocusedElement()` users do not use other methods of
`nsFocusManager`, they can use `nsFocusManager::GetFocusedElementStatic()` and
make themselves simpler.

Note that some callers return early if `nsFocusManager` is not available, but
they do not return error and `nsFocusManager` instance is available in most
time of the life time of the process.  Therefore, we can simply stop using the
early return.

Differential Revision: https://phabricator.services.mozilla.com/D217527
2024-07-25 00:33:58 +00:00
Moritz Beier
3e5fce6039 Bug 1863530 - Remove browser.search.widget.inNavBar pref. r=dao,settings-reviewers,search-reviewers,omc-reviewers,urlbar-reviewers,Gijs,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D215607
2024-07-23 17:29:00 +00:00
Emilio Cobos Álvarez
b03f9d79e0 Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Emilio Cobos Álvarez
436aae97d3 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 17:49:39 +00:00
Stanca Serban
00e6de8399 Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures. CLOSED TREE 2024-07-20 18:43:13 +03:00
Emilio Cobos Álvarez
45d6f3f899 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 14:17:31 +00:00
Sylvestre Ledru
45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Eemeli Aro
ee72adeb6a Bug 1907422 - Rename "click ancestor" as "clickAncestor". r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D216335
2024-07-15 04:46:18 +00:00
James Teh
7075505067 Bug 1901459 fixup: Cosmetic changes from code review that I applied locally and somehow neglected to push to Phabricator. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D216131
2024-07-11 23:28:17 +00:00
Masayuki Nakano
518f238fa3 Bug 1906015 - part 2: Make the most do_QueryInterface users for nsIFormControl use new getter methods r=smaug,credential-management-reviewers,sessionstore-reviewers,sclements
Unfortunately, the following QIs are still required.
https://searchfox.org/mozilla-central/rev/cbdfa503a87597b20719aae5f6a1efccd6cb3b7b/dom/html/nsIConstraintValidation.cpp#101,121

Depends on D215576

Differential Revision: https://phabricator.services.mozilla.com/D215577
2024-07-10 00:46:59 +00:00
James Teh
0f20901790 Bug 1901459 part 4: Implement ITextProvider::RangeFromChild. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D215760
2024-07-09 02:52:16 +00:00
James Teh
ede1495f62 Bug 1901459 part 3: Implement ITextRangeProvider::GetChildren. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D215759
2024-07-09 02:52:16 +00:00
James Teh
2451b5f8bb Bug 1901459 part 2: Implement ITextRangeProvider::GetEnclosingElement. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D215758
2024-07-09 02:52:15 +00:00
James Teh
0c663df642 Bug 1901459 part 1: Correctly remove any globals in the a11y Python environment after each test. r=nlapre
First, previously, we were doing this in registerCleanupFunction, but this actually runs after the entire test file has finished, not each task.
We need this to happen after each task because some tasks might set Python globals which might interfere with other tasks.

Second, even when this did run previously, we didn't actually wait until it was complete.
runPython() is async, so we need to wait for the Promise to be fulfilled.

Third, if we had awaited this previously, we would have hung forever.
The Python runner wasn't sending a response when it finished the reset, so the JS code never knew when it had completed.
We now just send a return of None in this case to signal completion.

Differential Revision: https://phabricator.services.mozilla.com/D215757
2024-07-09 02:52:15 +00:00
Stanca Serban
9cefe2edad Backed out changeset 94a2d660b4c5 (bug 1822975) for causing browser_net_accessibility related devtools failures. CLOSED TREE 2024-07-03 00:05:37 +03:00
Gijs Kruitbosch
11b2bc1cb4 Bug 1822975 - clean up places that manually enable broader async stacks which is now the default in tests, r=devtools-reviewers,firefox-desktop-core-reviewers ,geckoview-reviewers,mconley,ohall
Differential Revision: https://phabricator.services.mozilla.com/D215204
2024-07-02 19:44:29 +00:00
Dão Gottwald
1c9dd74f04 Bug 1905311 - Move / remove the rest of browser/base/content/browser.css. r=desktop-theme-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D215190
2024-07-01 09:27:17 +00:00
James Teh
154b408813 Bug 1905021: Don't incorrectly treat the start of a node inside a contentEditable as the end of a line. r=nlapre
Previously, we assumed that CaretAssociationHint::Before always meant the caret was at the insertion point at the end of a line.
However, it can also mean that the caret is before the start of a node in the middle of a line.
To fix this, we need to check for line and paragraph boundaries.
See the code comments for details.

I moved this functionality completely out of HyperTextAccessible and into TextLeafPoint.
First, it was easiest to do these checks with private functions already available to TextLeafPoint.
Second, this ideally belongs in TextLeafPoint anyway; its existence in HyperTextAccessible was vestigial.

Differential Revision: https://phabricator.services.mozilla.com/D215089
2024-07-01 06:24:13 +00:00
acseh
e74b86533c Backed out changeset a5ff95602119 (bug 1905021) as requested for causing accessibility crashes related to selection a=backout 2024-07-01 00:35:00 +03:00
James Teh
d8571e7f91 Bug 1905065: Add test. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D215179
2024-06-28 23:31:05 +00:00
James Teh
08e5d9edbe Bug 1905021: Don't incorrectly treat the start of a node inside a contentEditable as the end of a line. r=nlapre
Previously, we assumed that CaretAssociationHint::Before always meant the caret was at the insertion point at the end of a line.
However, it can also mean that the caret is before the start of a node in the middle of a line.
To fix this, we need to check for line and paragraph boundaries.
See the code comments for details.

I moved this functionality completely out of HyperTextAccessible and into TextLeafPoint.
First, it was easiest to do these checks with private functions already available to TextLeafPoint.
Second, this ideally belongs in TextLeafPoint anyway; its existence in HyperTextAccessible was vestigial.

Differential Revision: https://phabricator.services.mozilla.com/D215089
2024-06-28 23:30:08 +00:00
James Teh
c3b181bc19 Bug 1901457 part 6: Raise UIA Text TextSelectionChanged and TextChanged events. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214346
2024-06-26 10:15:45 +00:00
James Teh
83137ab39e Bug 1901457 part 5: Implement ITextProvider::GetSelection. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214345
2024-06-26 10:15:45 +00:00
James Teh
82324325a3 Bug 1901457 part 4: Implement ITextProvider::get_SupportedTextSelection. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214344
2024-06-26 10:15:44 +00:00
James Teh
89e51400b5 Bug 1901457 part 3: Add a way to get text selection as TextLeafRanges. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214343
2024-06-26 10:15:44 +00:00
James Teh
d8a12f0303 Bug 1901457 part 2: Refactor TextLeafPoint caret retrieval so that the end of line insertion point can be stored without being tied to the current caret position. r=nlapre
Previously, TextLeafPoint::GetCaret() returned a placeholder representation of the caret.
ActualizeCaret() was then used to get the real caret position, optionally adjusting for the line end depending on the caller's needs.
This causes problems when we need to store the TextLeafPoint information in a UIA text range object because the only way to indicate the line end insertion point is to use the GetCaret() placeholder, but that also means the stored position changes if the caret moves.
For example, if you disabled NVDA's "caret moves review cursor" setting and then moved the caret, the review cursor should stay at the old position, but it didn't previously.

To fix this:

1. TextLeafPoint now has a new mIsEndOfLineInsertionPoint flag which is set to true by GetCaret() if appropriate.
2. GetCaret() sets mAcc and mOffset immediately, rather than needing to call ActualizeCaret() later.
3. TextLeafPoint methods still need to adjust the point to correctly handle the line end insertion point in some cases, but that is now handled by the private TextLeafPoint::AdjustEndOfLine method.
4. FindBoundary now correctly returns the previous character/cluster when requested for this end of line insertion point. Strictly speaking, this bug always existed, but no existing callers ever triggered it.

Differential Revision: https://phabricator.services.mozilla.com/D214342
2024-06-26 10:15:43 +00:00
James Teh
9b513e46b8 Bug 1901457 part 1: When a caret is at the end of a line, have TextLeafPoint::FindBoundary return no character for BOUNDARY_CLUSTER. r=nlapre
We already did this for BOUNDARY_CHAR, but i neglected to update this for cluster in bug 855184.
Without this, FindBoundary with BOUNDARY_CLUSTER on a caret TextLeafPoint when the caret is at the end of a line would return the last cluster instead of no character.

Differential Revision: https://phabricator.services.mozilla.com/D214341
2024-06-26 10:15:43 +00:00
James Teh
470cf7c89f Bug 1901456 part 6: Implement ITextRangeProvider Clone, Compare, CompareEndpoints, ExpandToEnclosingUnit, Move, MoveEndpointByRange AND MoveEndpointByUnit methods. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214225
2024-06-26 02:03:39 +00:00
James Teh
5dee144317 Bug 1901456 part 5: Provide a way to safely get a TextLeafRange from an ITextRangeProvider pointer provided by a client. r=nlapre
This will be needed for the Compare, CompareEndpoints and MoveEndpointByRange methods.

Differential Revision: https://phabricator.services.mozilla.com/D214224
2024-06-26 02:03:38 +00:00
James Teh
212b9b7518 Bug 1901456 part 4: Implement ITextRangeProvider::GetText. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214223
2024-06-26 02:03:38 +00:00
James Teh
59796e9178 Bug 1901456 part 3: Implement ITextProvider::get_DocumentRange for editable text controls, with stubs for the other ITextProvider methods. r=nlapre
Unfortunately, this can't be usefully tested without implementing another method, so tests will come in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D214222
2024-06-26 02:03:38 +00:00
James Teh
4761cf95fb Bug 1901456 part 2: Store and reconstitute the TextLeafRange in UiaTextRange using MsaaAccessible strong references. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214221
2024-06-26 02:03:37 +00:00
James Teh
73aa7d3a46 Bug 1901456 part 1: Add stub ITextRangeProvider implementation. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214220
2024-06-26 02:03:36 +00:00
Morgan Rae Reschenberg
edd342a116 Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-06-25 23:06:08 +00:00
Nathan LaPre
9162c8ef57 Bug 1903713: Avoid static nsTHashSet constructor via instance method, r=Jamie
This revision avoids static construction of the nsTHashSet by hiding the set
behind an instance method.

Differential Revision: https://phabricator.services.mozilla.com/D214664
2024-06-24 22:52:21 +00:00
Oliver Medhurst
a3c3d074ca Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-24 10:53:24 +00:00
Cristian Tuns
c6e6389cac Backed out changeset 46970b1c1903 (bug 1877969) for causing xpcshell failures in test_bug1086684.js CLOSED TREE 2024-06-21 11:48:23 -04:00
Oliver Medhurst
c5514c6485 Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-21 14:17:22 +00:00
Masayuki Nakano
d835b38b9f Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Morgan Rae Reschenberg
8c415c1069 Bug 1901853: Update <dd> and <dl> roles to match spec for VO r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D213280
2024-06-13 19:47:05 +00:00
James Teh
808f8aaefd Bug 1901676: Set lastParent and lastParentID in DocAccessibleParent::RecvShowEvent. r=eeejay
In bug 1779578, I changed the way a11y trees are serialised such that the parent id is included for each Accessible.
When de-serialising in DocAccessibleParent::RecvShowEvent, in order to avoid a theoretical performance regression caused by repeatedly looking up the same parent, I added an optimisation to use the last parent if it is the same as the current parent.
Unfortunately, it seems I never actually set the lastParent and lastParentID variables, so this optimisation was a no-op!

This is a micro-optimisation: it doesn't seem to make any observable difference.
However, it seems silly to have effectively dead code and it's a very straightforward fix.

Differential Revision: https://phabricator.services.mozilla.com/D213177
2024-06-12 00:56:29 +00:00
Eitan Isaacson
2bbd949eff Bug 1678712 - Support AXLangauge. r=morgan
The important part here is to have the text leafs inherit their parents' language.

Differential Revision: https://phabricator.services.mozilla.com/D212604
2024-06-11 19:41:20 +00:00
James Teh
c73ce972ef Bug 1813976: Support RemoteAccessible::Language on non-HyperText Accessibles. r=morgan
1. HyperTextAccessibles already cache language and RemoteAccessible::Language uses this.
2. Previously, we didn't cache language for a non-text, non-HyperText Accessible at all. This includes images and HTML radio buttons. Now we cache it as a top level attribute in this case and return it in RemoteAccessible::Language.
3. We previously cached language for a text (leaf) Accessible where the language differed from its parent, but we never used this in RemoteAccessible::Language, only when calculating text attributes. Now we use it in RemoteAccessible::Language as well.
4. Where a text (leaf) Accessible's language is the same as its parent, RemoteAccessible::Language now gets this from the parent.

Differential Revision: https://phabricator.services.mozilla.com/D212503
2024-06-05 23:51:11 +00:00
Sandor Molnar
5c4d387874 Backed out changeset 718208a40b89 (bug 1888310) for causing mochitest failures @ browser_app.js CLOSED TREE 2024-06-05 00:43:46 +03:00
Morgan Rae Reschenberg
4e0ffe1a17 Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-06-04 20:42:45 +00:00
James Teh
6ffc34fe0a Bug 855184 part 2: Map IA2_TEXT_BOUNDARY_CHAR to cluster. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D212536
2024-06-04 20:36:42 +00:00
James Teh
3b3a1815ea Bug 855184 part 1: Add BOUNDARY_CLUSTER so a11y can query grapheme clusters, AKA user-perceived characters. r=eeejay
Most OS APIs want a cluster when they ask for a "character", except ATK.
Rather than altering BOUNDARY_CHAR, I added a new BOUNDARY_CLUSTER.
Aside from being less risky and causing less churn, there are cases internally where we want to move a TextLeafPoint by character; e.g. to explicitly move to the next/previous Accessible or to move to the next/previous character in an abstract way without worrying about Accessible boundaries.
Calculating clusters is more expensive, so it doesn't make sense to move by cluster in those cases.

Differential Revision: https://phabricator.services.mozilla.com/D212517
2024-06-04 20:36:42 +00:00
Moritz Beier
47de7bd820 Bug 1610530 - Use classes instead of ids to access urlbar elements from UrlbarInput. r=dao,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D212095
2024-06-04 12:58:52 +00:00
James Teh
5c6a8e23d4 Bug 1900287: Grudgingly refactor GetUiaClientPidsWin11 into a class to make MinGW happy. r=nlapre
In order to keep all of the tragic implementation detail for this function in a single class, I originally put the structs and the thread proc inside the function.
The thread proc was implemented as a lambda which implicitly converts to a function pointer.
Unfortunately, it seems MinGW can't implicitly convert this lambda to a function with the stdcall calling convention.
This is why we can't have nice things.
To deal with this, refactor it into a class so that we can define the thread proc as a static function instead of a lambda.
All of the methods are static; the class is just used to contain the implementation details.

Differential Revision: https://phabricator.services.mozilla.com/D212391
2024-06-03 21:30:17 +00:00
James Teh
01bf6473f9 Bug 1899211: When detecting UIA clients, query the pid of named pipes in another thread to avoid hangs. r=nlapre
Querying some pipe handles can cause a hang and there is no way to prevent this other than terminating the thread.
See the discussion on the bug for more details and research.
Therefore, query the pipes in another thread.
If the thread takes too long, terminate it and resume querying other handles in another thread.

Differential Revision: https://phabricator.services.mozilla.com/D212088
2024-06-03 00:58:57 +00:00
Sandor Molnar
44cb202bdf Backed out changeset 29e984633f5e (bug 1888310) for causing mochitest failures @ accessible/tests/browser/mac/browser_app.js CLOSED TREE 2024-05-31 00:47:54 +03:00
Morgan Rae Reschenberg
9a72ddca2b Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-05-30 21:01:20 +00:00
Ting-Yu Lin
8016adbafa Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
6306934820 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
df8ff2d9ac Bug 1896516 Part 3 - Change GetScrollTargetFrame() to return ScrollContainerFrame. r=layout-reviewers,emilio
Also, simplify some callers of `GetScrollTargetFrame()` to drop
`nsIScrollableFrame*` and unnecessary `do_QueryFrame`. We'll continue removing
more `nsIScrollableFrame*` in later parts.

Differential Revision: https://phabricator.services.mozilla.com/D211490
2024-05-30 06:32:18 +00:00
Sebastian Hengst
ccb101be8f Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
James Teh
84c3f34421 Bug 1896367: Use changes to ElementState::DISABLED to detect HTML disabled state changes. r=eeejay
Previously, we listened for changes to the disabled attribute itself.
However, this doesn't handle the case that the disabled state is inherited from a fieldset ancestor.
In contrast, DOM notifies us about changes to ElementState::DISABLED on form control descendants when a fieldset gains or loses the disabled attribute.

Differential Revision: https://phabricator.services.mozilla.com/D211688
2024-05-29 05:59:57 +00:00
Eitan Isaacson
2315714492 Bug 1875629 - Add AXContents to outer docs (scroll areas). r=morgan
Without this attribute VoiceOver gets into an unstable state when the cursor or focus
leaves the document.

Differential Revision: https://phabricator.services.mozilla.com/D211617
2024-05-28 20:52:51 +00:00
Ting-Yu Lin
84637bc68a Bug 1896875 - Destroy line list and the frames in reverse order to avoid non-linear time complexity. r=layout-reviewers,eeejay,emilio
This patch is similar to
https://hg.mozilla.org/mozilla-central/rev/e8114275db22

We destroy the line list and the frames in reverse order to avoid unnecessary
first-in-flow and first-continuation cache update.

Differential Revision: https://phabricator.services.mozilla.com/D211681
2024-05-28 16:53:23 +00:00
Ting-Yu Lin
83578c4adb Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-28 04:46:19 +00:00
Ting-Yu Lin
9ab65dbb68 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-28 04:46:19 +00:00
Ting-Yu Lin
9a9b18c0b6 Bug 1896516 Part 3 - Change GetScrollTargetFrame() to return ScrollContainerFrame. r=layout-reviewers,emilio
Also, simplify some callers of `GetScrollTargetFrame()` to drop
`nsIScrollableFrame*` and unnecessary `do_QueryFrame`. We'll continue removing
more `nsIScrollableFrame*` in later parts.

Differential Revision: https://phabricator.services.mozilla.com/D211490
2024-05-28 04:46:17 +00:00
James Teh
ad246a46f8 Bug 1897597 part 2: Don't treat bidi split continuations as line breaks. r=morgan
Continuations occur when text wraps onto a new line (fluid continuations), but they also occur when the text direction changes (non-fluid continuations).
Previously, TextLeafRange assumed that all continuations were line breaks.
Now, we explicitly treat fluid continuations as line breaks.
It's also possible for a non-fluid continuation to be on a different line if the text direction changes between the end of the previous line and the start of another.
In that case, we must use a line iterator to check whether they are on different lines.

Differential Revision: https://phabricator.services.mozilla.com/D210893
2024-05-27 06:21:04 +00:00
James Teh
b8d61523d1 Bug 1897597 part 1: Split TextLeafRange code to check whether frames are on different lines into a separate function. r=morgan
There should be no functional change here.
However, we're going to need to reuse this elsewhere in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D210986
2024-05-27 06:21:03 +00:00
James Teh
f0250b65b5 Bug 1898198: Fix RemoteAccessible::TakeFocus when the browser UI has focus. r=eeejay
Previously, this didn't move the focus at all in this case.

Differential Revision: https://phabricator.services.mozilla.com/D211314
2024-05-26 21:50:29 +00:00
Eitan Isaacson
3357f914c8 Bug 1895551 - Remove aria attribute from ElementInternals when set to null. r=Jamie,dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D209721
2024-05-24 22:37:12 +00:00
Emilio Cobos Álvarez
e1bbbb144c Bug 1896599 - Remove event-from-input support. r=Jamie,devtools-reviewers,eeejay,nchevobbe
As per the comments it isn't supported with cache-the-world on, it's
barely documented if at all, and a test for it seems to be failing
without me being able to reproduce it at least (tried on both windows
and Linux).

I don't think it's worth digging too much more into it. My guess is a
reentrant / differently timed a11y event caused by my scheduling
changes, or so, which would override sEventTargetNode or the other
static bool.

The test has ~always failed on macOS too...

Differential Revision: https://phabricator.services.mozilla.com/D210872
2024-05-23 12:09:21 +00:00
James Teh
095a80c647 Bug 1897349: Don't update CSS pseudo-element TextLeafAccessibles if there is CSS content alt text. r=eeejay
When we create a TextLeafAccessible for a CSS pseudo-element, we already use the alt text if present.
However, it seems layout sometimes re-renders the text of pseudo-elements.
Previously, a11y would update the text in this case like it would for any other TextLeafAccessible, thus overwriting the alt text with the text rendered by layout.
To fix this, we now skip updating text if CSS alt text is present.

Differential Revision: https://phabricator.services.mozilla.com/D211139
2024-05-22 22:14:33 +00:00
James Teh
426407a812 Bug 1810596: When computing the text for a live region on Android, always include the text from the subtree. r=eeejay,geckoview-reviewers,ohall
Previously, we only included the subtree for roles which are allowed to be traversed during recursive name computation.
This meant that no text would be produced for live regions with roles such as status, where name computation traversal is not allowed.
Now, we first get the name to handle cases where the name is explicitly specified; e.g. images with alt text.
We then add the subtree text if the name wasn't already computed from it.

Differential Revision: https://phabricator.services.mozilla.com/D210628
2024-05-22 22:14:01 +00:00
Nathan LaPre
44b945e448 Bug 1898082: Clean up comments in nsTextEquivUtils, r=Jamie
This revision updates outdated comments in nsTextEquivUtils that refer to
previous names for steps of the Accessible Name and Description Computation
specification. It updates the comments to the new, named computation steps.
Additionally, this revision cleans up and adds other comments to make reading
the code a bit easier.

Differential Revision: https://phabricator.services.mozilla.com/D211110
2024-05-22 17:19:30 +00:00
Morgan Rae Reschenberg
62ce834ce8 Bug 1895408: Add support for exposing critical, supoptimal, optimal meter values via AXValueDescription r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D209615
2024-05-21 22:11:05 +00:00
Nathan LaPre
6e696c39b1 Bug 1878355: Restrict ARIA IDREF, node consultation in acc name traversals, r=Jamie
The Acc Name spec requires that UAs should only follow aria-labelledby and
aria-describedby IDREFs "if [...] the current node is not already part of an
ongoing aria-labelledby or aria-describedby traversal." It also requires
that "[e]ach node in the subtree is consulted only once." This revision
implements these rules and updates relevant tests, including removal of WPT
expected-fail designations. The concept of sInitiatorAcc has been expanded - we
now track all referenced accessibles. We also track whether we're in an
aria-labelledby or aria-describedby traversal.

Differential Revision: https://phabricator.services.mozilla.com/D209617
2024-05-20 20:16:36 +00:00
Sebastian Hengst
d7e22e3ac3 Bug 1897430 - enable CSS alt text for accessibility tree tests. r=Jamie
Test got added in bug 1896047.

Differential Revision: https://phabricator.services.mozilla.com/D210801
2024-05-20 03:10:37 +00:00
James Teh
b2b99f4e80 Bug 1896047 part 6: Support the CSS attr() function in CssAltContent. r=eeejay
As well as plain strings, alt text items can get their text from an attribute on the Element.
We need to include the values of those attributes when we compute alt text.
In addition, we must watch for changes to these attributes and update the accessibility tree or fire events as necessary.

Differential Revision: https://phabricator.services.mozilla.com/D210018
2024-05-17 00:24:16 +00:00
James Teh
6782d3d9fd Bug 1896047 part 5: Support CSS alt text for text content. r=eeejay
CSS alt text makes most sense for an image.
However, even when the content property specifies text, you can still specify alt text!
To support this, this patch does two things:

1. Uses the alt text for the TextLeafAccessible instead of the primary text.
2. Tweaks nsTextEquivUtils to use the alt text when gathering text from a subtree.

As with the last patch, changing the CSS content replaces the pseudo-element, which in turn replaces the Accessible with a new one, so we don't need any additional code to handle updates.

Differential Revision: https://phabricator.services.mozilla.com/D210017
2024-05-17 00:24:16 +00:00
James Teh
845cf6ca31 Bug 1896047 part 4: Create an ImageAccessible for a pseudo-element image if there is CSS alt text. r=eeejay
Previously, a11y did get notified about CSS images, but we chose not to create Accessibles for them.
This patch allows us to create an ImageAccessible for a CSS image if it has alt text.
Since there is now an Accessible, the previous patch will then mean that Accessible::Name will return the CSS alt text.
Changing the CSS content replaces the pseudo-element, which in turn replaces the Accessible with a new one, so we don't need any additional code to handle updates.

Differential Revision: https://phabricator.services.mozilla.com/D210016
2024-05-17 00:24:15 +00:00
James Teh
dea9f43263 Bug 1896047 part 3: Use CSS alt text as the name for an Accessible if all else fails. r=eeejay
This directly handles the case where the CSS content property replaces the content of an element with an image plus alt text.
It is also needed to correctly return the alt text for a pseudo-element ImageAccessible, as implemented in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D210015
2024-05-17 00:24:15 +00:00
James Teh
1b49a39c03 Bug 1896047 part 2: Introduce CssAltContent class to query alternative text specified in the CSS content property. r=eeejay
This allows us to check for alt text and also to output all of it to a string.
For now, this only supports plain strings, but this will be extended in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D210014
2024-05-17 00:24:14 +00:00
James Teh
a157ee3a80 Bug 1896047 part 1: Enclose TreeWalker implementation in a namespace block. r=eeejay
Without this, a new source file introduced in a subsequent patch causes the compiler to become confused about which TreeWalker we mean: a11y::TreeWalker or dom::TreeWalker.
I don't really understand why this starts happening, but I'm guessing it is related to our unified builds.

Differential Revision: https://phabricator.services.mozilla.com/D210013
2024-05-17 00:24:14 +00:00
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
Ting-Yu Lin
edb8e4ddd5 Bug 1824877 Part 3 - Change ScrollContainerFrame's type from Scroll to ScrollContainer. r=dholbert
This effectively changes the `IsScrollFrame()` helper to
`IsScrollContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D210357
2024-05-15 17:50:49 +00:00
Emilio Cobos Álvarez
98edf786e6 Bug 1896763 - Make display observer timing happen after all layout changes are possibly done. r=smaug,Jamie
Not sure how testable this is, for a11y purposes. The other consumer is
some XRSession stuff which doesn't seem to care too much about the
timing of this.

Differential Revision: https://phabricator.services.mozilla.com/D210384
2024-05-15 09:36:52 +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
Emilio Cobos Álvarez
57df8917ac Bug 1895870 - Simplify refresh driver observer set-up. r=smaug
There's no call to AddRefreshObserver(FlushType::Layout), so we don't
need to track layout flushes. The only reason we need
mLayoutFlushObservers is so that reflows triggered from the style flush
get processed. But at that point, we can just flush layout directly.

There's no really good distinction between style flushes and layout
flushes with container queries anyways, so this makes the code simpler
to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D209924
2024-05-14 08:12:03 +00:00
James Teh
1a3cee9cff Bug 1892372: Make HTML progress elements expose the readonly a11y state. r=eeejay
We already did this for ARIA role="progress" per the Core AAM spec.
Per the HTML AAM spec, HTML <progress> should map to ARIA role progress.

Differential Revision: https://phabricator.services.mozilla.com/D209903
2024-05-13 09:17:24 +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
af0fad06a4 Bug 1887790 part 1: Remove nsAccUtils::IsARIALive. r=nlapre
This isn't used any more and only works for LocalAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D209657
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
James Teh
94794e02dc Bug 1887789 part 1: Fixes to Accessible::LandmarkRole. r=morgan
1. The ARIA role should take precedence over the HTML tag.
2. The ARIA region role should only be conditionally treated as a landmark. Use the Gecko role to determine this.
3. Change some other cases to use the Gecko role instead of directly checking the name for consistency and to avoid duplicated logic.

These fixes are tested in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D209099
2024-05-08 06:04:47 +00:00
Eitan Isaacson
40d19ea543 Bug 1894975 - Test relation with multiple targets. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D209405
2024-05-07 22:29:43 +00:00
Emilio Cobos Álvarez
8bb4e85b36 Bug 1848899 - Remove widget.non-native-theme.enabled. r=desktop-theme-reviewers,dao,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209537
2024-05-07 08:32:14 +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
75a487a75d Bug 1887789 part 1: Fixes to Accessible::LandmarkRole. r=morgan
1. The ARIA role should take precedence over the HTML tag.
2. The ARIA region role should only be conditionally treated as a landmark. Use the Gecko role to determine this.
3. Change some other cases to use the Gecko role instead of directly checking the name for consistency and to avoid duplicated logic.

These fixes are tested in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D209099
2024-05-07 02:54:00 +00:00
Norisz Fay
388713c6ce Backed out changeset 9500b79c1ab4 (bug 1848899) for causing failures on test_bug869314.html CLOSED TREE 2024-05-07 06:13:38 +03:00
Thomas Wisniewski
1c400ec41c Bug 1893376 - have XPCOM GetAccessibleFor return GetAccessibleEvenIfNotInMap when getting an Accessible for a DOM node; r=Jamie
This allows tests to get an Accessible for an HTML area element, since area elements are special and are not in the DocAccessible node map.

Differential Revision: https://phabricator.services.mozilla.com/D209614
2024-05-07 01:04:21 +00:00
Emilio Cobos Álvarez
3b42787268 Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug
This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.

Differential Revision: https://phabricator.services.mozilla.com/D209525
2024-05-06 21:54:37 +00:00
Emilio Cobos Álvarez
e3d5cf0e8e Bug 1848899 - Remove widget.non-native-theme.enabled. r=desktop-theme-reviewers,dao,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209537
2024-05-06 20:44:34 +00:00
Anna Yeddi
0880801692 Bug 1893033 - Expand a11y-checks debugging documentation in the Mochitest FAQ. r=Jamie
Add more FAQs for engineers working with the a11y_checks results and include a link to the Mochitest FAQ to debug a11y-checks in the Accessibility docs section.

Differential Revision: https://phabricator.services.mozilla.com/D208393
2024-05-06 16:32:54 +00:00
Ting-Yu Lin
b6efd1588f Bug 1488080 Part 1 - Convert GetAllInFlowRects flags to EnumSet. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D209096
2024-05-03 18:42:41 +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
76cf2fa9f9 Bug 1894436: Only expose an implicit selected state for focused option, tab and treeitem Accessibles. r=morgan
Previously, we did this for any focused, selectable item.
However, the ARIA spec says we should only do this for option, tab and treeitem.
In particular, we shouldn't do this for gridcell, as this can expose gridcells as selected when they aren't.

Differential Revision: https://phabricator.services.mozilla.com/D209132
2024-05-03 10:47:59 +00:00
James Teh
07708fd3ff Bug 1893096: When a <td> gets an implicit role of gridcell, map ARIA states appropriately. r=morgan
We return the implicit role in ARIATransformRole, but that doesn't change the role map entry.
However, ApplyARIAState uses the role map entry to figure out what states are relevant.
To fix this, ApplyARIAState now checks for this case and gets the correct role map entry before applying states.

Differential Revision: https://phabricator.services.mozilla.com/D208855
2024-05-03 05:31:25 +00:00
Morgan Rae Reschenberg
00e1715f0d Bug 1884258: Introduce mozRangeAccessible to support progress HTML element r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D204444
2024-05-02 21:50:49 +00:00
Nathan LaPre
9d751c3283 Bug 1878356: Remove nbsp trimming from acc names, r=Jamie
This revision reverts the changes that trimmed non-breaking spaces from the
start and end of accessible names. The web platform group has decided that
those tests weren't valid as-is; the correct behavior is not to trim those
characters. This revision also removes expected-fail designations from
affected tests.

Differential Revision: https://phabricator.services.mozilla.com/D208687
2024-04-30 00:35: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
Nathan LaPre
eb1c2ab82d Bug 1877811: Maybe create SVG accessible in display:contents contexts, r=Jamie
Since SVG elements aren't in a markup map, Gecko doesn't check for them when
searching markup maps while determining whether to create an accessible in
display:contents contexts. This revision addresses the problem by factoring out
the SVG creation code and using it in two places - newly in the dislay:contents
code. This revision also removes expected failures from relevant web platform
tests.

Differential Revision: https://phabricator.services.mozilla.com/D207943
2024-04-23 02:42:59 +00:00
Nika Layzell
1b28f9f085 Bug 1875528 - Part 1: Make IProtocol hold a strong reference to manager, r=ipc-reviewers,mccr8
This makes accessing `Manager()` on an IPDL protocol safer, and replaces the
previous ActorLifecycleProxy reference, which would only keep the manager alive
until IPDL drops its reference.

Unfortunately this introduces some leaks due to reference cycles, which will be
fixed in follow-up parts.

Differential Revision: https://phabricator.services.mozilla.com/D198624
2024-04-22 17:13:22 +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
Thomas Wisniewski
8b3a691117 Bug 1892349 - add doc-pageheader and doc-pagefooter ARIA DPUB roles, and have all DPUB roles return the expected computed rule; r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D207946
2024-04-19 04:23:25 +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
ef39891ee4 Bug 1888649: Tweak the assertion when we can't get the parent DocAccessible in CreateDocOrRootAccessible to allow background extension pages. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D207497
2024-04-17 22:53:27 +00:00
Natalia Csoregi
df9e767660 Backed out 2 changesets (bug 1888310, bug 1884625) for causing failures on browser_app.js. CLOSED TREE
Backed out changeset 8036a50c0751 (bug 1884625)
Backed out changeset 8c8df548d15d (bug 1888310)
2024-04-17 22:37:32 +03:00
Morgan Rae Reschenberg
97e92caade Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-04-17 18:20:48 +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
869842129f Bug 1887788 part 1: Add Accessible::DOMNodeClass to get the DOM class without all the other work in Accessible::Attributes. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D207512
2024-04-17 03:32:16 +00:00