Commit Graph

10084 Commits

Author SHA1 Message Date
Eitan Isaacson
9b3628d6a4 Bug 1794634 - Stop using ARIARoleAtom sync message and remove it. r=morgan
Add role map index to RoleChangedEvent so remote doc accessibles have an ARIA role defined.

Differential Revision: https://phabricator.services.mozilla.com/D159067
2022-10-12 22:08:33 +00:00
Emilio Cobos Álvarez
2a3fbb6c87 Bug 1794265 - Add a test for this bug. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D159035
2022-10-12 05:12:08 +00:00
Marian-Vasile Laza
8c3bea141f Backed out changeset be17ad2c9d94 (bug 1794634) for causing mochitest failures on browser_rootgroup.js. CLOSED TREE 2022-10-12 02:16:57 +03:00
Eitan Isaacson
dfcf32500b Bug 1794634 - Stop using ARIARoleAtom sync message and remove it. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D159067
2022-10-11 22:19:34 +00:00
Nathan LaPre
4c4f2f6984 Bug 1776416: Do not diff hypertext if not editable, r=Jamie
Diffing text can make for confusing screen reader readouts in live regions. To
address this, this revision causes gecko to avoid sending update events for
solely the diff. Instead, gecko will now send a text update event that causes
us to re-read the entire text node. This brings us in line with Chrome.
Notably, if the text is editable, we'll continue to diff as usual to avoid
clients reading too much text on each edit.

Differential Revision: https://phabricator.services.mozilla.com/D158822
2022-10-11 18:21:00 +00:00
James Teh
45537045d3 Bug 1794319: Remove a11y::EventTree, as it has been dead code for 6 years. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D158918
2022-10-11 01:41:42 +00:00
Morgan Rae Reschenberg
0554a1d02d Bug 1790910: Adjust getTableParent to deal gracefully with outline rows r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D158890
2022-10-10 16:22:47 +00:00
James Teh
8a72400cf5 Bug 1793073: Ensure Accessible::IsTable can't return true if AsTable will return null. r=eeejay
These should never be out of sync.
Previously, they could be out of sync for an ARIA table with display: contents, since we don't create an ARIAGridAccessible in that case (bug 1494196).
While that incorrect creation is itself a bug that we should fix, I don't want to deal with that here.
Instead, don't check ARIA generic types in Accessible::IsTable, only the class generic types, as we already do for IsTableCell.
This fixes a crash in BundleFieldsForCache.

In addition, while the crash is fixed by the above change, as an optimisation, BundleFieldsForCache now just calls AsTable instead of calling IsTable first, since the IsTable call is redundant.
This second fix alone would be sufficient to fix the crash, but the first will catch other potential instances of this problem.

Differential Revision: https://phabricator.services.mozilla.com/D158548
2022-10-09 23:32:24 +00:00
Eitan Isaacson
5ac02ef5ec Bug 1793488 - Add AccAttributes::DebugPrint. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D158529
2022-10-07 20:45:58 +00:00
James Teh
4b1188a81d Bug 1789378: Support IAccessibleAction for cached RemoteAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D158617
2022-10-07 01:04:51 +00:00
James Teh
6a4548dc57 Bug 1764750: Clear the stale state on cached DocAccessibleParents when the document finishes loading. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D158729
2022-10-07 00:22:00 +00:00
James Teh
c579cdfd2e Bug 1793408: Consistently treat OuterDocAccessibles as a single character in TextLeafPoint. r=morgan
1. When constructing a TextLeafPoint and searching for a leaf, do not descend inside an OuterDoc (iframe/browser).
  Otherwise, we end up inside another document.
  Other TextLeafPoint code avoids crossing document boundaries, so the constructor must do this too.
2. When searching for a leaf, include an OuterDoc, but don't walk inside it.
  Previously, we skipped OuterDocs altogether.
  This meant that if you started on an OuterDoc, walking backward and then forward by character would never return you to your origin.
  Also, clients walking the document text shouldn't just skip iframes altogether, so exposing them as a single character makes more sense.

This fixes infinite loops in OffsetAtPoint when querying a container with an iframe at the end.

Differential Revision: https://phabricator.services.mozilla.com/D158740
2022-10-06 23:47:50 +00:00
Masayuki Nakano
6b389daaf1 Bug 1793534 - part 2: Make the accessibility module handle exposable URIs which do not contain user-pass section r=Jamie
We shouldn't expose the user-pass section of document URI to another apps since
it's sensitive data, but non-malicious a11y API users must not need it.

