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

10540 Коммитов

Автор SHA1 Сообщение Дата
Eitan Isaacson 31c0b1e98c Bug 1730095 - P1: Refactor text Mac marker tests. r=morgan
This change gives a bit more flexibility for isolating issues and seeing which specific marker offset is giving trouble when a test fails.

Depends on D168445

Differential Revision: https://phabricator.services.mozilla.com/D168446
2023-02-22 04:52:59 +00:00
James Teh f826326f5f Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 04:46:50 +00:00
James Teh 75092d8fb0 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 04:46:50 +00:00
Eitan Isaacson 8bf95c7d17 Bug 1814220 - Allow ignoring list item markers in TextLeafPoint::FindBoundary. r=Jamie
Refactor in FindBoundary to allow easier skipping of leaves in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D168445
2023-02-22 04:17:31 +00:00
Butkovits Atila d45ed2897d Backed out 2 changesets (bug 1816346) for causing failures at test_table.html. CLOSED TREE
Backed out changeset eeb78c17513c (bug 1816346)
Backed out changeset 22b32e106152 (bug 1816346)
2023-02-22 04:45:07 +02:00
James Teh 4f47e992e7 Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 02:17:56 +00:00
James Teh 193890e062 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 02:17:55 +00:00
Emilio Cobos Álvarez a228002bd2 Bug 1815229 - Remove nsImageBoxFrame. r=tnikkel,layout-reviewers
nsImageFrame has support for displaying style URIs / an owned image
request, so use it.

The main behavior difference is that we don't fire `load` / `error`
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.

Differential Revision: https://phabricator.services.mozilla.com/D168958
2023-02-21 17:36:11 +00:00
Eitan Isaacson 4cdf1e6cc0 Bug 1816536 - Fix document edge issues in FindBounary. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169726
2023-02-21 16:37:24 +00:00
Eitan Isaacson a8c6dc0db1 Bug 1816573 - Use flags in TextLeafPoint::FindBoundary instead of boolean arguments. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169740
2023-02-21 16:37:23 +00:00
Florian Quèze 7567717c5e Bug 1817506 - Make accessible/tests/mochitest/tree/test_media.html wait for Fluent to update asynchronously the accessible value of the scrubber, r=Gijs.
Differential Revision: https://phabricator.services.mozilla.com/D170396
2023-02-20 22:16:19 +00:00
Razvan Cojocaru a334f46de8 Bug 755621 - Add downcasting for nsXULTreeItemAccessibleBase. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D170051
2023-02-20 06:37:16 +00:00
James Teh e425f02438 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-16 11:57:14 +00:00
Robert Longson 88d6e6fbaa Bug 1817075 - Use nsIFrame::HasAnyStateBits() whenever possible instead of GetStateBits() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170006
2023-02-16 08:10:28 +00:00
Cosmin Sabou 5878f95ed4 Backed out changeset 95d948d14dfe (bug 1816601) for causing mochiest failures on browser_test_text.js. CLOSED TREE 2023-02-16 02:38:01 +02:00
James Teh e951e20e20 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-15 23:24:28 +00:00
Iulian Moraru 11536128a2 Bug 1782783 - disable browser_test_focus_urlbar.js on linux for frequent failures. patch re-made to solve landing conflicts r=aryx
Differential Revision: https://phabricator.services.mozilla.com/D169883
2023-02-15 10:32:05 +00:00
Joel Maher a62ef05cdb Bug 1816191 - Skip tests in order to keep win7 running @ azure. r=gbrown,necko-reviewers,settings-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,nalexander,sgalich,alwu
Differential Revision: https://phabricator.services.mozilla.com/D169523
2023-02-14 23:44:12 +00:00
Robert Longson 986ccaa6d3 Bug 1815959 - Check the content type for SVG shapes and images, not the frame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169369
2023-02-14 05:59:41 +00:00
James Teh 706f120344 Bug 1816094: Simplify calculation of character bounds in LocalAccessible::BundleFieldsForCache. r=morgan
Previously, we retrieved an ancestor frame and various rects and used a transform to make continuation char rects relative to their primary frame.
Since all we need is an offset, we can just use nsIFrame::GetOffsetTo, which does all of this for us.

Differential Revision: https://phabricator.services.mozilla.com/D169446
2023-02-14 04:45:49 +00:00
James Teh e0626af463 Bug 1816022: LocalAccessible::ParentRelativeBounds: If the bounding frame's rect is empty but its union rect is not, offset by its union rect. r=morgan
See the code comment for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D169443
2023-02-14 04:44:18 +00:00
Gijs Kruitbosch 387cf24ca0 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 23:50:41 +00:00
Eitan Isaacson d5e8f25121 Bug 1815774 - Introduce TextLeafPoint XPCOM bindings and tests. r=Jamie
This uses a bitfield for flags in FindBoundary, the idea is that it
will give some regression coverage if/when we move the native API
to do the same.

