3938 Commits

Author SHA1 Message Date
Morgan Rae Reschenberg
48ff0757ca Bug 1990785: Verify text attributes exist before adding to them r=Jamie, a=RyanVM DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D266937
2025-10-03 01:41:15 +00:00
Eitan Isaacson
a5ebf1856c Bug 1975696 - Revert suppression of AXTitle introduced in bug 1901324. r=Jamie a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D261165

Differential Revision: https://phabricator.services.mozilla.com/D261203
2025-08-23 00:27:18 +00:00
Eitan Isaacson
c288da1122 Bug 1968956 - Use await when waiting for cache in browser_invalid.js. r=morgan a=test-only
Differential Revision: https://phabricator.services.mozilla.com/D253379
2025-07-12 13:54:17 +00:00
James Teh
4f6ac0b0d5 Bug 1971642: When falling back to the next valid ARIA role, use a case insensitive comparison when skipping roles. a=dmeehan
We assume ARIA roles are case insensitive when setting up the role map entry.
In contrast, previously, when falling back to the next valid role due to the criteria for an earlier role not being met, we were using a case sensitive comparison.
This resulted in infinite recursion when an invalid role contained upper case characters because we kept trying to process the ARIA role we were already processing.
To fix this, use a case sensitive comparison here, making it consistent with other ARIA role checks.

Original Revision: https://phabricator.services.mozilla.com/D253617

Differential Revision: https://phabricator.services.mozilla.com/D253753
2025-06-16 00:16:07 +00:00
Morgan Rae Reschenberg
889171cae3 Bug 1968547: Add test to verify no error message event is fired when aria-invalid=false r=Jamie a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D253399
2025-06-12 21:45:22 +00:00
Mark Banner
0dae27506b Bug 1881701 - Change new .eslintrc.mjs files to modules (misc), and export as flat config. r=frontend-codestyle-reviewers,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,devtools-reviewers,sync-reviewers,android-reviewers,mossop,spidermonkey-reviewers,Gijs,ohall,whimboo,nchevobbe,arai,sparky,skhamis,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D249951
2025-05-24 17:11:10 +00:00
Mark Banner
d7c7c5369b Bug 1881701 - Rename many ESLint files to use .mjs. r=frontend-codestyle-reviewers,perftest-reviewers,Gijs,sparky,webcompat-reviewers,twisniewski
This is separate to help preserve history of the files.

Differential Revision: https://phabricator.services.mozilla.com/D249945
2025-05-24 17:10:51 +00:00
Serban Stanca
254eb70a9d Revert "Bug 1899960 - P2: Imply an unavailable state if focusable is in unavailable subtree. r=Jamie" for casuing junit failures.
This reverts commit 5906bff6eb.

This reverts commit f491f2de6e.

This reverts commit 047d7acfa2.
2025-05-23 22:39:55 +00:00
Boris Chiou
20bcd70f17 Bug 1968217 - Fix the typo of the preference name of view transition. r=layout-reviewers,TYLin
Just a quick fix because I used the wrong preference name in the a11y test.

Differential Revision: https://phabricator.services.mozilla.com/D251037
2025-05-23 19:17:15 +00:00
Eitan Isaacson
5906bff6eb Bug 1899960 - P2: Imply an unavailable state if focusable is in unavailable subtree. r=Jamie
I decided not to use aria-disabled directly because we currently don't
cache it in the parent, and I don't think the benefit would be great
enough.

Differential Revision: https://phabricator.services.mozilla.com/D250357
2025-05-23 19:09:23 +00:00
Eitan Isaacson
047d7acfa2 Bug 1967813 - Check menu's frame IsOpen to determine if menu is active. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D250492
2025-05-23 19:09:16 +00:00
Boris Chiou
b628cb1e09 Bug 1922301 - Add test to make sure the view transition tree is not exposed to the accessibility tree. r=morgan,view-transitions-reviewers,emilio
We don't expose the view transition tree to the accessibility tree per
our current implementation, so only a test in this patch.

In the test, we shouldn't see any view transition pseudo-elements in the
accessibility tree.

Differential Revision: https://phabricator.services.mozilla.com/D250840
2025-05-23 01:29:02 +00:00
Atila Butkovits
f645ec7ded Revert "Bug 1899960 - P2: Imply an unavailable state if focusable is in unavailable subtree. r=Jamie" for causing Geckoview failures.
This reverts commit d4794289e7.