Additionally, `data` and `blob` URI may be too big (e.g., can be some mega
bytes) and they may need to allocate too big string multiple times in the heap
per URI.  Therefore, the accessibility module should stop handling URI as-is if
the document URI is one of them.

Differential Revision: https://phabricator.services.mozilla.com/D158735
2022-10-06 10:04:45 +00:00
James Teh
6b84c4b16a Bug 1793423: Don't assume the document has a cache yet in RemoteAccessibleBase::ChildAtPoint. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D158623
2022-10-05 23:57:11 +00:00
James Teh
f66a2a1e61 Bug 1793710: Partially support MSAA role string hack for cached RemoteAccessible to avoid returning failure. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D158618
2022-10-05 23:56:22 +00:00
Emilio Cobos Álvarez
d0f5bc50af Bug 1792802 - Fix accessible tests after previous change. r=Jamie
After the previous change, the treecolpicker element only wraps a button
and a menu, which are siblings rather than parent/child. I think that's
probably fine but it changes the shape of the a11y tree.

This patch updates the relevant tests, but let me know if you'd rather
keep the behavior. I could do that by either keeping the treecolpicker
entry listed in XULMap (I think), or via other means.

Suggestions welcome if you think this is not the right fix.

Differential Revision: https://phabricator.services.mozilla.com/D158640
2022-10-05 06:59:14 +00:00
Emilio Cobos Álvarez
69535154e5 Bug 1792802 - Fix tree column picker. r=aminomancer
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.

Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D158438
2022-10-05 06:59:13 +00:00
Norisz Fay
167133ff80 Backed out changeset f9249f760526 (bug 1792802) for causing mochitest failures on test_struct_tree.xhtml CLOSED TREE 2022-10-05 05:58:02 +03:00
Emilio Cobos Álvarez
5c4de29d0e Bug 1792802 - Fix tree column picker. r=aminomancer
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.

Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D158438
2022-10-05 02:09:03 +00:00
James Teh
f8cfb7ca83 Bug 1792092: Fix potentially uninitialized value in Windows RemoteAccessible. r=nlapre
mSafeToRecurse was initialized to true in one constructor, but not the other.
Fix this using default member initialization.

Differential Revision: https://phabricator.services.mozilla.com/D158550
2022-10-04 23:35:48 +00:00
Eitan Isaacson
b0e929cfaf Bug 1781193 - Update table layout-guess and mathML innerHTML on reorder. r=Jamie
This helps on several fronts:
1. Avoids a cache push on accessibles that have yet to be sent to
   parent when relying on BindToParent instead.
2. Handles the case of table children removals.
3. Uses the mutation event collation for cache push collation.

No test case for MathML here because it is windows only, but I think
we should add coverage for it too.

Differential Revision: https://phabricator.services.mozilla.com/D158528
2022-10-04 16:46:55 +00:00
James Teh
4e695325c5 Bug 1790317 part 2: Change instances of UniqueID in LocalAccessible code to use ID. r=eeejay
This doesn't update usage elsewhere in the code base, but it should be enough to ensure that this doesn't break anything.
We can gradually update other cases in future.

Differential Revision: https://phabricator.services.mozilla.com/D157082
2022-10-04 06:13:52 +00:00
James Teh
cbf1bc1704 Bug 1790317 part 1: Make LocalAccessible::ID return 0 for the document. r=eeejay
For IPC, we use id 0 to refer to the document.
However, LocalAccessible::UniqueID doesn't return 0 for documents.
This meant that when sending IPC messages, we hitherto had to special case the document in each case.

We don't want to mess with LocalAccessible::UniqueID, but since Accessible::ID was only introduced recently, we can set new expectations there.
Thus, this patch changes LocalAccessible::ID to return 0 for documents.
This means that in future, we can just use Accessible::ID when sending IPC messages.
nsAccUtils::GetAccessibleByID has also been updated to handle this.

Differential Revision: https://phabricator.services.mozilla.com/D157081
2022-10-04 06:13:51 +00:00
James Teh
f346eae4ee Bug 1788879: Return early from potentially long-running a11y tasks if a content process has been asked to shut down. r=eeejay
If the process is asked to shut down while we're in the middle of handling long-running tasks, we should return early to avoid pointless work and allow the process to shut down sooner.
This patch adds ExpectingShutdown checks near various things which could potentially take a while; e.g. building the local tree, serializing the IPC tree, building the IPC cache, etc.

