Commit Graph

10267 Commits

Author SHA1 Message Date
James Teh
ca834233da Bug 1802040: Track the focused DocAccessibleParent on Android. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D163707
2022-12-07 13:42:30 +00:00
Anna Yeddi
2bc83ec22d Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-07 00:56:45 +00:00
Drew Willcoxon
43b648c36b Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 18:43:49 -05:00
Noemi Erli
42fd111277 Backed out changeset e0eac08ef8bc (bug 1803873) fo causing failures in browser_search_telemetry_sources_navigation CLOSED TREE 2022-12-07 01:24:44 +02:00
Drew Willcoxon
b080ee4b3a Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 22:28:55 +00:00
Nathan LaPre
391c21b2f8 Bug 1802240: Use generic ARIA grid cell accessible for mtd elements without table style, r=Jamie
This revision changes the logic in MathMLMarkupMap such that mtd elements create
generic ARIA grid accessibles if the display style for the element is something
other than 'table'. This revision also adds a test that verifies that the roles
remain as expected, even with this change.

Differential Revision: https://phabricator.services.mozilla.com/D163898
2022-12-06 20:41:44 +00:00
Marian-Vasile Laza
ff26a6d976 Backed out 7 changesets (bug 1676068) for causing geckoview junit failures. CLOSED TREE
Backed out changeset d3c9e777a050 (bug 1676068)
Backed out changeset 639c9661c850 (bug 1676068)
Backed out changeset d06b6aa3b9a3 (bug 1676068)
Backed out changeset 50bb7e9c6bcf (bug 1676068)
Backed out changeset 234acd14548e (bug 1676068)
Backed out changeset 04050cfd5e3f (bug 1676068)
Backed out changeset a06081c85646 (bug 1676068)
2022-12-06 07:20:40 +02:00
Anna Yeddi
70b8f223fc Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-06 03:18:25 +00:00
Morgan Rae Reschenberg
397dcfd11b Bug 1803814: Remove Maybe wrapper from RelationData's mReverseType member r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D163858
2022-12-05 23:42:52 +00:00
James Teh
0ed15e0a86 Bug 1802268 part 2: Reinstate partial invalidation of cached HyperText offsets for local HyperTextAccessible. r=eeejay
In bug 1766794, I replaced partial invalidation of cached offsets with full cache invalidation.
I did this to simplify the code, since the offsets cache was being extended to RemoteAccessible.
This is fine for RemoteAccessible because offsets are only needed there when clients query them.
However, for local HyperTextAccessible, offsets are always required to fire text events.
Full cache invalidation there meant that many insertions into a large container was very expensive.

To fix this, reinstate the ability to partially invalidate the offsets cache.
This is largely the code I previously removed from HyperTextAccessible, with some tweaks for readability.

Differential Revision: https://phabricator.services.mozilla.com/D163418
2022-12-05 23:27:24 +00:00
James Teh
2dea45bfcf Bug 1802268 part 1: Add AccAttributes::GetMutableAttribute. r=eeejay,nlapre
We will soon have an offsets array in the parent process cache which is not built in one shot.
Instead, we will gradually cache more offsets as they are requested.
To do this, we need a way to get an array from the cache which can be modified in-place.

Differential Revision: https://phabricator.services.mozilla.com/D163417
2022-12-05 23:27:23 +00:00
James Teh
7cf81f44ff Bug 1793978: Fail gracefully (instead of crashing) when an invalid offset is given to HyperTextAccessibleBase::TextAt/Before/AfterOffset. r=morgan
An invalid aOffset results in an invalid TextLeafPoint, so just return early if that happens.

