Commit Graph

10214 Commits

Author SHA1 Message Date
Morgan Rae Reschenberg
b3214f51b9 Bug 1752054: Map radio and checkbox menu items to MOX classes for radio buttons and checkboxes r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D162170
2022-11-16 18:18:54 +00:00
Emilio Cobos Álvarez
9ae8258a6e Bug 1799460 - a11y fixes for my previous changes. r=Jamie
The button tweak is needed because now if you have:

  <button>
    <label value="foo">
  </button>

There is a text node for the value (generated content), and the <button>
shouldn't steal it.

I was getting crashes without it because XULButtonAccessible isn't
hypertext (so I wonder if the IsText() code-path can even be reached?).

Same issue with XULComboboxAccessible, fixed the same way by preventing
text there (preserving behavior).

Setting crop="center" now reframes, so test_label needs to change.

Differential Revision: https://phabricator.services.mozilla.com/D162011
2022-11-16 16:27:59 +00:00
Paul Bone
949432f9a7 Bug 1800582 - Trace mAccessibles rather than mChildren r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162080
2022-11-16 09:55:28 +00:00
Paul Bone
712a94ff1f Bug 1800582 - Don't count atoms in the a11y cache r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162079
2022-11-16 09:55:27 +00:00
Morgan Rae Reschenberg
46439cea0c Bug 1774330: Only return ancestors from ChildAtPoint r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D160849
2022-11-15 19:30:12 +00:00
James Teh
2802599def Bug 1800048: Don't expose the LINKS_TO relation via ATK and IA2. r=morgan
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.

Differential Revision: https://phabricator.services.mozilla.com/D161775
2022-11-15 06:46:24 +00:00
Michael Comella
7cbe6a2464 Bug 1797863 - add class documentation for accessibility tree nodes. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D160583
2022-11-15 02:49:44 +00:00
Iulian Moraru
5563067d62 Backed out 3 changesets (bug 1796734) for causing multiple Accessible related test crashes. CLOSED TREE
Backed out changeset 871e7fe357a6 (bug 1796734)
Backed out changeset 01e00626303a (bug 1796734)
Backed out changeset cfb43833d08b (bug 1796734)
2022-11-15 04:10:02 +02:00
James Teh
a1987e0653 Bug 1796734 part 3: Move calculation of the focused state to Accessible::ApplyImplicitState. r=morgan
The code which calculated the focused state in RemoteAccessibleBase was incorrect.
It used the focused BrowserParent rather than the focused BrowsingContext to determine if the document was focused, which meant it treated a top level document as focused even when an embedded in-process iframe had focus.
FocusManager::FocusedAccessible (and now FocusManager::IsFocused) do the right thing, so we can use IsFocused instead.
LocalAccessible already used IsFocused to calculate the focused state.
Since both local and remote both now do the same thing, we can move this into Accessible::ApplyImplicitState.

Differential Revision: https://phabricator.services.mozilla.com/D161876
2022-11-15 01:30:01 +00:00
James Teh
6aab52e83b Bug 1796734 part 2: Unify FocusManager::IsFocused so it can support RemoteAccessible. r=morgan
Previously, IsFocused had a separate implementation instead of just using FocusedAccessible because of cases years ago where it would unintentionally cause us to create a DocAccessible for an initial about:blank document.
As far as I can tell, we no longer prevent creation of DocAccessibles for initial documents because they aren't necessarily temporary documents.
Therefore, we can just compare against FocusedAccessible now.
Since FocusedAccessible is already unified, this makes unifying IsFocused very simple.
This paves the way for unifying correct calculation of the focused state.

Differential Revision: https://phabricator.services.mozilla.com/D161875
2022-11-15 01:30:00 +00:00
James Teh
ef805911c0 Bug 1796734 part 1: Clear FocusManager's active item if an Accessible is still focused while the document is shutting down. r=eeejay
See the code comment for further details.
In subsequent patches, IsFocused is refactored to call FocusedAccessible, which asserts that mActiveItem is not defunct.
Without this active item fix, that change would cause accessible/tests/mochitest/actions/test_keys.xhtml to assert.