Differential Revision: https://phabricator.services.mozilla.com/D169246
2023-02-13 17:56:12 +00:00
Andi-Bogdan Postelnicu d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Cristina Horotan 5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch ff1cc20bd7 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 12:55:26 +00:00
Emilio Cobos Álvarez d28f1e4d47 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 12:24:53 +00:00
James Teh 631c9ecf0a Bug 1775684 part 2: Don't create a DocAccessible if it doesn't exist yet when handling notifications for cache/tree updates. r=morgan
We only use these notifications from layout to push cache updates or insert Accessibles that were skipped during the initial build.
If the DocAccessible doesn't exist yet, creating it is pointless since we can't do this update until the tree is built.
The correct data will be included in the initial tree and cache push anyway.
Aside from pointless refresh ticks, this really shouldn't make any difference, since we don't build the initial tree until layout is ready anyway.
However, the only remotely relevant thing I can think of that's changed in the a11y code lately that might have caused a spike in these test failures is that bounds notifications might get fired earlier/more often from layout, potentially causing earlier creation of DocAccessibles.
Any change to timing might cause a shift in intermittent failures, and since this is wasteful anyway, we may as well fix it.

Differential Revision: https://phabricator.services.mozilla.com/D168911
2023-02-09 04:50:53 +00:00
James Teh 8cd27f807a Bug 1775684 part 1: Ignore frame visibility when caching focusable state for a11y. r=morgan,emilio
See the code comment in LocalAccessible::NativeInteractiveState for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D168910
2023-02-09 04:50:53 +00:00
James Teh 98ad175f52 Bug 1814800: Force Accessible creation if an element has position: fixed/sticky. r=nlapre
We need to know about position: fixed in the parent process a11y cache, so we always need an Accessible for such elements.
We don't cache the fact that something is position: sticky, but we need the Accessible so that it can be notified about bounds updates when it moves within its container.
Previously, we calculated bounds incorrectly if a position: fixed/sticky element wasn't included in the a11y tree.

Differential Revision: https://phabricator.services.mozilla.com/D168916
2023-02-09 04:50:52 +00:00
Marian-Vasile Laza 7675a138b5 Backed out 2 changesets (bug 1815255) for causing reftest failures. CLOSED TREE
Backed out changeset b1173e8c7497 (bug 1815255)
Backed out changeset bd09cf2a4abb (bug 1815255)
2023-02-09 04:26:01 +02:00
Emilio Cobos Álvarez 656f11b2a0 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 00:55:13 +00:00
Nathan LaPre dbd808364d Bug 1806356: Create an accessible if the element's frame has a transform, r=Jamie
This revision changes the logic of MustCreateAccessible such that we always create
an accessible if the content's frame has been transformed and it has children.
This ensures that we have accessibles to which we apply transforms when
calculating accessible bounds. This revision also adds tests to verify that the
accessible is created, even when the element has role="none", both initially and
as a result of an on-the-fly style change.

Differential Revision: https://phabricator.services.mozilla.com/D167760
2023-02-08 19:43:35 +00:00
Cristina Horotan fbcc0f66b4 Backed out 2 changesets (bug 1815255) for causing chrome failures at test_focus.xhtml on a CLOSED TREE
Backed out changeset 983fe4e70647 (bug 1815255)
Backed out changeset f8c6426c60f9 (bug 1815255)
2023-02-08 19:50:19 +02:00
Emilio Cobos Álvarez 5db814c383 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-08 16:52:18 +00:00
Emilio Cobos Álvarez 6384797392 Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-08 13:12:23 +00:00
James Teh 1dcf0a5946 Bug 1814785: Include the transform only for the frame itself in the a11y cache, rather than calculating it relative to an ancestor. r=morgan
Calculating it relative to an ancestor causes problems when the frame ancestry and the a11y ancestry diverge.
For example, this can happen for a transform which is also position: absolute.
In that case, the parent Accessible's frame is not an ancestor of the child Accessible's frame.
Since the transform is no longer relative to the ancestor, we no longer need to remove our parent-relative bounds before applying it.
However, we do need to ensure that we apply the transform *before* adding parent-relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D169059
2023-02-08 05:45:55 +00:00
Morgan Rae Reschenberg a5551e25d4 Bug 1815153: Add test to verify position:sticky bounds when scrolling, after dynamic style change r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169129
2023-02-08 04:19:19 +00:00
Iulian Moraru d19790ed5f Backed out 2 changesets (bug 1812329) for causing multiple leaks. CLOSED TREE
Backed out changeset d663fc115ab9 (bug 1812329)
Backed out changeset 5464978a27a8 (bug 1812329)
2023-02-07 23:45:43 +02:00
Emilio Cobos Álvarez b9833bfcca Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-07 18:09:37 +00:00
Emilio Cobos Álvarez 0a2b2c6949 Bug 1815430 - Remove another chunk of dead code that I forgot to commit. a=bustage
MANUAL PUSH: Bustage fix CLOSED TREE
2023-02-07 15:16:26 +01:00
Emilio Cobos Álvarez 19d036b807 Bug 1815430 - nsFocusManager::GetRedirectedFocus is dead code. r=smaug
No implementation of nsIDOMXULMenuListElement returns an input field
(this is menulist.js and autocomplete-input.js).