Differential Revision: https://phabricator.services.mozilla.com/D163807
2022-12-05 23:18:45 +00:00
Butkovits Atila
b70ae77aa5 Bug 1778821 - disable browser_text_input.js on Mac for frequent failures. r=intermittent-reviewers,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D163160
2022-12-04 23:29:50 +00:00
Cristian Tuns
b5ecdf11a3 Backed out 4 changesets (bug 1676068) for causing geckoview failures CLOSED TREE
Backed out changeset ee747c27b9bc (bug 1676068)
Backed out changeset 0876924c66e8 (bug 1676068)
Backed out changeset 30a8292a37ae (bug 1676068)
Backed out changeset 19a0b7a0987c (bug 1676068)
2022-12-01 19:44:47 -05:00
Anna Yeddi
3614a03fd1 Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-01 22:35:07 +00:00
Cristian Tuns
5359f6f6d9 Backed out 4 changesets (bug 1676068) for causing mochitest failures CLOSED TREE
Backed out changeset 3e8b24890eb2 (bug 1676068)
Backed out changeset 7ba99b58ac35 (bug 1676068)
Backed out changeset fc1c62ea6542 (bug 1676068)
Backed out changeset ca2fed771557 (bug 1676068)
2022-12-01 15:48:37 -05:00
Nathan LaPre
96461033cd Bug 1711273: Preserve columnheader, rowheader roles with certain CSS displays set, r=Jamie
This revision addresses an issue with th elements within tables that don't have
the table CSS display style. In these cases, where we create an
ARIAGridCellAccessible for a th, we fail to report rowheader and columnheader
properly, since ARIAGridCellAccessible doesn't know how to handle th elements.
This revision fixes the problem by moving the th NativeRole logic into the
TableCellAccessible class, then calling that logic from both the ARIA grid cell
accessible NativeRole and from HTMLTableHeaderCellAccessible, as before. This
revision also updates tests reliant on the old behavior, including beefing up
an existing test aimed at this bug specifically.

Differential Revision: https://phabricator.services.mozilla.com/D163371
2022-12-01 20:17:32 +00:00
Anna Yeddi
6c9a5814b5 Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-01 19:50:03 +00:00
James Teh
f142728ad8 Bug 1801756: When hit testing in RemoteAccessibleBase, search for the deepest matching descendant of the first match. r=morgan
See the code comments for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D163082
2022-12-01 04:32:28 +00:00
James Teh
c261e718e9 Bug 1803041: Expose valuetext object attribute for cached RemoteAccessible. r=eeejay
This is needed by ATK.

Differential Revision: https://phabricator.services.mozilla.com/D163304
2022-11-30 02:03:04 +00:00
Eitan Isaacson
f9fbfefda3 Bug 1801986 - Set pivot root to top remote document. r=Jamie
The pivot should never cross from remote into parent process local
containers. We need to explicitly set the root for the pivot, and
assert for this in the pivot traversal methods.

Differential Revision: https://phabricator.services.mozilla.com/D163285
2022-11-29 20:31:21 +00:00
James Teh
4e85ff0fe9 Bug 1802866: Don't send a11y cache pushes containing no data. r=nlapre
This can happen if we're pushing the tree for only moved (no new) Accessibles, since we don't send cache pushes for those.
It can also happen if an Accessible generates no cache data, which is rare but probably not impossible.
Making IPDL calls with no data is wasteful, so don't do it.

Differential Revision: https://phabricator.services.mozilla.com/D163203
2022-11-29 07:01:25 +00:00
James Teh
5508057e9f Bug 1801879: Don't cross document boundaries in nsAccUtils::GetSelectableContainer. r=eeejay,geckoview-reviewers,owlish
Trying to access a local OuterDocAccessible from the Android UI thread was causing a crash.
We shouldn't be crossing document boundaries anyway.

Differential Revision: https://phabricator.services.mozilla.com/D163067
2022-11-29 05:18:23 +00:00
James Teh
09faad9a85 Bug 1802297: Don't fire show events for the initial a11y tree push. r=eeejay
After bug 1779156, show events were fired from RecvCache, rather than from RecvShowEvent.
This was done to ensure that cache data was available when the event was fired.
However, because RecvCache fired a show event for every initial cache push, this meant that it also fired one for the document itself, plus all the document's initial direct children.
Firing an event for the document caused problems for ATK, since the parent was null for all top level documents.
This also meant we were firing a lot of unnecessary show events, which could be a performance problem for documents with a lot of initial direct children.
To fix this, provide an explicit argument to PDocAccessible::Cache specifying whether to dispatch a show event or not.
This replaces the existing aFinal argument, which was never used.