Differential Revision: https://phabricator.services.mozilla.com/D161887
2022-11-15 01:30:00 +00:00
Eitan Isaacson
d2a883bac9 Bug 1800555 - Remove 471493.xhtml crash test. r=Jamie
It already has a mochitest and is probably old enough that we don't need
it. Loading XUL in content with e10s enabled is not something our cache
is prepared for yet.

Differential Revision: https://phabricator.services.mozilla.com/D162057
2022-11-15 01:20:17 +00:00
James Teh
2d2bef0c6a Bug 1789239: Expose the id object attribute for cached RemoteAccessible. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D161874
2022-11-14 23:29:47 +00:00
James Teh
f520d4fa05 Bug 1789959: Gracefully handle mCachedFields being null in xpcAccessible::GetCache. r=nlapre
Otherwise, we crash when inspecting RemoteAccessible objects in Dev Tools if the cache is disabled or hasn't been received yet.

Differential Revision: https://phabricator.services.mozilla.com/D161872
2022-11-14 23:29:07 +00:00
James Teh
8fa2bf084a Bug 1789384: Don't ascend past documents in Accessible::GetLevel. r=eeejay
On Android, we access RemoteAccessibles from the UI thread.
It's not safe to access LocalAccessibles on the UI thread.
The a11y code avoids touching LocalAccessibles on the UI thread directly.
However, Accessible::GetLevel was previously walking ancestry, which might hit a LocalAccessible and result in a crash.
To avoid this, don't ascend past a DocAccessible.
Level calculation shouldn't be crossing document boundaries anyway.
Note that we don't have to do this when we simply retrieve the parent (but nothing further) because we only do that for certain roles and the parent of these roles could never be an OuterDoc.