It seems autocomplete-input used to do this, but it got refactored to
extend HTMLInputElement instead, so this code can all go.

Differential Revision: https://phabricator.services.mozilla.com/D169066
2023-02-07 13:47:48 +00:00
James Teh 20aee7cff6 Bug 1814780: Fail gracefully for calls to a11y::LazyInstantiator from a background thread which would cause us to create the accessibility service. r=nlapre
The accessibility service and our COM objects can only be used on the main thread.
COM rules should mean that we never get direct calls on a background thread, but apparently, someone isn't following the rules.

Differential Revision: https://phabricator.services.mozilla.com/D168914
2023-02-06 20:12:09 +00:00
James Teh 25c5288ae2 Bug 1814538: Don't call RemoteAccessibleBase::IsFixedPos if mCachedFields is null. r=nlapre
RetrieveCachedBounds returns Nothing() if mCachedFields is null.
Since we already have a large block which is only executed if RetrieveCachedBounds returned something, just move the call to IsFixedPos inside that block.

Differential Revision: https://phabricator.services.mozilla.com/D168642
2023-02-02 23:25:54 +00:00
Neil Deakin 9c2e7458ba Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.

Differential Revision: https://phabricator.services.mozilla.com/D158587
2023-02-01 23:30:55 +00:00
James Teh 9dfda5ccb0 Bug 1813980: Check IsDoc before Parent in RemoteAccessibleBase::ApplyCrossDocOffset. r=morgan
We call this function on every ancestor when calculating bounds.
RemoteParent() currently requires a hash lookup, so it's more efficient to early return for !IsDoc() first.
This is a micro-optimisation, but it might have some impact given that we call this on every ancestor, especially when hit testing, where we call Bounds() a lot.

As a bit of drive-by cleanup, use RemoteParent() rather than calling Parent() and IsRemote/AsRemote().

Differential Revision: https://phabricator.services.mozilla.com/D168346
2023-02-01 05:02:01 +00:00
James Teh 1278600686 Bug 1813256 follow-up: Add test. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D168331
2023-02-01 04:58:30 +00:00
Morgan Rae Reschenberg e8d1a57763 Bug 1809836: Avoid adding scroll offsets when computing bounds for position:fixed accs r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166730
2023-02-01 01:23:10 +00:00
James Teh 3d456f3e7b Bug 1813256: Don't descend into other documents when tracking moved LocalAccessibles. r=nlapre
The set of moved LocalAccessibles on a document should only include Accessibles within that document.
Previously, we were descending into iframe documents.
This resulted in notifying the parent process about incorrect ids being moved and potentially pushing the cache in an invalid state.

Differential Revision: https://phabricator.services.mozilla.com/D168310
2023-01-30 22:28:48 +00:00
Mark Banner 61c8871b31 Bug 1812977 - Remove now unnecessary import-globals-from statements in accessible. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D168069
2023-01-30 19:33:37 +00:00
Otto Länd 129697ae6a Bug 1811092: apply code formatting via Lando
# ignore-this-changeset
2023-01-27 20:20:51 +00:00
Eitan Isaacson 80156311b1 Bug 1811092 - P3: Add browser text selection tests and increase coverage. r=Jamie
Added more coverage for generated content too.

Depends on D167202

Differential Revision: https://phabricator.services.mozilla.com/D167203
2023-01-27 20:15:12 +00:00
Eitan Isaacson eb7fe304b8 Bug 1811092 - P2: Add async text selection removal message. r=Jamie
Depends on D167201

Differential Revision: https://phabricator.services.mozilla.com/D167202
2023-01-27 20:15:12 +00:00
Eitan Isaacson dbdb811bfa Bug 1811092 - P1: Add new async add/set text selection message. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D167201
2023-01-27 20:15:11 +00:00
Sandor Molnar 41b0aaaaac Backed out changeset b27d83c0aa57 (bug 1806356) for causint dt failures in devtools/client/netmonitor/test/browser_net_basic-search.js 2023-01-27 05:23:17 +02:00
James Teh 0c12a12bbd Bug 1811972: When an Accessible is moved in the tree, queue a bounds cache update. r=morgan
When an Accessible is moved, it's possible it is re-parented.
In that case, since our cached bounds are relative to the parent, the bounds are now incorrect.
To fix this, queue a bounds cache update whenever an Accessible is moved.
This will also trigger when an Accessible remains under the same parent.
However, because we cache bounds in LocalAccessible, we won't actually push a cache update unless the bounds really changed.

Differential Revision: https://phabricator.services.mozilla.com/D167866
2023-01-26 23:43:08 +00:00
Nathan LaPre 0f763d9ab4 Bug 1806356: Create an accessible if the element's frame has a transform, r=Jamie
This revision changes the logic of MustCreateAccessible such that we always create
an accessible if the content's frame has been transformed. This ensures that we
have accessibles to which we apply transforms when calculating accessible bounds.
This revision also adds a test to verify that the accessible is created, even
when the element has role="presentation".