Revert "Bug 1899960 - P1: Don't cache implicit states. r=Jamie"

This reverts commit dd5d2cd561.

Revert "Bug 1967813 - Check menu's frame IsOpen to determine if menu is active. r=morgan"

This reverts commit 2d6a0f17e3.
2025-05-22 23:36:44 +00:00
Eitan Isaacson
d4794289e7 Bug 1899960 - P2: Imply an unavailable state if focusable is in unavailable subtree. r=Jamie
I decided not to use aria-disabled directly because we currently don't
cache it in the parent, and I don't think the benefit would be great
enough.

Differential Revision: https://phabricator.services.mozilla.com/D250357
2025-05-22 20:15:23 +00:00
Eitan Isaacson
2d6a0f17e3 Bug 1967813 - Check menu's frame IsOpen to determine if menu is active. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D250492
2025-05-22 20:15:16 +00:00
Mikhail Galanin
921153b34f Bug 1625915 - Expose validation error message via AXValidationError. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D214679
2025-05-22 18:19:40 +00:00
James Teh
eff6d5c17a Bug 360003: Add a test for character bounds of list item bullets. r=morgan
This was fixed in bug 1951833.

Differential Revision: https://phabricator.services.mozilla.com/D249711
2025-05-22 13:04:45 +00:00
James Teh
1b591364ab Bug 1951833 part 2: Make ITextRangeProvider::GetBoundingRectangles return a rectangle for a collapsed range. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D249710
2025-05-20 23:01:23 +00:00
James Teh
f66cf4466a Bug 1951833 part 1: Support line feed characters in TextLeafPoint::CharBounds. r=morgan
Previously, both literal line feed characters in pre-formatted text and HTMl <br> elements returned a rect with 0 width and/or height.
Because of the way CharBounds() was implemented, this also returned 0 for x and y.
This caused problems for clients such as Windows Text Cursor Indicator which need the rectangle for the character at the caret.
Now, we return the correct x and y coordinates.
We also return a minimum width and height of 1 to ensure clients treat it as an actual rectangle.

As part of this, CharBounds() has been refactored slightly for consistency and readability.
As a bonus, this also fixes character bounds for list item bullets (bug 360003), but a test for that will be added in a subsequent patch.

This patch also removes the special case line feed code added to TextLeafRange::WalkLineRects() in bug 1946552, since CharBounds() now handles this.

Differential Revision: https://phabricator.services.mozilla.com/D249709
2025-05-20 23:01:19 +00:00
Morgan Rae Reschenberg
9c1c6ef7b9 Bug 1966243: Expose states::INVALID via moxInvalid in mozAccessible r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D249460
2025-05-20 17:52:04 +00:00
Eitan Isaacson
77a5fc0c85 Bug 1867044 - Fire name change for xul labels. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D248979
2025-05-15 19:18:00 +00:00
Mark Banner
46ce829d46 Bug 1964677 - Make UrlbarProvider.isActive consistently async for inheritance consistency. r=urlbar-reviewers,jteow
Differential Revision: https://phabricator.services.mozilla.com/D247923
2025-05-15 10:40:33 +00:00
James Teh
1276a883d6 Bug 1965405: When reconstituting a TextLeafRange for a UiaTextRange, restrict offsets to the current lengths of Accessibles. r=morgan
This is the scenario for this bug:

1. A UIA client retrieved a range for the caret at the end of a text input at the end of a document, collapsed at (input, 2).
2. Backspace was pressed, removing the last character, so (input, 2) was no longer valid.
3. The UIA client attempted to call GetAttributeValue on the previously fetched range.
4. FindTextAttrsStart couldn't move further, so it returned the document end point, (input, 1).
5. Because the range contained (input, 2), the search point was never less than the end point, so we got stuck in an infinite loop in GetAttributeValue.

To fix this, UiaTextRange now restricts offsets to the length of the leaf Accessibles when reconstructing the TextLeafRange.