Differential Revision: https://phabricator.services.mozilla.com/D156809
2022-10-04 02:25:10 +00:00
Emilio Cobos Álvarez
4e978b56b5 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-27 04:18:16 +00:00
Marian-Vasile Laza
f54a464c90 Backed out changeset 2f74f8f2ed19 (bug 1689816) for causing reftest failures on skip-ink-multiline-position.html. 2022-09-26 23:24:03 +03:00
Emilio Cobos Álvarez
f875681246 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-26 17:40:30 +00:00
Nathan LaPre
f9c5af7bc8 Bug 1732179: Account for cross-process offset properly in bounds calculation, r=morgan
This revision slightly reworks the way that we calculate accessible bounds in
RemoteAccessibleBase::BoundsWithOffset. Rather than looking "below" the current
accessible for a doc accessible to determine whether we should apply a cached
cross-process offset, we instead look "above" the current accessible, to its
parent, to check for a cross-process offset to apply. Then, in ApplyTransform,
we ensure that we maintain that cross-process offset.

Differential Revision: https://phabricator.services.mozilla.com/D157240
2022-09-23 21:31:28 +00:00
Emilio Cobos Álvarez
d76233d103 Bug 1789168 - Allow emulated -moz-box (which creates flexbox containers) to be used as a tab panel. r=eeejay
I don't understand why we don't allow any box through, but for now this
is a safer change to restore the previous behavior when emulated flex
box is used.

Differential Revision: https://phabricator.services.mozilla.com/D158002
2022-09-23 16:16:14 +00:00
Eitan Isaacson
371a745997 Bug 1792068 - Promisify events/test_scroll.xhtml. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D157949
2022-09-22 19:41:59 +00:00
Masayuki Nakano
a353ab7e90 Bug 1789967 - part 3: Make HTMLEditor::CollapseSelectionToEndOfLastLeafNodeOfDocument and HTMLEditor::InitEditorContentAndSelection do nothing if the document is partially editable r=m_kato
They and their callees work with the result of `GetRoot()` which is the document
element or the body element.  If the body is not editable, `Selection` should
not be updated in non-editable region nor `<br>` elements should not be
inserted in both non-focused editable elements and non-editable elements.
Therefore, they should run only when the document element or the `<body>`
element is editable.

To keep testing crashtests as reported, this patch makes tests which have
`contenteditable` except `<html>` and `<body>` initialize `Selection` as
what we've done.  And clean up the tests for helping to port them to WPT
in the future (bug 1725850).

Differential Revision: https://phabricator.services.mozilla.com/D157408
2022-09-22 06:27:37 +00:00
Joel Maher
4c4438b4f7 Bug 1536208 - removing old aarch64 manifest annotations. r=aryx,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D157677
2022-09-21 15:35:02 +00:00
Frederic Wang
62d1893ea4 Bug 1791245 - More cleanup for the <mfenced> element. r=emilio
The <mfenced> element [1] is not part of MathML Core [2] or MathML AAM
[3] and was removed in bug 1603773. It should be treated as
an unknown MathML element, that is like an `<mrow>`.

This commit performs some follow-up code cleanup:

* Remove a11y mapping, instead map it like an mrow.

* Remove obsolete deprecation message.

* Don't include mfenced in the sanitizer's default element allow list.
  The spec [4] does not mention an explicit list.

* Preference mathml.mfenced_element.disabled was removed, so no need
  to force it when running tests.

* Tweak some code comments.

[1] https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced
[2] https://w3c.github.io/mathml-core/#mathml-elements-and-attributes
[3] https://w3c.github.io/mathml-aam/
[4] https://wicg.github.io/sanitizer-api