Differential Revision: https://phabricator.services.mozilla.com/D167760
2023-01-26 18:40:45 +00:00
Emilio Cobos Álvarez af31750cc0 Bug 1775062 - Fix various using statements to use properly qualified names. r=nika,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D167710
2023-01-25 10:52:10 +00:00
James Teh 5bfe8feec7 Bug 1811949: If we use the ink overflow rect for the parent's bounds, take this into account when calculating parent relative bounds for children. r=morgan
If a container has a 0 width/height, we use the ink overflow rect.
A container can overflow beyond the top left of its main rect; e.g. with align-items: flex-end.
Previously, when calculating the parent relative bounds of children, we always calculated relative to the parent's main rect.
If we ended up using the ink overflow rect for the parent, this meant that the parent relative bounds of children were wrong.
To fix this, compensate for the ink overflow offset in this case.

Differential Revision: https://phabricator.services.mozilla.com/D167636
2023-01-25 03:05:27 +00:00
James Teh ed23883a3a Bug 1812208: Push a cache update if bounds change as a result of a frame moving even though it wasn't reflowed. r=morgan,emilio
A frame doesn't have to be reflowed to change its position.
For example, if there is a container c followed by a node outside the container o, inserting a node into c reflows c, but moves o down the page without reflowing o.
In this case, we previously weren't being notified that there was a possible bounds change, which meant we weren't updating the cache.
Now, we get notified about frames moving regardless of reflow.
Since this notification includes changes to CSS left/right/top/bottom, we can also remove the code added in bug 1774705 to explicitly watch for changes to these properties.

Differential Revision: https://phabricator.services.mozilla.com/D167645
2023-01-25 03:03:53 +00:00
Gijs Kruitbosch 129735a58b Bug 1811854 - switch remaining tests to BrowserTestUtils.loadURIString from BrowserTestUtils.loadURI, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D167558
2023-01-24 13:19:11 +00:00
Emilio Cobos Álvarez 9e530f224a Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu
Move it to the mozilla::widget namespace.

Use enum classes for transparency, popup type, popup level, etc.

Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).

Differential Revision: https://phabricator.services.mozilla.com/D167537
2023-01-23 23:58:41 +00:00
Dão Gottwald 05e5fefb46 Bug 1810647 - Prepare for enable urlbar result menu in Nightly. r=mak,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D167004
2023-01-23 15:54:53 +00:00
Emilio Cobos Álvarez 236a544bba Bug 1793747 - Address comment nits that I forgot to upload.
DONTBUILD

MANUAL PUSH: Trivial change CLOSED TREE
2023-01-23 11:40:23 +01:00
Emilio Cobos Álvarez a822daf7cf Bug 1793747 - Clean-ups and test fixes on top of the previous patch. r=Jamie
This should be a tad simpler.

Depends on D159879