Differential Revision: https://phabricator.services.mozilla.com/D248734
2025-05-13 04:05:58 +00:00
James Teh
7932ffe32b Bug 1963996: Clear the selection if IAccessibleTextSelectionContainer::setSelections is called with nSelections set to 0. r=eeejay
I removed this behaviour in bug 1951573.
Unfortunately, it turns out that contrary to the spec (which says "1 or more selections"), NVDA depends on this behaviour.
Reinstate this by supporting kRemoveAllExistingSelectedRanges in HyperTextAccessibleBase::RemoveFromSelection and using that.

Differential Revision: https://phabricator.services.mozilla.com/D247875
2025-05-08 06:52:14 +00:00
James Teh
c1029be8ea Bug 1869971: When calculating a DOM point for the end of a non-text node, use the child index for the node after that node. r=eeejay
A TextLeafPoint is always a leaf Accessible and an offset within that Accessible.
When a TextLeafPoint is created for the end of a container and the last Accessible in the container isn't text (e.g. it is an image), TextLeafPoint represents this as offset 1 within the image.
When calculating a DOM point for such a TextLeafPoint, we need to use the child index for the next DOM node.
This indicates to DOM that the point should be positioned after the node.

Differential Revision: https://phabricator.services.mozilla.com/D247874
2025-05-07 04:30:12 +00:00
James Teh
123bc5b115 Bug 1869966 part 3: When calculating a DOM point from a TextLeafPoint for a non-text node, use the child index within the parent, not an offset within the node itself. r=eeejay
For text nodes, DOM points use the character offset within the node itself, just like accessibility does.
For non-text nodes, DOM points use the child index within the parent to specify the position before or after the node.
Previously, TextLeafPoint::ToDOMPoint always used an offset within the node itself.
This meant that when the (exclusive) end point of a range was an image, we converted to a DOM point of offset 0 within the image.
As far as DOM is concerned, this includes the image.
This patch adjusts ToDOMPoint as appropriate.

As part of this, ToDOMPoint now returns a uint32_t instead of an int32_t.
This is because DOM offsets are actually uint32_t and calculating int32_t child indices is deprecated.

Differential Revision: https://phabricator.services.mozilla.com/D247873
2025-05-06 23:12:52 +00:00
James Teh
5c140ae138 Bug 1869966 part 2: Do not descend to the end of an embedded object when calculating a TextLeafPoint for the end of an IA2 selection. r=eeejay
When we descend to the end for an embedded object character, we get the position after the last character inside that embedded object.
This isn't what we want for selections because the end offset should be exclusive, not inclusive.
Descending to the end means we include the entire content of the embedded object instead of excluding it.
Instead, always descend to the start.

Differential Revision: https://phabricator.services.mozilla.com/D247872
2025-05-06 23:12:48 +00:00
James Teh
7f3da64a12 Bug 1869966 part 1: Add tests for existing IAccessibleSelectionContainer behaviour. r=eeejay
We did have support for IA2 testing when this was added.
However, because this interface is a relatively recent addition to the IA2 spec, it isn't included in the COM proxy dll included in Windows.
This means we can't run these tests without building and installing our own proxy DLL.
This has to be integrated into the Windows CI images, so we can't run these tests on CI for now and thus they're disabled on CI.
Even so, it's better to have local-only tests for this than no tests at all.

Differential Revision: https://phabricator.services.mozilla.com/D247871
2025-05-06 23:12:45 +00:00
Eitan Isaacson
052a96baee Bug 1901324 - Don't give accessibles AXTitle if they have a labelling relation. r=morgan
This is a bit risky, but I hope worthwhile.

I also changed the single labelling relation check in moxTitle and moxLabel to not allocate an NSArray.

Differential Revision: https://phabricator.services.mozilla.com/D247369
2025-05-06 22:11:11 +00:00
Eitan Isaacson
3872b9b621 Bug 1880533 - Update name when hidden text changes in aria-labelledby. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D247808
2025-05-06 08:25:41 +00:00
James Teh
fdf464542a Bug 1962317: Initial framework for accessibility engine performance testing, plus some initial tests. r=morgan
Tests go in accessible/tests/browser/performance.
They use the usual addAccessibleTask function to add a test.
Inside the task, they can time operations using the timeThis() function, which takes a name and a function to time.
As well as logging the time, this also logs all accessibility PerfStats captured during the function.
For now, output is simply logged using info().
In future, we may wish to output this data elsewhere; e.g. so it can be picked up by performance monitoring tools.
Having this single function should make extending this fairly easy without needing to rewrite tests.