Differential Revision: https://phabricator.services.mozilla.com/D157580
2022-09-20 03:53:50 +00:00
Ryan VanderMeulen
defeab2235 Backed out changeset 6376af715fb9 (bug 1787274) for Fenix UI test failures. 2022-09-15 13:10:33 -04:00
Morgan Rae Reschenberg
5afbf8d60d Bug 1787274: Use mCachedFields viewport cache for determining offscreen state r=Jamie,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D155903
2022-09-14 22:02:06 +00:00
Butkovits Atila
4fc48f6705 Backed out changeset 7d2bb2e5fb73 (bug 1787274) for causing geckoview failures. 2022-09-14 22:09:11 +03:00
Morgan Rae Reschenberg
f7de79f06d Bug 1787274: Use mCachedFields viewport cache for determining offscreen state r=Jamie,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D155903
2022-09-14 17:47:43 +00:00
Morgan Rae Reschenberg
d143da6750 Bug 1788547: Null check table acc exists before firing styling changed event, add assert for debugging r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D156987
2022-09-13 19:57:53 +00:00
Nathan LaPre
b5c69b9980 Bug 1788143 - Rely on selection state to determine combo box value, r=Jamie
Previously, we were not firing active state change events for the options in
<select> elements when the drop-down was expanded. This leads to possibly-stale
cached 'active' state in the parent process, which can cause Firefox to report
incorrect combo box values based on stale state. Rather than fire more 'active'
state change events to fix the problem, this revision addresses the problem by
not firing 'active' state change events for combo boxes at all, and instead
relying on the selection state when determining the combo box value in the
parent process. This revision also adds a test to verify that the behavior is
as expected.

Differential Revision: https://phabricator.services.mozilla.com/D156627
2022-09-13 16:18:52 +00:00
James Teh
640af21671 Bug 1789750: Don't try to get a COM proxy in Windows RemoteAccessible when the cache is disabled. r=nlapre
For methods supported by the cache, we already delegate to RemoteAccessibleBase where the caching implementation lives.
However, there are still some less used methods which aren't supported by the cache yet.
These methods are never called by the code which Windows a11y clients interact with (MsaaAccessible and friends).
However, they can be called from XPCOM; e.g. when using the Browser Console.
For now, just early return in these cases so we don't crash.
Eventually, we'll need to unify these methods and support them with the cache enabled.

Differential Revision: https://phabricator.services.mozilla.com/D156771
2022-09-09 01:44:52 +00:00
James Teh
fbc63fb814 Bug 1789790: When a row is added to a table, push a cache update for the table's layout guess. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D156810
2022-09-08 23:47:37 +00:00
James Teh
ea7dd2e2cd Bug 1789396: Null check acc before calling AsLocal() in RemoteAccessibleBase::BoundsWithOffset. r=morgan
We expect acc to be a local OuterDocAccessible.
However, the OuterDocAccessible might die before the top level DocAccessibleParent, in which case acc will be null.
In this case, the DocAccessibleParent is about to die anyway, so it doesn't matter that the bounds we return are slightly wrong (since they can't take the OuterDoc into account).

Differential Revision: https://phabricator.services.mozilla.com/D156773
2022-09-08 23:47:01 +00:00
Daniel Holbert
61d63a37b0 Bug 1789903: Remove unused member-var AccMutationEvent::mNode. r=morgan
This variable was supposed to be removed long ago in bug 813019, but the
declaration was left behind by accident, it seems.

Differential Revision: https://phabricator.services.mozilla.com/D156879
2022-09-08 19:04:10 +00:00
criss
be23bbe9af Merge mozilla-central to autoland on a CLOSED TREE 2022-09-08 00:23:23 +03:00
Ryan VanderMeulen
d7d5c89ee7 Backed out changeset e8354032aaf6 (bug 1787274) for being the likely cause of Fenix & Focus UI test bustage. 2022-09-07 13:41:40 -04:00
Olli Pettay
93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Morgan Rae Reschenberg
c2cd0ee189 Bug 1787274: Use mCachedFields viewport cache for determining offscreen state r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D155903
2022-09-06 21:00:29 +00:00
Morgan Rae Reschenberg
ec1c2a165e Bug 1787282: [Part 2] Cache LINKS_TO relation information r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D156138
2022-09-06 19:27:17 +00:00
Morgan Rae Reschenberg
c8469d0ad8 Bug 1787282: [Part 1] Modify relations caching infrastructure for rels with no implicit partner r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D156126
2022-09-06 19:27:16 +00:00
James Teh
41073adfb6 Bug 1787692: Partially support ISimpleDOMNode::nodeInfo for cached RemoteAccessibles. r=morgan
JAWS won't expose MathML without this.
We can't fully support it; we don't cache info about namespaces, for example.
However, this implementation is enough to get MathML working with JAWS.

Differential Revision: https://phabricator.services.mozilla.com/D156150
2022-09-05 04:30:44 +00:00