Differential Revision: https://phabricator.services.mozilla.com/D167446
2023-01-23 09:19:43 +00:00
Jihye Hong 85bfb346b9 Bug 1793747 - Omit the element hidden by 'content-visibility:hidden' from the accessibility tree r=emilio,Jamie
There is an issue that when the element is hidden because its ancestor has 'content-visibility:hidden', it still appears in the accessibility tree.
Depending on CSS Containment Spec (https://www.w3.org/TR/css-contain-2/#cv-a11y),
it should be omitted from the accessibility tree.
This change fixes the issue above.

The approach is not to create the node in accessibility tree if the element has any ancestor specified with 'content-visibility:hidden'.

This patch can be tested such as:
(1) Check if the accessibility tree is created correctly
  ./mach test accessible/tests/browser/tree/browser_css_content_visibility.js
(2) Check if the accessibility tree is updated correctly
  ./mach test accessible/tests/browser/e10s/browser_treeupdate_csscontentvisibility.js

Differential Revision: https://phabricator.services.mozilla.com/D159879
2023-01-23 09:19:43 +00:00
Gijs Kruitbosch 8be066753c Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - other directories - r=Standard8,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D167154
2023-01-19 20:16:43 +00:00
Dão Gottwald 477eb99f64 Bug 1801298 - Fix down/up arrow behavior with multiple selectable elements per row. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D166803
2023-01-19 10:26:53 +00:00
Sandor Molnar af55a388e5 Backed out changeset 357170b2f52a (bug 1801298) for causing bc failures in browser/components/urlbar/tests/browser-tips/browser_selection.js CLOSED TREE 2023-01-19 12:00:27 +02:00
Dão Gottwald 8881cfae2a Bug 1801298 - Fix down/up arrow behavior with multiple selectable elements per row. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D166803
2023-01-19 08:25:15 +00:00
James Teh 4eeda8a4ad Bug 1774705 part 2: Queue a bounds cache update when the CSS left/right/top/bottom CSS properties change on positioned elements. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D166768
2023-01-18 17:52:57 +00:00
James Teh 8bdfc0d756 Bug 1774705 part 1: Fall back to `this` when hit testing a cached RemoteAccessible if the point is inside `this`. r=morgan
For deepest child, previously, if the requested point was inside a different subtree to the origin Accessible (e.g. out-of-flow), we would return null because the origin wasn't an ancestor of the target.
We still check the ancestry, but if the point is inside the origin, we return the origin.
This is consistent with LocalAccessible (and thus non-cached RemoteAccessible).

For direct child, previously, we would return a child of the origin even if another element in a different subtree was higher in the z-order.
This is because we kept walking the viewport cache until `this`.
Instead, we now stop at the deepest match and walk up to the direct child if the origin is an ancestor.
If it isn't an ancestor, we still fall back to the origin if the point is inside it, just as we do for deepest child.

This change is necessary here because our test for out-of-flow hit testing changes the CSS left property to move an out-of-flow element.
That test passed because the bounds cache for that element was never updated, so we always found the target we expected.
In the next patch, we fix the bounds cache update, which would break this test without this hit testing fix.

In addition, this patch also changes our test for overlapping elements to match this new expectation.
There were also some bugs in the test that had to be fixed; e.g. using y instead of height to get the centre.
Since this is now consistent, we can remove the cache restriction and test LocalAccessible as well.

Differential Revision: https://phabricator.services.mozilla.com/D166849
2023-01-18 17:52:57 +00:00
James Teh 29c03d7779 Bug 1757127 part 2: Use the unified Language method for ATK, IA2 and XPCOM. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D166858
2023-01-17 20:35:22 +00:00
James Teh 4b0234eb8e Bug 1757127 part 1: Move LocalAccessible::Language to Accessible and implement for cached RemoteAccessible. r=nlapre
Since language is also exposed as a text attribute and we cache all text attributes, we already cache this.
Thus, the RemoteAccessibleBase implementation just fetches it from the text attributes cache.

Differential Revision: https://phabricator.services.mozilla.com/D166857
2023-01-17 20:35:21 +00:00
Morgan Rae Reschenberg 455f71d2fd Bug 1808828: Compute ancestor transform for continuations that span multiple subtrees r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166485
2023-01-12 19:10:12 +00:00
James Teh 07b00111a1 Bug 1809379: If a scroll event is fired on inaccessible anonymous content, redirect it to the closest non-anonymous ancestor. r=morgan
textareas contain an anonymous div which fires the scroll event.
We don't have an Accessible for this div, so previously, we were just ignoring the scroll event.
Now, we'll redirect it to the textarea and get its Accessible.
This ensures that we push a cache update so that the scroll position (and thus the bounds) are correct.
This also means that a11y scroll events are fired on textareas where they weren't previously.

Differential Revision: https://phabricator.services.mozilla.com/D166508
2023-01-12 03:48:44 +00:00
Morgan Rae Reschenberg ad2f396003 Bug 1793941: Don't fire EVENT_TABLE_STYLING_CHANGED when the cache is enabled r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166117
2023-01-11 22:34:04 +00:00
Cosmin Sabou cc3cda2cdc Backed out changeset 9f8d4babe01d (bug 1808828) for causing ancestor related assertion failures. CLOSED TREE 2023-01-12 00:32:06 +02:00
Morgan Rae Reschenberg 49bb2654cb Bug 1808828: Compute ancestor transform for continuations that span multiple subtrees r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166485
2023-01-11 21:08:17 +00:00
Sandor Molnar cc2d0f07e4 Backed out changeset f5ee2900f8e3 (bug 1793941) for causing mochitest failures in accessible/tests/mochitest/events/test_stylechange.html CLOSED TREE 2023-01-11 20:40:37 +02:00
Morgan Rae Reschenberg d260be60d5 Bug 1793941: Don't fire EVENT_TABLE_STYLING_CHANGED when the cache is enabled r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166117
2023-01-11 17:06:33 +00:00
Nathan LaPre b690b77391 Bug 995064: Rework group position calculation to allow intervening accs in compound ARIA widgets, r=Jamie
Transition the group position calculation - specifically the code in Update -
to Pivot such that we can handle finding siblings across intervening generic
container accessibles, such as SECTIONs. This fixes issues with finding the
values of "pos in set" and "set size" for descendant owned elements in compound
ARIA widgets. This revision also updates and adds tests for this functionality.

Differential Revision: https://phabricator.services.mozilla.com/D165756
2023-01-10 20:51:50 +00:00
Nathan LaPre f77d2ea214 Bug 1805316: Use generic ARIA accessibles for mtable, mtr with non-table display style, r=Jamie
These MathML table elements may not have a table display style, in which case
they shouldn't be HTML table accessibles. This revision changes the logic of
MathMLMarkupMap such that mtable, mtr elements create generic ARIA accessibles
if the display style for the element is something other than 'table'. This
revision also adds a test to verify that the roles are still reported correctly,
even with this change.

Differential Revision: https://phabricator.services.mozilla.com/D165980
2023-01-09 21:03:46 +00:00
Eitan Isaacson 9bda15c625 Bug 1769824 - Move text range bounds implementation to TextLeafRange. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D166370
2023-01-09 19:56:20 +00:00
Ben Freist 476cccc35c Bug 1808888 - [refactor] Migrate NS_STYLE_LIST_STYLE_POSITION_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166140
2023-01-09 07:07:13 +00:00
James Teh 52039f92c2 Bug 1808046: Never try to remove the DocAccessible when an element's slot changes. r=nlapre
When an element's slot changes and the element is unslotted, we remove its Accessible.
If the body is moved inside a shadow host at the same time, we will process the slot removal first because moves are processed async.
Previously, this caused us to try to remove the DocAccessible (since it was still associated with the body), causing nastiness and potentially crashes.
We should never try to remove the DocAccessible, so explicitly prevent this when handling slot changes.
An assertion was also added to make sure we never try to remove the DocAccessible in future.

Differential Revision: https://phabricator.services.mozilla.com/D166134
2023-01-09 02:56:13 +00:00
Emilio Cobos Álvarez d86ebe2a1e Bug 1808624 - Partially revert test_focus_menu.xhtml changes from regressing bug.
No review, trivial test change.

Differential Revision: https://phabricator.services.mozilla.com/D166070
2023-01-05 14:00:50 +00:00
Emilio Cobos Álvarez ec017e8f33 Bug 1805414 - Fix test_focus_general.xhtml locally. r=morgan
This test passes on automation, somehow, probably due to timing.
Locally the click rolls up the popup (so you'd need a second click to
show the other popup).

This happens both with and without the patch, and given I debugged and
it is trivial to fix, well, make sure to hide the previously open menu
before clicking on another...

Differential Revision: https://phabricator.services.mozilla.com/D165983
2023-01-05 01:20:08 +00:00
Morgan Rae Reschenberg 2dcebc6f8b Bug 1807639: Null check `ancestor` before creating a Pivot r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D165923
2023-01-04 21:33:59 +00:00
Emilio Cobos Álvarez 4f1f5e7314 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-04 19:01:13 +00:00
Csoregi Natalia 9807a6e6e8 Backed out changeset f11c529b2407 (bug 1805414) for failures on test_submenuClose.xhtml and nsMenuPopupFrame.cpp. CLOSED TREE 2023-01-04 01:48:30 +02:00
Gijs Kruitbosch 3762db01b9 Bug 1475606 - remove loadOneTab and switch its callers over, r=dao,perftest-reviewers,sparky
Depends on D165774

Differential Revision: https://phabricator.services.mozilla.com/D165775
2023-01-03 22:24:44 +00:00
Emilio Cobos Álvarez 3d82727505 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-03 22:06:01 +00:00
Olli Pettay 5d21de32ac Bug 1807812 - Remove WidgetEventTime::mTime, r=masayuki,geckoview-reviewers,m_kato
HTMLSelectEventListener changes are needed, since currently that code works somewhat by accident given that
mTime often contains totally bogus values, like PR_IntervalNow(). Those changes then reveal issues also in
browser_editAddressDialog.js.

Differential Revision: https://phabricator.services.mozilla.com/D165618
2023-01-02 12:31:40 +00:00
Sylvestre Ledru 1f8d23143a Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D165559
2022-12-28 09:52:44 +00:00
Marco Castelluccio f69e697461 Bug 1801836 - Remove no longer necessary 'from __future__' imports. r=linter-reviewers,glandium,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,jld,ahal,owlish,afinder DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165395
2022-12-23 22:45:46 +00:00
Mark Banner 8730eec697 Bug 1806359 - Convert telemetry imports to direct ES imports. r=necko-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,janerik,mconley,sgalich,bytesized,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D165002
2022-12-23 12:37:07 +00:00
Emilio Cobos Álvarez 2c11f3e1cf Bug 1638500 - Wait for actual value change before checking value. r=Jamie
My patch in bug 1805414 makes this fail in a way that's perma, and it
seems it is because we're not waiting for the actual value change to
happen.

Differential Revision: https://phabricator.services.mozilla.com/D165238
2022-12-22 10:10:32 +00:00
James Teh 6fc37030c0 Bug 1806548: When the slot attribute is changed, remove the Accessible if the element is now unslotted. r=nlapre
If the slot attribute is changed to assign the element to a slot which doesn't exist in the shadow DOM, the element is now unslotted and thus shouldn't be rendered.
We have code in PruneOrInsertSubtree to handle changes like this, but that only works if the frame for the shadow host or something inside the shadow DOM gets reconstructed.
In the case of a shadow host with a single child, there might not necessarily be any frame reconstruction.
To handle this, we listen for changes to the slot attribute.
We check if the element is still part of the flat tree (i.e. it is slotted).
If it isn't, we remove its Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D165135
2022-12-22 00:51:27 +00:00
James Teh f133cff3c3 Bug 1806486: If we're forced to create an Accessible for a MathML element which wouldn't normally have one, make it a HyperTextAccessible. r=nlapre
Certain MathML elements such as annotation and annotation-xml don't normally get an Accessible.
However, we force create Accessibles in some cases; e.g. if the element is focusable.
When this happens for these MathML elements (e.g. annotation-xml with a tabindex), we previously created AccessibleWraps which don't support text.
This meant that text formatting information was unavailable and caused assertions when pushing the cache.
To fix this, use HyperTextAccessibleWrap instead.

As a drive-by fix, also use HyperTextAccessibleWrap instead of HyperTextAccessible for content MathML elements.
This was almost certainly a typo when this was implemented.
This wouldn't have been noticeable in tests and some native platforms, but some platforms (e.g. Mac and Windows) do have some overrides in HyperTextAccessibleWrap, so we should use those.

Differential Revision: https://phabricator.services.mozilla.com/D165252
2022-12-21 21:21:11 +00:00
James Teh 433e37a17f Bug 1806026 part 2: Don't include the identity matrix when caching transforms for a11y. r=morgan
See the code comments for details.
This is just a memory optimisation; there is no user visible change.

Differential Revision: https://phabricator.services.mozilla.com/D164996
2022-12-20 03:24:15 +00:00
James Teh 77088bfef9 Bug 1806026 part 1: When applying a transform in RemoteAccessible, remove only the parent relative offset, not the cumulative offset calculated so far. r=morgan
When applying an ancestor transform, ApplyTransform is supplied with the cumulative bounds calculated so far; i.e. from descendants.
When removing the parent relative offset, the code previously set the top left to (0, 0).
This not only removed the parent relative offset, but also the cumulative offset calculated for all descendants!
Instead, we now pass in the cumulative bounds as well as the parent relative bounds.
We only subtract the parent relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D164995
2022-12-20 03:24:15 +00:00
Stanca Serban b1d0b3a50a Backed out 2 changesets (bug 1806026) for causing mochitests failures in browser_test_simple_transform.js. CLOSED TREE
Backed out changeset e2bbf722e41e (bug 1806026)
Backed out changeset 6eaa7e0e5fe4 (bug 1806026)
2022-12-20 01:07:34 +02:00
Ben Freist ce6cd37bc7 Bug 1802799 - [refactor] Migrate NS_STYLE_TEXT_DECORATION_STYLE_* defines r=emilio,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D163177
2022-12-19 22:47:24 +00:00
James Teh eca010172b Bug 1806026 part 2: Don't include the identity matrix when caching transforms for a11y. r=morgan
See the code comments for details.
This is just a memory optimisation; there is no user visible change.

Differential Revision: https://phabricator.services.mozilla.com/D164996
2022-12-19 22:15:35 +00:00
James Teh 6d4b1bdd63 Bug 1806026 part 1: When applying a transform in RemoteAccessible, remove only the parent relative offset, not the cumulative offset calculated so far. r=morgan
When applying an ancestor transform, ApplyTransform is supplied with the cumulative bounds calculated so far; i.e. from descendants.
When removing the parent relative offset, the code previously set the top left to (0, 0).
This not only removed the parent relative offset, but also the cumulative offset calculated for all descendants!
Instead, we now pass in the cumulative bounds as well as the parent relative bounds.
We only subtract the parent relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D164995
2022-12-19 22:15:35 +00:00
James Teh 4c3d8e7a36 Bug 1802241: Add a test case for updating cached bounds on an in-process iframe DocAccessible while its OuterDocAccessible is being re-created. r=morgan
Previously, this test case caused an assertion, but that was fixed in bug 1792120.
We also ensure the x and y are the same before an dafter the re-creation.
This verifies that we aren't losing the iframe's border/padding.

Differential Revision: https://phabricator.services.mozilla.com/D164879
2022-12-17 02:09:12 +00:00
James Teh b0e11e12be Bug 1792120: Use the cached offset from GetUsedBorderAndPadding for all OuterDocAccessibles, not just OOP iframes. r=morgan
Aside from making the code consistent for OOP and in-process iframes, this also fixes incorrect bounds in in-process iframe documents when the iframe's padding is changed.
We always pushed a cache update for the iframe when the padding was changed.
However, we previously relied on parent-relative bounds for in-process iframes, which didn't get updated when the iframe's padding changed.

Differential Revision: https://phabricator.services.mozilla.com/D164878
2022-12-17 02:09:12 +00:00
James Teh 20cb2157d5 Bug 1736635: Clean up LocalAccessible::FindNearestAccessibleAncestorFrame. r=morgan
We previously thought that DocAccessible::GetFrame didn't return a frame.
On the contrary, it has returned the PresShell's root frame for a long time now, which is precisely what we want.
This means we can make this method a bit cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D164877
2022-12-17 02:09:11 +00:00
Morgan Rae Reschenberg 8ca309681e Bug 1804186: Use RelationType in mReverseRelations map instead of uint64_t r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D164268
2022-12-16 23:08:43 +00:00
Morgan Rae Reschenberg 160dde8228 Bug 1801234: Queue a relations cache update on dependent accs when DOM ID mutations are observed r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162895
2022-12-16 23:08:43 +00:00
James Teh 99882c7170 Bug 1805545 part 2: Don't query CSS on image map areas when querying LocalAccessible attributes. r=morgan
This fixes the same bug as part 1, but when the cache is disabled.
It is covered by the same test.

Differential Revision: https://phabricator.services.mozilla.com/D164784
2022-12-15 23:41:18 +00:00
James Teh c5f38f94f1 Bug 1805545 part 1: Don't query the display style on image map areas when pushing the cache. r=morgan
See the code comments for an explanation.
This fixes assertions and crashes when pushing the cache when a page contains a map which is unslotted in a shadow host.

Differential Revision: https://phabricator.services.mozilla.com/D164783
2022-12-15 23:41:18 +00:00
James Teh 7a085dff19 Bug 1805876 part 2: Use GetAccessible instead of GetAccessibleOrContainer when building the viewport cache. r=morgan
Calling GetAccessibleOrContainer meant that if a particular content node didn't have an Accessible but did have a frame, we'd insert its container in its place.
There might have been other descendants of that container that did have Accessibles, though.
In that case, we would have put the container ahead of some of its descendants!
To fix this, use GetAccessible instead.
We'll still fall back to the container if the user hit tests a point in an inaccessible node, since it will appear later in the viewport cache.

Differential Revision: https://phabricator.services.mozilla.com/D164803
2022-12-15 23:35:51 +00:00
James Teh c0b3a8201a Bug 1805876 part 1: Revert the RemoteAccessible hit testing changes in bug 1801756. r=morgan
That patch was always somewhat hacky, but we couldn't figure out the cause of the problem.
Now that I've figured it out, a more correct solution is forthcoming.

Differential Revision: https://phabricator.services.mozilla.com/D164802
2022-12-15 23:35:50 +00:00
Andrew McCreight ce28c41da0 Bug 1805931, part 2 - Automated removal of uses of ROOT and UNROOT CC macros. r=smaug
As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D164829
2022-12-15 19:45:01 +00:00
James Teh a970a1087e Bug 1800736: Use HyperTextAccessible for <svg> and <g> elements. r=nlapre
These can contain <foreignobject>, which contains HTML but does not normally create its own Accessible.
This means that these Accessibles could have TextLeafAccessible children.
TextLeafAccessible children must always have a HyperTextAccessible as a parent.
Therefore, we must use HyperTextAccessible for <svg> and <g>.
As well as fixing assertions, this allows text formatting to be queried for <foreignobject> content, which was previously broken.

Differential Revision: https://phabricator.services.mozilla.com/D164636
2022-12-15 02:21:24 +00:00
Morgan Rae Reschenberg 9bb1925772 Bug 1802386: If we can't find a PresContext or the root PresContext, bail out of WillRefresh r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D164270
2022-12-14 18:26:19 +00:00
Norisz Fay 0fa6500691 Backed out 2 changesets (bug 1801234, bug 1804186) for causing assertion failures on DocAccessibleParent.cpp CLOSED TREE
Backed out changeset 949a747693d1 (bug 1804186)
Backed out changeset 51527201739c (bug 1801234)
2022-12-13 23:58:05 +02:00
Morgan Rae Reschenberg a2878c10ac Bug 1804186: Use RelationType in mReverseRelations map instead of uint64_t r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D164268
2022-12-13 20:16:37 +00:00
Morgan Rae Reschenberg 141e01d78f Bug 1801234: Queue a relations cache update on dependent accs when DOM ID mutations are observed r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162895
2022-12-13 20:16:36 +00:00
lyavor 42556ae145 Bug 1799683 - Add disable next line for all accessible/tests. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D161599
2022-12-12 17:10:02 +00:00
Morgan Rae Reschenberg a0c829b432 Bug 1804991: Issue a warning if we attempt to stringify an empty array, but don't crash r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D164391
2022-12-09 23:56:58 +00:00
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
James Teh 61e3c5bebe 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-16 23:21:23 +00:00
James Teh ab6ebb6e12 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-16 23:21:22 +00:00
Michael Comella 8a3e28c236 Bug 1798388 - add DocAccessible::ProcessQueuedCacheUpdates profiler marker. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D162238
2022-11-16 23:19:02 +00:00
Morgan Rae Reschenberg b3214f51b9 Bug 1752054: Map radio and checkbox menu items to MOX classes for radio buttons and checkboxes r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D162170
2022-11-16 18:18:54 +00:00
Emilio Cobos Álvarez 9ae8258a6e Bug 1799460 - a11y fixes for my previous changes. r=Jamie
The button tweak is needed because now if you have:

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

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

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

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

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

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

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

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

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

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D161775
2022-11-11 10:13:27 +00:00
Marian-Vasile Laza 99789d1ff6 Backed out changeset 09fb44f9d0b4 (bug 1800048) for causing mochitest failures on browser_caching_relations.js. CLOSED TREE 2022-11-11 07:27:50 +02:00
Morgan Rae Reschenberg 1d82cef271 Bug 1800060: Avoid computing LINKS_TO for links with no anchor r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D161826
2022-11-11 00:03:29 +00:00