Two initial tests have been included:
- browser_manyMutations.js: Test for bug 1948375.
- browser_spellingErrors.js: Test for bug 1961832.

Differential Revision: https://phabricator.services.mozilla.com/D246544
2025-04-30 04:06:36 +00:00
Eitan Isaacson
18c81c366f Bug 1467382 - Support aria-keyshortcuts. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D246695
2025-04-29 16:42:31 +00:00
Stanca Serban
430ce50b99 Backed out changeset ab60f9ab2024 (bug 1962317) for causing Linux mochitests failures in PerfStats.cpp. 2025-04-29 07:30:25 +03:00
James Teh
64fb4d889f Bug 1962317: Initial framework for accessibility engine performance testing, plus some initial tests. r=morgan
Tests go in accessible/tests/browser/performance.
They use the usual addAccessibleTask function to add a test.
Inside the task, they can time operations using the timeThis() function, which takes a name and a function to time.
As well as logging the time, this also logs all accessibility PerfStats captured during the function.
For now, output is simply logged using info().
In future, we may wish to output this data elsewhere; e.g. so it can be picked up by performance monitoring tools.
Having this single function should make extending this fairly easy without needing to rewrite tests.

Two initial tests have been included:
- browser_manyMutations.js: Test for bug 1948375.
- browser_spellingErrors.js: Test for bug 1961832.

Differential Revision: https://phabricator.services.mozilla.com/D246544
2025-04-28 22:42:59 +00:00
Morgan Rae Reschenberg
65889d32d2 Bug 1960416: Skip aria-hidden subtrees during initial tree creation when aria-hidden is specified on the root element r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D246057
2025-04-24 22:15:41 +00:00
Emilio Cobos Álvarez
5d8a203f5c Bug 1961534 - Call IMEStateManager::OnChangeFocus from nsFocusManager::FixUpFocusAfterFrameLoaderChange. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D246280
2025-04-23 11:45:00 +00:00
Butkovits Atila
5f164c40f8 Backed out changeset f7afd5cab91c (bug 1960416) for causing bustages at TreeWalker.cpp. 2025-04-23 04:20:06 +03:00
Eitan Isaacson
5e15843b04 Bug 1838502 - Don't expose a title for labels. r=morgan
THis is what VO expects, we apparently knew that but decided it wasn't worth fixing in the past

Differential Revision: https://phabricator.services.mozilla.com/D244050
2025-04-22 22:07:02 +00:00
Morgan Rae Reschenberg
d2bdb27faa Bug 1960416: Skip aria-hidden subtrees during initial tree creation when aria-hidden is specified on the root element r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D246057
2025-04-22 21:18:02 +00:00
Joel Maher
397e8ec3f4 Bug 1961608 - Green up macosx 15.30. r=aryx,necko-reviewers,extension-reviewers,media-playback-reviewers,credential-management-reviewers,sync-reviewers,anti-tracking-reviewers,sessionstore-reviewers,places-reviewers,omc-reviewers,profiles-reviewers,pdahiya,alwu,jhirsch,mtigley,skhamis,timhuang,valentin,robwu,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D246100
2025-04-22 18:12:28 +00:00
Masayuki Nakano
7aaca7360c Bug 1960558 - Get rid of dom.element.contenteditable.plaintext-only.enabled pref r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D245660
2025-04-17 08:30:29 +00:00
James Teh
60478f204d Bug 1960347: Expose document URL via the UIA Value pattern. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D245531
2025-04-16 01:08:01 +00:00
Morgan Rae Reschenberg
9384c6696d Bug 1880578: Ignore aria-hidden when applied to root document elements and root svg elements r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D243394
2025-04-15 21:34:59 +00:00
Morgan Rae Reschenberg
9798f502e1 Bug 1960045: Modify shared-head.js to use hidden instead of aria-hidden for contentSetup r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D245321
2025-04-15 21:34:59 +00:00
Rob Wu
62248a8bcc Bug 1953004 - Run test-manifest-toml --fix on all toml files in the trees r=credential-management-reviewers,places-reviewers,desktop-theme-reviewers,Standard8,devtools-reviewers,hjones,jmaher,jdescottes,dimi,necko-reviewers,sidebar-reviewers,jsudiaman,kershaw
This diff was generated as follows:

List all toml files in the tree:

`find * -name '*.toml' > /tmp/toml`

Manually edited /tmp/toml to drop non-relevant entries (objdir).

Ran the toml linter for all files:

`cat /tmp/toml | xargs ./mach lint -l test-manifest-toml --fix`

Differential Revision: https://phabricator.services.mozilla.com/D240948
2025-04-14 08:30:13 +00:00
Alex Hochheiden
c1e140fe43 Bug 1715287 - [lint] Fix pyupgrade lint errors from new configuration r=linter-reviewers,webdriver-reviewers,taskgraph-reviewers,ahal,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D245269
2025-04-13 17:48:23 +00:00
James Teh
b91f768a81 Bug 1700362: Don't check whether the parent DocAccessible is loading when determining whether to fire doc load events. r=morgan
This code has been broken in content processes since e10s; i.e. we currently fire doc load complete events for iframes, even if the parent doc is still loading.
Rather than returning to the pre-e10s behaviour, this check has been removed instead for several reasons:

1. Mac wants AXLayoutComplete to be fired on iframes and we map that from doc load complete.
2. We've been doing this since e10s (3+ years) and it doesn't seem to have hurt any screen readers, so presumably, this has been fixed in screen readers.
3. This check can never work for OOP (Fission) iframes, since the parent document is in a different process and we thus can't query its loading state.
4. The behaviour is currently inconsistent between parent process documents and content process documents. Removing this check makes it consistent.

Differential Revision: https://phabricator.services.mozilla.com/D109582
2025-04-11 06:23:52 +00:00
James Teh
a40b16b3b2 Bug 1700546: Fire a reorder event when a top level remote document is added. r=morgan
When a local document is added, we fire a reorder event in DocAccessible::DoInitialUpdate.
This doesn't work for top level documents in remote content processes because the embedder (OuterDocAccessible) is in a different process.
We already handled this for out-of-process iframe documents in DocAccessibleChild::AddChildDoc.
However, there was no code to do this for a top level remote document.
This wasn't a problem for users for normal browser tabs, since clients only interact with the document when it gets focus.
It was problematic for <browser> elements embedded in a parent process content document, since some clients need the event in order to pick up the embedded content.
Therefore, we now fire this event in DocManager::RemoteDocAdded.

This patch re-enables browser_test_docload.js, which is intended to test this.
This test was ported in bug 1376857 before we shipped e10s.
It didn't work with e10s at the time, so it was disabled there, but this was never fixed.
That meant that once e10s shipped, this test was disabled completely.

I had to change the test's expectations slightly, since we do fire document load complete and state change events for remote iframe documents, but the test asserted that we don't.
Although we originally didn't fire these events many years ago, this has been broken for a long time now and it doesn't really make sense to reinstate that behaviour; see bug 1700362.

Differential Revision: https://phabricator.services.mozilla.com/D244687
2025-04-10 00:53:14 +00:00
James Teh
dc02759a3b Bug 1926541 part 2: Change the getAccessibleDOMNodeID test harness functions to simply use the id property. r=morgan
This keeps id retrieval code in one place: the accessibility engine.
It thus fixes some edge cases that were previously broken; e.g. SVG documents.
It would have been nice to remove these functions altogether and have everything use the id property directly.
Unfortunately, some code depends on getAccessibleDOMNodeID returning null when an accessible has died, rather than throwing an exception.
Changing all the impacted callers to catch exceptions is a bit ugly, but having the XPCOM function just return null itself in this case seemed like hiding reality.
This way, callers have a choice: they can use the id property directly if they care about the failure case (or if the failure case isn't relevant for their use case), or they can call getAccessibleDOMNodeID if they explicitly want to ignore the failure.

It turns out that some tests were unwittingly relying on the nsIAccessibleDocument interface having been queried on the document accessible by getAccessibleDOMNodeID when waiting for the doc load complete event.
To fix this, the harness now explicitly queries for nsIAccessibleDocument before passing the document to test tasks.

Differential Revision: https://phabricator.services.mozilla.com/D244708
2025-04-10 00:41:26 +00:00
Morgan Rae Reschenberg
6624e11c63 Bug 1549202: Ensure ContentSelectDropdown local accessibles return the focused <select> remote accessible as their parent r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D243029
2025-04-09 23:51:27 +00:00