Differential Revision: https://phabricator.services.mozilla.com/D163192
2022-11-29 05:06:46 +00:00
James Teh
218dae1d78 Bug 1801907: Fail gracefully (don't crash) if a caller passes an invalid end offset to HyperTextAccessibleBase::TextBounds. r=morgan
This was causing crashes with Orca in some cases.

Differential Revision: https://phabricator.services.mozilla.com/D163243
2022-11-28 19:31:27 +00:00
Marco Castelluccio
16a078cc32 Bug 1790816 - Reformat accessible/ with isort. r=linter-reviewers,Standard8 DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162662
2022-11-23 12:38:45 +00:00
James Teh
fc48558dff Bug 1778433 part 3: Remove defunct *AccessibleWrap types. r=nlapre
Now that they're no longer referenced, we can get rid of them.

Differential Revision: https://phabricator.services.mozilla.com/D162457
2022-11-22 04:55:11 +00:00
James Teh
1fc8f98cd1 Bug 1778433 part 2: Change references to defunct *AccessibleWrap types to use the corresponding *Accessible classes. r=nlapre
These are effectively type aliases on all platforms now and are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D162456
2022-11-22 04:55:11 +00:00
James Teh
c40b2a87c0 Bug 1778433 part 1: Move Windows specific functionality from XULMenuItemAccessibleWrap to MsaaXULMenuitemAccessible. r=nlapre
This never really belonged in XULMenuItemAccessibleWrap::Name, as it's specific to MSAA.
This will allow us to remove this Wrap class.

Differential Revision: https://phabricator.services.mozilla.com/D162455
2022-11-22 04:55:11 +00:00
James Teh
fadbd93a95 Bug 1766147: Remove now unused eProxyType, Accessible::IsProxy and LocalAccessible::mBits. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D162448
2022-11-22 04:17:41 +00:00
James Teh
da36b6436a Bug 1800755: Don't send selection changes for defunct Accessibles. r=morgan
When a selection event is dropped due to coalescence, we still include the impacted Accessible in the SelectedAccessiblesChanged notification we send to the parent process.
Although we skip events with defunct targets, we weren't skipping defunct items referenced by selection events.
This meant that if an Accessible was selected/unselected but was shut down before we sent SelectedAccessiblesChanged, the notification would include a dead Accessible.
This was causing an assertion in the parent process.
To fix this, we now ignore defunct items in selection events.

Differential Revision: https://phabricator.services.mozilla.com/D162551
2022-11-22 02:24:28 +00:00
James Teh
f6e656ccfe Bug 1795203: Remove dead code for listbox owned by a combobox in ARIATransformRole. r=nlapre
Gecko switched to mutating the tree structure for aria-owns many years ago instead of using relations, so this is now dead code.
Note that a test case was added for this aria-owns case in accessible/tests/mochitest/role/test_general.html in bug 1044431.
This still passes with this code removed.

Differential Revision: https://phabricator.services.mozilla.com/D162459
2022-11-22 02:16:29 +00:00
Morgan Rae Reschenberg
2f95a2c265 Bug 1800777: Don't recreate reverse rel maps for accs that have been shutdown r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162326
2022-11-21 17:54:31 +00:00
Emilio Cobos Álvarez
4f69b540a6 Bug 1801138 - Ensure empty label values don't collapse. r=dao
Add a zwsp character to ensure they're not considered an empty line.

Differential Revision: https://phabricator.services.mozilla.com/D162301
2022-11-19 20:38:55 +00:00
James Teh
eb1f9b4447 Bug 1800731: When a shadow root is attached, schedule removal of any unslotted a11y children in the host. r=morgan,emilio
PruneOrInsertSubtree already has code to deal with this.
However, layout previously didn't notify a11y about the change if a shadow root was attached without any content, so PruneOrInsertSubtree was never called.
We now schedule re-evaluation of the a11y tree of the shadow host when DOM notifies layout about the attached shadow root.
This will call PruneOrInsertSubtree during the next refresh tick.

Differential Revision: https://phabricator.services.mozilla.com/D162263
2022-11-19 01:31:57 +00:00
James Teh
3dce464cc5 Bug 1800780: Null check mContent in LocalAccessible::IsAbbreviation. r=nlapre
When we push a cache update for tables, we call IsProbablyLayoutTable.
That in turn checks whether the first grandchild LocalAccessible of each row is an abbreviation.
If there is a malformed table containing an iframe as a child of a row, this grandchild will be an embedded DocAccessible.
Since a DocAccessible has a null mContent prior to DoInitialUpdate, calling IsAbbreviation on this would previously crash because it didn't null check mContent.
The fix is simply to null check mContent.

Differential Revision: https://phabricator.services.mozilla.com/D162360
2022-11-18 22:27:00 +00:00
James Teh
35eb75ce3d Bug 1800181: Atomize font family and language a11y text attributes. r=morgan
This reduces memory used by the cache, since the same font family and language strings often occur many times in the same document (and likely even across documents).

Differential Revision: https://phabricator.services.mozilla.com/D162276
2022-11-18 22:03:56 +00:00
Nathan LaPre
af71bdeca8 Bug 1800749: Prevent position:absolute th elements from using HTMLTableHeaderCellAccessible, r=Jamie
Layout doesn't consider these types of th elements to be table cells since there
is no underlying table layout. This patch asks layout whether it considers the
frame's accessible type to be a table cell accessible. If it does, continue to
use the HTMLTableHeaderCellAccessible, but - otherwise - use a generic grid cell
accessible. This revision also adds a test to verify the behavior of th in this
situation. This essentially repeats the logic already in existence for td.

Differential Revision: https://phabricator.services.mozilla.com/D162357
2022-11-18 17:50:44 +00:00
Emilio Cobos Álvarez
486040e135 Bug 1801094 - Clean-up a bit WhereToScroll. r=layout-reviewers,credential-management-reviewers,sgalich,dshin
This doesn't change behavior, but clarifies a bit the naming to match
the scrollIntoView() API. Also makes the name generic (rather than
Top/Left/etc), since for scrollIntoView we want to make the axes be
logical.

That will be done in bug 1789464 (probably via an extra ScrollFlag).

Differential Revision: https://phabricator.services.mozilla.com/D162286
2022-11-18 10:02:23 +00:00
James Teh
86ff3c800c Bug 1796734 part 4: 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-18 01:37:07 +00:00
James Teh
0885462d9e Bug 1796734 part 3: 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.

This necessitated a change to FocusedLocalAccessible to prevent it from trying to get/create a DocAccessible when the accessibility service is shutting down.
Shutting down the service shuts down all documents, and shutting down a document now calls IsFocused, which causes us to get/create a DocAccessible.
That isn't safe while the service is shutting down and was causing a crash.

Differential Revision: https://phabricator.services.mozilla.com/D161875
2022-11-18 01:37:07 +00:00
James Teh
26de9d77df Bug 1796734 part 2: Don't try to get the focused LocalAccessible from the Android UI thread. r=morgan
IN subsequent patches, IsFocused will be called when querying the state of a RemoteAccessible and IsFocused calls FocusedAccessible.
A RemoteAccessible can be queried from the Android UI thread (which is different to Gecko's main thread), but it's not safe to deal with LocalAccessibles off the main thread.
Therefore, don't try to call FocusedLocalAccessible in this case.

Differential Revision: https://phabricator.services.mozilla.com/D162177
2022-11-18 01:37:06 +00:00
James Teh
fdf8f1eb26 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-18 01:37:06 +00:00
Michael Comella
8ecd9795b5 Bug 1800949 - add accessibility Architecture doc with info on trees. r=morgan,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162228
2022-11-18 00:50:58 +00:00
Nathan LaPre
3ec133c70a Bug 1631693: Expose value on non-editable ARIA comboboxes, r=Jamie
This revision expands the reporting of ARIA combobox values to non-editable
comboboxes with no selected option. In these cases, according to the spec, we
should report a value "represented by its descendant elements [...] determined
using the same method used to compute the name of a button from its descendant
content." In this revision, I interpret that to mean, roughly, nsTextEquivUtils'
GetTextEquivFromSubtree, which is tantamount to the name calculation, except
that it crucially avoids rejecting the combobox for having eNameFromValueRule,
unlike GetNameFromSubtree. This revision updates this logic in LocalAccessible
and RemoteAccessibleBase, and adds tests to verify the above.

Differential Revision: https://phabricator.services.mozilla.com/D162229
2022-11-17 18:40:08 +00:00
Mark Banner
46853be577 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (accesible/). r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161915
2022-11-17 12:00:31 +00:00
James Teh
033b3705fb Bug 1800863: Clear mChildren in DocAccessibleParent::Destroy. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D162255
2022-11-17 01:53:57 +00:00
Noemi Erli
a5eaa5751e Backed out 4 changesets (bug 1796734) for causing devtools failures CLOSED TREE
Backed out changeset a61a65628922 (bug 1796734)
Backed out changeset 227725c927de (bug 1796734)
Backed out changeset 0b9e12e2171c (bug 1796734)
Backed out changeset 2ace9061ee13 (bug 1796734)
2022-11-17 03:31:33 +02:00
James Teh
6a849c9b76 Bug 1796734 part 4: 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-16 23:21:24 +00:00
James Teh
a3c43fd056 Bug 1796734 part 3: 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-16 23:21:23 +00:00