Differential Revision: https://phabricator.services.mozilla.com/D161873
2022-11-14 23:04:44 +00:00
Eitan Isaacson
5781216c9b Bug 1800399 - Disable spell check browser test. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161968
2022-11-14 17:19:23 +00:00
Ting-Yu Lin
5a69e0e771 Bug 1799732 Part 1 - Replace GetChildList(kPrincipalList) with PrincipalChildList(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161862
2022-11-12 04:38:52 +00:00
Noemi Erli
7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
15dcf36084 Bug 1799732 Part 1 - Replace GetChildList(kPrincipalList) with PrincipalChildList(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161862
2022-11-11 23:44:16 +00:00
Butkovits Atila
ac79dbae6a Backed out 2 changesets (bug 1800048) for causing failures at browser_caching_relations_002.js. CLOSED TREE
Backed out changeset 9d0e9bd86e73 (bug 1800048)
Backed out changeset 59b83f2de870 (bug 1800048)
2022-11-11 16:30:38 +02:00
Butkovits Atila
1f29d57e14 Bug 1800048 - Lint fix. a=fix 2022-11-11 12:56:24 +02:00
James Teh
99e5d6af82 Bug 1800048: Don't expose the LINKS_TO relation via ATK and IA2. r=morgan
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.

Differential Revision: https://phabricator.services.mozilla.com/D161775
2022-11-11 10:13:27 +00:00
Marian-Vasile Laza
99789d1ff6 Backed out changeset 09fb44f9d0b4 (bug 1800048) for causing mochitest failures on browser_caching_relations.js. CLOSED TREE 2022-11-11 07:27:50 +02:00
Morgan Rae Reschenberg
1d82cef271 Bug 1800060: Avoid computing LINKS_TO for links with no anchor r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161826
2022-11-11 00:03:29 +00:00
Morgan Rae Reschenberg
19483cce77 Bug 1798950: Only trim titles that are entirely whitespace r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D161746
2022-11-11 00:02:42 +00:00
James Teh
be7e6f1f99 Bug 1800048: Don't expose the LINKS_TO relation via ATK and IA2. r=morgan
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.

Differential Revision: https://phabricator.services.mozilla.com/D161775
2022-11-10 23:27:07 +00:00
James Teh
9246db7861 Bug 1798614 follow-up: Don't send DeleteEntry on initial cache updates for opacity and table cell headers. r=morgan
The primary intent of the first patch here was to avoid memory wasted by caching default opacity values.
Unfortunately, this was defeated by the fact that we previously sent DeleteEntry for initial cache updates of opacity.
This resulted in DeleteEntry being stored in the parent process cache, since DeleteEntry is only handled specially for cache updates, not initial pushes.
We now only send DeleteEntry for cache updates, which is consistent with what we do for other cache attributes.
While fixing this, I discovered that we made the same mistake for table cell headers, so I fixed that as well.

Differential Revision: https://phabricator.services.mozilla.com/D161760
2022-11-10 23:26:21 +00:00
Marian-Vasile Laza
14b3f8230f Backed out changeset 8003d7c416e1 (bug 1798950) for causing mochitest failures on browser_text_leaf.js. CLOSED TREE 2022-11-10 22:49:02 +02:00
Morgan Rae Reschenberg
a068f49437 Bug 1799578: Compute relative offsets for continuations to avoid double counting padding when computing CharBounds r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161736
2022-11-10 19:12:54 +00:00
Morgan Rae Reschenberg
931bfe31d9 Bug 1798950: Only trim titles that are entirely whitespace r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D161746
2022-11-10 19:00:57 +00:00
James Teh
0450470092 Bug 1798614: Assume a default of 1.0 for Accessible::Opacity unless otherwise explicitly specified. r=morgan,eeejay
Previously, it was possible to have no value, but only for Accessibles without frames.
That effectively means display: contents, and since the content is visible (even though the element itself doesn't have a box), exposing it as non-opaque isn't important and arguably doesn't make sense.
This way, we avoid awastefully caching 1.0 for the vast majority of Accessibles.

Differential Revision: https://phabricator.services.mozilla.com/D161005
2022-11-10 04:19:29 +00:00
James Teh
6c51315821 Bug 1765217: Move OPAQUE1 state calculation into Accessible::ApplyImplicitState. r=morgan
This state is derived based on Accessible::Opacity, which is implemented for both local and remote Accessibles.
Thus, we can use common code to calculate this state.
As part of this, OPAQUE1 was added to kRemoteCalculatedStates so that it isn't included in the initial cache push, which also means we don't have to remove it later.

This patch also tweaks the test to flush layout so that the opacity change takes effect immediately in that process.
This is necessary to avoid a (graceful) timeout in untilCacheOk for non-caching tests, since there is no cache update to make untilCacheOk return before the timeout.

Differential Revision: https://phabricator.services.mozilla.com/D161004
2022-11-10 04:19:29 +00:00
James Teh
7cb59989fb Bug 1796733 part 8: Expose the implicit selected state on cached remote ARIA items when appropriate. r=morgan
This unifies and moves the existing logic from LocalAccessible::State to Accessible::ApplyImplicitState so it can be used for both local and remote Accessibles.

Differential Revision: https://phabricator.services.mozilla.com/D160884
2022-11-10 04:19:29 +00:00
James Teh
338a2a3e8d Bug 1796733 part 7: Add Accessible::ApplyImplicitState. r=morgan
This gives us a place to put state calculation code common to both local and remote Accessibles.
It will be used to unify the implicit selected state in the next patch, among other things.

Differential Revision: https://phabricator.services.mozilla.com/D160883
2022-11-10 04:19:28 +00:00
James Teh
526470477a Bug 1796733 part 6: Add Accessible::ARIASelected and support it for cached RemoteAccessibles. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D160882
2022-11-10 04:19:28 +00:00
James Teh
78587c97ba Bug 1796733 part 5: Add an overload of nsAccUtils::NormalizeARIAToken which takes an Element. r=avandolder
The next patch in this stack adds a method to retrieve aria-selected.
The easiest way to do this is using NormalizeARIAToken.
This overload takes an Element and checks both the Element and ElementInternals.

Differential Revision: https://phabricator.services.mozilla.com/D161241
2022-11-10 04:19:27 +00:00
James Teh
89c3a37a29 Bug 1796733 part 4: Unify nsAccUtils::GetSelectableContainer. r=morgan
We need this to unify support for the implicit selected state on ARIA items.

Differential Revision: https://phabricator.services.mozilla.com/D160881
2022-11-10 04:19:27 +00:00
James Teh
e5e1d90c3b Bug 1796733 part 3: Unify FocusManager::IsFocusWithin. r=morgan
We need this to unify support for the implicit selected state on ARIA items.

Differential Revision: https://phabricator.services.mozilla.com/D160880
2022-11-10 04:19:27 +00:00
James Teh
b1d08576eb Bug 1796733 part 2: Add unified FocusManager::FocusedAccessible. r=morgan
This moves the unified focus logic from DocAccessible::FocusedChild to FocusManager.
This is needed in order to support a unified IsFocusWithin method.

Differential Revision: https://phabricator.services.mozilla.com/D160879
2022-11-10 04:19:26 +00:00
James Teh
77dc8b7905 Bug 1796733 part 1: Rename FocusManager::FocusedAccessible to FocusedLocalAccessible. r=morgan
This is in preparation for a unified FocusedAccessible method which can handle both local and remote.

Differential Revision: https://phabricator.services.mozilla.com/D160878
2022-11-10 04:19:26 +00:00
Emilio Cobos Álvarez
ccf616b673 Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 20:38:04 +00:00
Nathan LaPre
ce54599766 Bug 1748585: Remove img elements with alt="" from the a11y tree, r=Jamie
This revision changes the logic for creation and updating of accessibles
corresponding to elements that produce image accessibles, such that alt=""
(without click listeners or any other aria attributes that force an accessible)
will effectively remove that element's accessible from the accessibility tree.
Next, this revision removes the concept of eNoNameOnPurpose from accessible name
handling, since it's now unnecessary now that alt="" means "don't create an
accessible" in most cases. This revision also adds tests to verify the
functionality and updates existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D160706
2022-11-09 20:05:01 +00:00
Csoregi Natalia
9d2ea21e26 Backed out 3 changesets (bug 1799343, bug 1799580) for causing failures on /browser_history_after_appMenu.js. CLOSED TREE
Backed out changeset 63c270ba91ad (bug 1799343)
Backed out changeset 713e6f0fbd20 (bug 1799580)
Backed out changeset 42d1b8742662 (bug 1799343)
2022-11-09 21:26:06 +02:00
Emilio Cobos Álvarez
5c5c337a98 Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 14:19:22 +00:00
Cristian Tuns
01dcbc81d3 Backed out 2 changesets (bug 1799580, bug 1799343) for causing mochitest failures on win7 CLOSED TREE
Backed out changeset fb0df93a4719 (bug 1799580)
Backed out changeset 493c9ca00c91 (bug 1799343)
2022-11-09 07:15:51 -05:00
Emilio Cobos Álvarez
b513d45bea Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 09:17:21 +00:00
Paul Bone
e9369d0301 Bug 1769688 - Add a memory reporter for the a11y cache r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161242
2022-11-09 06:29:42 +00:00
Morgan Rae Reschenberg
93144325ec Bug 1799204: Update cached layout_guess when relevant HTML attr changes are obseved r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161339
2022-11-08 21:52:48 +00:00
Stanca Serban
7e4d1c009a Backed out changeset 835a66221d99 (bug 1799204) for causing mochitests failures on browser_table.js.CLOSED TREE 2022-11-08 21:27:58 +02:00
Morgan Rae Reschenberg
e6edd38fd7 Bug 1799204: Update cached layout_guess when relevant HTML attr changes are obseved r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161339
2022-11-08 17:56:58 +00:00