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

10091 Коммитов

Автор SHA1 Сообщение Дата
Sandor Molnar 6a467e1baf Backed out changeset 431649004dd4 (bug 1789474) for causing android gv-junit-fis-o crashes CLOSED TREE 2022-10-14 07:59:55 +03:00
Eitan Isaacson 1778c775fe Bug 1789474 - Allow detached documents to be overwritten in accessible mapping. r=Jamie,geckoview-reviewers,owlish
Also assure that unregistering an accessible removes the right one and
doesn't confuse the attached document with the detached one.

Add stderr output to Accessible::DebugPrint in Android as well.

Differential Revision: https://phabricator.services.mozilla.com/D157528
2022-10-13 22:03:03 +00:00
Mike Conley 8fb3f39f66 Bug 1794894 - Convert JSMs under accessible/ to ESMs. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D159221
2022-10-13 15:05:56 +00:00
Nathan LaPre 4f0c38f44d Bug 1794043: Improve AccAttributes ergonomics, r=eeejay
This revision modifies aspects of AccAttributes to make them a bit easier to
work with from a developer perspective. One big win here is the removal of
SFINAE logic that prunes the overload set when resolving calls to SetAttribute.
That logic, plus the other overloads of SetAttribute, have been translated
fairly directly into if constexpr blocks in a single SetAttribute
implementation. The upshot of this is that we can now explicitly disallow
people, at compile time, from accidentally making string copies when passing
strings to SetAttribute, with a nice error message! This revision also enables
us to use AccAttributes in a read-only fashion, particularly in range-based for
loops. This revision accomplishes that by adding const wherever is reasonable.
Next, this revision also removes some redundant special member function
definitions (deletions). My hope is that these changes will generally make
AccAttributes easier to use as safely as possible. Finally, this revision
updates a couple places where we use AccAttributes in a read-only way such
that they use the new const mechanisms.

Differential Revision: https://phabricator.services.mozilla.com/D158995
2022-10-13 01:00:57 +00:00
James Teh 62885a5651 Bug 1794747: Use ChildAt instead of NextSibling to iterate children in Accessible::GetLevel. r=nlapre
NextSibling uses IndexInParent, which is currently slow for RemoteAccessible.
Even if IndexInParent were faster, we're iterating all children here, so doing it this way is more efficient regardless.
This results in a significant performance improvement (> 25x) with NVDA when thousands of HTML select options are shown.

Differential Revision: https://phabricator.services.mozilla.com/D159149
2022-10-12 23:48:47 +00:00
James Teh 270c0a643d Bug 1786240: Clear a cached BUSY state before firing doc load complete. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D159136
2022-10-12 23:48:09 +00:00
Eitan Isaacson 8fff4f15d6 Bug 1794654 - Wait for cache update before comparing bounds to content. r=morgan
We first retrieve accessible bounds and then pass them to a content task to compare against content layout bounds. We are not guaranteed to have the cache in sync in that manner, most tests will wait for a content rAF but that is not sufficient for the parent cache's state.

Instead we need to pull the content layout bounds (since those are guaranteed to be in sync via rAF) into parent and then wait for the a11y cache to catch up.

Differential Revision: https://phabricator.services.mozilla.com/D159080
2022-10-12 22:47:55 +00:00
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