Граф коммитов

1605 Коммитов

Автор SHA1 Сообщение Дата
Nathan LaPre 4e99c1bf21 Bug 1838752: Handle other event types in DropMutationEvent,r=eeejay
This revision updates DropMutationEvent such that it handles other event
types besides REORDER, HIDE, and SHOW. If we somehow put a different event
type through this function (particularly an inner reorder, which indicates
a reorder event that's already been dropped), we should (and now do) handle
it more gracefully.

Differential Revision: https://phabricator.services.mozilla.com/D182218
2023-06-28 19:14:55 +00:00
James Teh 983b81b013 Bug 1826194 part 2: When calculating a text equivalent, walk the flat tree instead of only direct children. r=morgan
Previously, when calculating a text equivalent by walking the DOM tree, we only walked direct children of a DOM node.
However, a slot element is a placeholder for content which comes from outside of a shadow root.
In order to include this content when a slot isn't accessible (e.g. because it is hidden), we need to walk the DOM flat tree instead.

Differential Revision: https://phabricator.services.mozilla.com/D181841
2023-06-28 01:18:18 +00:00
James Teh 33bfc9b615 Bug 1826194 part 1: When calculating a text equivalent, don't treat an element with display: contents as invisible. r=morgan
A slot element has display: contents by default.
Previously, when computing a text equivalent, we would ignore the accessibility subtree if there was no frame.
This made sense back when no frame always meant display: none, but now, it could also mean display: contents.
To fix this, just look at whether the DOM node has an Accessible; don't check visibility at all.
If something really is invisible (including visibility: invisible), it shouldn't be in the a11y tree anyway.

Note that even without this fix, we should have been able to get the text equivalent for a slot by falling back to walking the DOM tree instead of the a11y tree.
Unfortunately, that is also broken... but the next patch will fix it.

Differential Revision: https://phabricator.services.mozilla.com/D181840
2023-06-28 01:18:18 +00:00
Iulian Moraru 98478e7490 Backed out changeset f3095da827d9 (bug 1754905) for causing build bustages on DocAccessibleWrap. CLOSED TREE 2023-06-28 03:03:37 +03:00
Nathan LaPre f6bdc0682a Bug 1840253: Defend against NotifyOfAnchorJumpTo null pointer dereference, r=Jamie
This revision adds a check for null to the document variable in order to avoid
dereferencing it if it's null. This defends us against a crash we can observe
when the document isn't built yet or is hidden, in which case we can't handle
an anchor jump anyway. This revision also cleans up the function a bit by adding
an early null check on the documentNode variable.

Differential Revision: https://phabricator.services.mozilla.com/D182095
2023-06-27 17:43:58 +00:00
Eitan Isaacson 556fa1bfbb Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-27 16:59:54 +00:00
Butkovits Atila 9ac839ebe2 Backed out changeset 4d92a76cedd0 (bug 1754905) for causing bustages at LocalAccessible. CLOSED TREE 2023-06-27 03:46:47 +03:00
Eitan Isaacson 87391fa922 Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-27 00:05:16 +00:00
James Teh 65baf08086 Bug 1831035 part 7: Remove (now empty) platform specific RemoteAccessible classes and rename RemoteAccessibleBase to RemoteAccessible. r=eeejay
This involved moving ApplyCache from the .h into the .cpp because now that the class is no longer a template, forward declaration of DocAccessibleParent is not sufficient.

Differential Revision: https://phabricator.services.mozilla.com/D181852
2023-06-26 21:20:13 +00:00
Stanca Serban f0967c3305 Backed out changeset 8be4693aecbb (bug 1754905) for causing bustages in xpcAccessiblePivot.h. CLOSED TREE 2023-06-24 03:22:31 +03:00
Eitan Isaacson f872bcc7cc Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-23 23:22:34 +00:00
James Teh 00fb437d8e Bug 1838983: When dispatching a focus event, clear the stored active item if it is different to the target. r=eeejay
When the Accessible is recreated for the focused node, DocAccessible::CreateSubtree calls FocusManager::DispatchFocusEvent directly.
If FocusManager::mActiveItem was set, DispatchFocusEvent previously didn't clear it, even though DispatchFocusEvent was given a new target overriding mActiveItem.
This meant that the old mActiveItem would remain until it was next set or cleared, causing assertions if it died and potentially other problems.
To fix this, DispatchFocusEvent clears mActiveItem if it is different to the target, since the target should override.

Differential Revision: https://phabricator.services.mozilla.com/D181605
2023-06-23 22:56:19 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Nathan LaPre 04801901d1 Bug 1615972: Fire a scrolling start event for non-interactive targets, r=Jamie
This revision changes our focus event and anchor scroll handling to fire
scrolling start events for non-interactive targets, where "non-interactive" is
defined as "any generic, landmark, or region Accessible." This revision also
adds a test to verify that the scrolling start event is fired.

Differential Revision: https://phabricator.services.mozilla.com/D181329
2023-06-22 20:14:41 +00:00
Eitan Isaacson 4dce76304c Bug 1839515 - Remove pivot text navigation API. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181576
2023-06-21 21:15:47 +00:00
Norisz Fay f8505d5db9 Backed out changeset 8178c74a4c65 (bug 1839515) for causing mochitest failures on browser_events_vcchange.js 2023-06-21 22:21:29 +03:00
Eitan Isaacson da7273bd10 Bug 1839515 - Remove pivot text navigation API. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181576
2023-06-21 17:55:06 +00:00
Eitan Isaacson b3cea24dfd Bug 1834874 - P2: Remove DocAccessiblePlatformExt. r=Jamie,ipc-reviewers,mccr8
Since we removed the last dependency on this subprotocol, we can now
remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181321
2023-06-20 18:15:43 +00:00
Eitan Isaacson 85a5ad4790 Bug 1834874 - P1: Make text navigation work in UI thread with cached TextLeafPoint API. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D181320
2023-06-20 18:15:42 +00:00
Nathan LaPre 221859a0e6 Bug 1837315: Avoid queueing a hide event on an accessible that's already being moved, r=Jamie
If we move an accessible via an aria-owns relocation on a grandparent, then move
it again via an aria-owns relocation on a parent, we can end up with multiple
hide events in the queue: one for the shallowest hide (of the grandparent), and
one for the hide of the grandchild accessible. We can't always coalesce (drop)
the hide event of the grandchild since the first move severs the relationship
between its parent and its grandparent. To address this, this revision stops us
from queueing a hide event on an accessible that's already being moved. This
revision also adds a test to verify we're getting the proper events.

Differential Revision: https://phabricator.services.mozilla.com/D180888
2023-06-15 23:12:00 +00:00
James Teh 962a479c5c Bug 1728676: Correctly expose ARIA table cells in SVG. r=nlapre
Previously, the code to create ARIAGridCellAccessible only ran for HTML elements.
This meant that ARIA cells weren't exposed correctly in SVG.
This code has now been moved outside of the HTML check so that it works for SVG as well.

Differential Revision: https://phabricator.services.mozilla.com/D181077
2023-06-15 22:48:17 +00:00
James Teh 12e8d401f1 Bug 1838151: Remove unused a11y::filters::GetRow/GetCell. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D180784
2023-06-14 03:31:45 +00:00
James Teh 01d480b80d Bug 1837332: Remove unused HyperTextAccessible::EnclosingRange/VisibleRanges/RangeByChild/RangeAtPoint, TextRange::EmbeddedChildren/Text and xpcAccessibleTextRange::ScrollIntoView. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D180301
2023-06-14 00:43:11 +00:00
Nathan LaPre f20a8d8057 Bug 1723195: Allow intervening generic accessibles between table rows and cells, r=Jamie
This commit ensures that we get the proper non-generic parent when creating a
grid cell accessible. Before this patch, we wouldn't see this grid cell as a
grid cell accessible. This patch also adds a test for this case, along with a
test for a similar case that inserts a generic accessible between the table
itself and a rowgroup.

Differential Revision: https://phabricator.services.mozilla.com/D180393
2023-06-09 23:43:25 +00:00
Anna Yeddi c7d66d7729 Bug 1834931 - Map HTML <code> to roles::CODE. r=Jamie
Mapping HTML `<code>` and updating its corresponding tests and meta files.

Differential Revision: https://phabricator.services.mozilla.com/D179602
2023-06-08 13:38:15 +00:00
James Teh 7ae0834dd8 Bug 1832228 part 3: Rename TableAccessibleBase to TableAccessible and TableCellAccessibleBase to TableCellAccessible. r=nlapre
Now that the local-only TableAccessible and TableCellAccessible have been removed, we no longer need this Base suffix for the unified classes.
Aside from renaming the header files, most of the rest of this was done with the following script:

```
function replace {
  sed -i 's/'$1'/'$2'/g' `git grep -l $1`
}
replace TableAccessibleBase TableAccessible
replace TableCellAccessibleBase TableCellAccessible
replace AsTableBase AsTable
replace AsTableCellBase AsTableCell
```

Differential Revision: https://phabricator.services.mozilla.com/D179803
2023-06-08 09:50:28 +00:00
James Teh 220f6dfece Bug 1832228 part 1: Remove ARIAGridAccessible, ARIARowAccessible and most of ARIAGridCellAccessible. r=nlapre
We now use CachedTableAccessible for ARIA tables and grids, so most of the code in the ARIA table classes was unused.

1. Remove ARIAGridAccessible and ARIARowAccessible completely.
2. ARIAGridCellAccessible no longer derives from TableCellAccessible.
3. Remove most of ARIAGridCellAccessible.
4. We still use ARIAGridCellAccessible to differentiate between valid and invalid cells. Valid cells create an ARIAGridCellAccessible and ARIAGridCellAccessible::IsTableCell() returns true due to mGenericTypes. Invalid cells don't get an ARIAGridCellAccessible, so IsTableCell() returns false on those.
5. We also keep the code in ARIAGridCellAccessible to expose some states and attributes.
6. The code for creating ARIAGridCellAccessible in CreateAccessible has been refactored, both for simplification and to fix bugs. display: contents tables now properly get the table and table cell interfaces; i.e. IsTable() and IsTableCell() return true when appropriate. Walking non-generic ancestors should fix ARIA tables with intervening generics, though this will be dealt with fully in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D179801
2023-06-08 09:50:28 +00:00
James Teh 9ecdad92e8 Bug 1832261: Remove most of HTMLTable*Accessible. r=nlapre
We now use CachedTableAccessible for HTML tables, so much of the code in the HTMLTable*Accessible classes was unused.
However, we still depend on these classes for some data needed to build the cached table.

1. HTMLTableAccessible and HTMLTableCellAccessible no longer derive from TableAccessible and TableCellAccessible, respectively. Instead, callers which need specific access to HTML table data use the HTMLTable*Accessible class directly.
2. All table specific methods have been removed except those that provide data required to build a CachedTableAccessible. The remaining methods are those for querying the row/column span (which depends on layout) and getting the caption (which depends on DOM).
3. HTMLTable*Accessible are now used for all <table>, <td>, <th> and <tr> elements and MathML equivalents. ARIA*Accessible are never used for these elements. This improves consistency, simplifies the code and means that behavior specific to these HTML elements is handled in these classes, rather than in the ARIA classes as well.
4. The table and row roles are now specified in HTMLMarkupMap and MathMLMarkupMap, rather than overriding NativeRole.  Cell roles are still handled in a NativeRole override; see the code comments for details.
5. IsProbablyLayoutTable has been moved from TableAccessible to HTMLTableAccessible, as it is only relevant for HTML tables, not for ARIA tables.
6. HTMLTableHeaderCellAccessible::NativeRole has been rewritten such that it no longer depends on querying table coordinates, as that would now require building a CachedTableAccessible, which would be very wasteful here. This replaces TableCellAccessible::HeaderCellRole, which has been removed.

Differential Revision: https://phabricator.services.mozilla.com/D179799
2023-06-08 09:50:28 +00:00
Anna Yeddi 3ae23f78be Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-08 00:28:38 +00:00
Nathan LaPre bb0eac529c Bug 1789235: Fire a scrolling start event for anchor jump if focus in doc, r=Jamie
This revision modifies NotifyOfAnchorJump in order to ensure that we fire a
scrolling start event for AT clients. Without this, clients might miss anchor
jump updates, since anchor jumps can arrive after getting focus. This revision
also adds a test to verify that the scrolling start event is now being sent.

Differential Revision: https://phabricator.services.mozilla.com/D177419
2023-06-08 00:06:39 +00:00
James Teh a89668b961 Bug 1837105: Add methods for determining generic Accessibles and getting the nearest non-generic ancestor. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179800
2023-06-07 22:34:49 +00:00
James Teh bd9bd8733b Bug 1835967: Remove TableAccessibleBase::Select/UnselectCol/Row. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179513
2023-06-07 01:40:25 +00:00
Hunseop Jeong bc6e2d89d2 Bug 1826904 - Add the AXSubrole for role="meter". r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D179884
2023-06-06 20:42:24 +00:00
Norisz Fay 63fa83129d Backed out changeset 1d562ee8729b (bug 1796178) for causing mochitest failures on test_general.html CLOSED TREE 2023-06-06 22:22:18 +03:00
Norisz Fay 357f177c83 Backed out changeset dbe49d0e5b60 (bug 1834931) for causing mochitest failures on browser_caching_text_bounds.js 2023-06-06 22:21:09 +03:00
Anna Yeddi af5fecdbd1 Bug 1829269 - Add support for ARIA 1.3 role="image". r=Jamie
Adding ARIAMap for nsGkAtoms::image and mapping to it GRAPHIC to nsGkAtoms::image instead of img in RoleMap. This allows both tests listed in the expectations metadata file in `testing/web-platform/meta/wai-aria/role/synonym-roles.html.ini` to be passing, thus removing this file.

Differential Revision: https://phabricator.services.mozilla.com/D179720
2023-06-06 15:23:32 +00:00
Anna Yeddi efb3216a37 Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-06 15:17:26 +00:00
Anna Yeddi 578616014d Bug 1834931 - Map HTML <code> to roles::CODE. r=Jamie
Mapping HTML `<code>` and updating its corresponding test and meta files.

Differential Revision: https://phabricator.services.mozilla.com/D179602
2023-06-06 15:15:20 +00:00
James Teh 09d623679d Bug 1818404: Use HTMLLinkAccessible for SVG <a> elements. r=nlapre
This ensures that these are HyperTextAccessibles if they contain text, which prevents assertions and exposes formatting information.
It also gives these the correct role.

Differential Revision: https://phabricator.services.mozilla.com/D179409
2023-05-31 02:33:57 +00:00
James Teh 6a9d344564 Bug 1835725: Remove unused a11y::IsCacheActive. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179404
2023-05-31 02:28:30 +00:00
James Teh f79fdd39f3 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-28 23:42:12 +00:00
Eitan Isaacson 4b8822a071 Bug 1826869 - Cache doc mime type and make available via DocAccessibleParent. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178887
2023-05-26 22:17:13 +00:00
Chris Peterson 386cfe958f Bug 1791961 - accessible: Fix C++20 -Wambiguous-reversed-operator warnings. r=Jamie
clang is warning that C++20 expects comparison operators to be commutative: `a == b` and `b == a` should resolve to the same comparison operator function. Warnings about the comparison of const and non-const objects can be fixed by making the comparison operator function const.

accessible/base/TextAttrs.h:139:54 [-Wambiguous-reversed-operator] ISO C++20 considers use of overloaded operator '!=' (with operand types 'mozilla::a11y::TextAttrsMgr::TextDecorValue' and 'mozilla::a11y::TextAttrsMgr::TextDecorValue') to be ambiguous despite there being a unique best viable function with non-reversed arguments
...

Differential Revision: https://phabricator.services.mozilla.com/D179019
2023-05-26 04:51:43 +00:00
Sandor Molnar 329d21371b Backed out changeset dbb7e27f8464 (bug 1833313) for causing android gv-junit crashes. CLOSED TREE 2023-05-24 14:08:03 +03:00
James Teh 6cf954e1ce Bug 1821969 part 1: Remove Mac table layout guess cache. r=morgan
Now that we always have the core parent process cache, this is no longer necessary.
This also removes EVENT_TABLE_STYLING_CHANGED, which was only used to keep the Mac cache up to date.

Differential Revision: https://phabricator.services.mozilla.com/D178425
2023-05-24 10:50:45 +00:00
James Teh fbf1ab52f8 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-24 10:10:46 +00:00
Morgan Rae Reschenberg d23af61142 Bug 1832260: Fallback to LocalAccessible::Bounds if we can't find a frame in ComputeBoundsFromFrame. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178576
2023-05-23 21:19:32 +00:00
James Teh cd328c4093 Bug 1821963 part 3: Remove various components supporting the old accessibility architecture based on content process COM proxies. r=nlapre,nalexander
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.

Differential Revision: https://phabricator.services.mozilla.com/D177963
2023-05-22 20:19:45 +00:00
Narcis Beleuzu ed1139f199 Backed out 6 changesets (bug 1821963) for build bustages. CLOSED TREE
Backed out changeset a92c62e304f0 (bug 1821963)
Backed out changeset da6cba0b0dd4 (bug 1821963)
Backed out changeset 4ed7ca0eb04a (bug 1821963)
Backed out changeset f2fba0ef15d9 (bug 1821963)
Backed out changeset 706e46fc2688 (bug 1821963)
Backed out changeset 6de2b9548dc6 (bug 1821963)
2023-05-22 14:05:20 +03:00
James Teh 3a3b50114d Bug 1821963 part 3: Remove various components supporting the old accessibility architecture based on content process COM proxies. r=nlapre,nalexander
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.

Differential Revision: https://phabricator.services.mozilla.com/D177963
2023-05-22 10:00:21 +00:00