Commit Graph
137 Commits
Author SHA1 Message Date
Sylvestre Ledru eafe8b152d Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287834
2026-03-18 10:29:47 +00:00
Serban Stanca 5a709d4a9a Revert "Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio" for causing mochitests failures in browser_action.js.
This reverts commit 2fa4815c8d.
2026-03-17 15:34:26 +00:00
Sylvestre Ledru 2fa4815c8d Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287834
2026-03-17 09:21:51 +00:00
Emilio Cobos Álvarez 256e9aa1ec Bug 1998225 - Remove some unused nsView includes. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D271260
2025-11-04 19:06:23 +00:00
Emilio Cobos Álvarez cd5f760648 Bug 1994964 - Introduce PresShell::GetRootWidget(). r=tnikkel,layout-reviewers
Most callers of nsViewManager::GetRootWidget have a pres shell around
and don't need to care about views.

This is in preparation for bug 1994942, where we'll disconnect subdocs
from the view tree (and thus the view manager will not have the ability
to get a root widget).

Differential Revision: https://phabricator.services.mozilla.com/D269019
2025-10-17 13:32:14 +00:00
Eitan Isaacson 5696c25177 Bug 1988618 - Introduce IsScrollable() and relay it to Android. r=morgan,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D264955
2025-09-19 19:02:36 +00:00
James Teh f6c72a9e35 Bug 1969821: Make table cells compute their name from their subtree. r=eeejay
Aside from bringing us into compliance with the spec, this also fixes reading of table cells with Narrator.

Differential Revision: https://phabricator.services.mozilla.com/D252993
2025-06-19 08:33:04 +00:00
Makoto Kato b97f0d47dc Bug 1961452 - Don't call SetAttached until native handle is set. r=geckoview-reviewers,ohall
This issue is a possible crash case.

Actually `SessionAccessibility.NativeProvider.setAttached` is called in
C++ constructor of `SessionAccessibility`.  But native handle is set
after calling the constructor. So when `NativeProvider.setAttached` is
called, C++ side might not set native handle yet.

So we should not call `setAttached` in the constructor.

Differential Revision: https://phabricator.services.mozilla.com/D246070
2025-04-23 06:49:59 +00:00
James Teh b8f1e1a37e Bug 1794780: Don't expose group position attributes in Accessible::Attributes. r=eeejay
Windows screen readers must call IAccessible2::attributes for every show or text inserted event in order to determine whether the inserted content is within a live region, since this is only exposed via an object attribute.
These attributes include group position attributes: posinset, setsize and level.
When thousands of items are being inserted into a container such as a list, these queries can become expensive, even despite some of the information being cached.
For IA2, including group position attributes is redundant in most cases, since there is a dedicated IAccessible2::groupPosition property for this purpose.

Similarly, Mac code sometimes calls Accessible::Attributes, but it never uses the group position attributes, since it can use Accessible::GroupPosition() instead.
That said, I don't know of a case where this is actually a problem in practice on mac.

To address this:

1. No longer return group position attributes in Accessible::Attributes.
2. XPCOM clients, including tests and DevTools, still depend on these attributes, so update xpcAccessible::GetAttributes to include them.
3. ATK has no dedicated group position query, so update the ATK code to include these attributes too.
4. On Android, we could call GroupPosition directly, but it's easier to just pass AccAttributes to AccessibleWrap::GetRoleDescription, so include these attributes there too.
5. As an exception, IA2 requires the level attribute for headings, so include them just for roles::HEADING.

Differential Revision: https://phabricator.services.mozilla.com/D231653
2024-12-18 06:01:37 +00:00
James Teh eb0d0a4072 Bug 1837126: Don't set the selection range when HyperTextAccessibleBase::PasteText is called with TEXT_OFFSET_CARET. r=eeejay
If no text is selected, this is the same as passing the caret offset, since the selection range is already where we want it.
However, if text is selected, this allows the caller to replace it, just as it would be when pasting using the keyboard or GUI.
Note that this doesn't break any existing expectations because TEXT_OFFSET_CARET was never supported for this method previously.

This allows us to remove the DeleteText call from Android SessionAccessibility::Paste.
This separate DeleteText call was causing problems because it could result in the deletion and the insertion happening in two separate ticks, resulting in incorrect events.
Now, this should always happen in a single tick.

Differential Revision: https://phabricator.services.mozilla.com/D226108
2024-10-20 22:35:34 +00:00
Eitan Isaacson 94b6257545 Bug 1849398 - Gecko initiated a11y focus should not scroll. r=Jamie
If we send an Android ACCESSIBILITY_FOCUSED event because of a content
update (ie. scrolling to anchor or DOM selection changes) we should not
scroll the accessible into view. We should assume the content is being
brought into view by itself.

Testing: We already have tests to show that we scroll an accessible into
view when navigating content, testing for the inverse (that the scroll
is done by other means and NOT a11y) is very hard.

Differential Revision: https://phabricator.services.mozilla.com/D199433
2024-01-24 04:49:03 +00:00
James Teh 80310f0569 Bug 1862802 part 4: Remove SessionAccessibility call to AccessibleWrap::PivotTo. r=eeejay
This now just calls DoPivot and SendAccessibilityFocusEvent directly.

Depends on D192644

Differential Revision: https://phabricator.services.mozilla.com/D192645
2023-11-29 03:53:20 +00:00
Butkovits Atila 8d22d3874b Backed out 5 changesets (bug 1862802) for causing multiple failures. CLOSED TREE
Backed out changeset 786805a2cdcc (bug 1862802)
Backed out changeset effe12f2120a (bug 1862802)
Backed out changeset 7488e7ba80c5 (bug 1862802)
Backed out changeset 3d0747ce0174 (bug 1862802)
Backed out changeset d1558d374cef (bug 1862802)
2023-11-29 03:10:17 +02:00
James Teh 17d960dde8 Bug 1862802 part 4: Remove SessionAccessibility call to AccessibleWrap::PivotTo. r=eeejay
This now just calls DoPivot and SendAccessibilityFocusEvent directly.

Depends on D192644

Differential Revision: https://phabricator.services.mozilla.com/D192645
2023-11-28 22:03:20 +00:00
James Teh 32d424ea16 Bug 1822004: On Android, use RemoteAccessible (CtW) hit testing instead of a DOM event. r=eeejay
This unifies hit testing across all platforms.
It also removes one of the few remaining uses of virtual cursor change events.

Differential Revision: https://phabricator.services.mozilla.com/D192641
2023-11-28 07:37:30 +00:00
Eitan Isaacson 3fb70678f7 Bug 1839516 - Remove FORWARD_ACTION_TO_ACCESSIBLE in Android. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181575
2023-06-21 16:22:51 +00:00
Eitan Isaacson 5504aa2091 Bug 1834874 - P2: Remove DocAccessiblePlatformExt. r=Jamie,ipc-reviewers,mccr8
Since we removed the last dependency on this subprotocol, we can now
remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181321
2023-06-20 18:15:43 +00:00
Eitan Isaacson fbccddcd6e Bug 1834874 - P1: Make text navigation work in UI thread with cached TextLeafPoint API. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D181320
2023-06-20 18:15:42 +00:00
Eitan Isaacson 42fb007873 Bug 1819160 - Map Android ids to doc/accessible id pairs. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D179737
2023-06-13 18:33:35 +00:00
Eitan Isaacson ffafba78c3 Bug 1835162 - Use new async clipboard IPC methods in Android. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D179159
2023-06-07 06:49:56 +00:00
James Teh 16aa5c42a9 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-28 23:42:12 +00:00
Sandor Molnar d1c4b13412 Backed out changeset dbb7e27f8464 (bug 1833313) for causing android gv-junit crashes. CLOSED TREE 2023-05-24 14:08:03 +03:00
James Teh de23c323b0 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-24 10:10:46 +00:00
James Teh ddfdb64368 Bug 1821955 part 5: Change all CtW pref checks to use a11y::IsCacheActive. r=eeejay,taskgraph-reviewers,bhearsum
This was done using the following script:

```
matchingFiles=`git grep -l accessibility_cache_enabled`
sed -i 's/StaticPrefs::accessibility_cache_enabled_AtStartup/a11y::IsCacheActive/' $matchingFiles
for f in $matchingFiles; do
  usesA11yPref=
  grep -q StaticPrefs::accessibility_ $f && usesA11yPref=1
  hasA11yInclude=
  grep -q 'nsAccessibilityService.h' $f && hasA11yInclude=1
  if [ -z $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i 's,mozilla/StaticPrefs_accessibility.h,nsAccessibilityService.h,' $f
  elif [ -z $usesA11yPref ] && [ $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/d' $f
  elif [ $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/a#include "nsAccessibilityService.h"' $f
  fi
done
```

Differential Revision: https://phabricator.services.mozilla.com/D177722
2023-05-19 02:56:48 +00:00
Eitan Isaacson 324528c2df Bug 1829056 - P2: Include fromIndex in TYPE_VIEW_TEXT_CHANGED events. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D177809
2023-05-17 00:19:17 +00:00
Eitan Isaacson 52424928e0 Bug 1829056 - P1: Include text in TYPE_VIEW_TEXT_SELECTION_CHANGED events. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D177808
2023-05-17 00:19:17 +00:00
Eitan Isaacson c61ac28bc0 Bug 1832647 - Remove cache enabled check in Android. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D177807
2023-05-13 00:11:51 +00:00
Makoto Kato bc53997204 Bug 1827386 - Part 1. NativeWeakPtr::Detach returns MozPromise to detect whether dispoer is finished. r=geckoview-reviewers,owlish
Actually, `NativeWeakPtr::Detach` may not release JNI ojbect immediately because
it depends on JNI object's `OnWeakNonIntrusiveDetach`i implementation.
`SessionAccessibility`'s `OnWeakNonIntrusiveDetach` implementation uses the
runnable to run on Android UI thread then disposer runs on main thread, so
if Detach is finished, JNI object isn't detached yet.

If calling `NativeWeakPtrHolder::Attach` immediately with same/recycled Java
object after `NettiveWeakPtr::Detach`, it is possible to run disposer for JNI
object by `OnWeakNonIntrusiveDetach` after Attach is finished. So it may
release newer attached object unfortunately.

So I would like to add a way to waiting for detach JNI object using
`MozPromise`.

Also, `MozPromise.h` includes `Natives.h` header (for `GeckoResult` support).
So I cannot modify inline method to use `MozPromise` due to recursive. So I
split implementation with `NativesInlines.h` as workaround.

Differential Revision: https://phabricator.services.mozilla.com/D175335
2023-05-09 05:13:32 +00:00
Eitan Isaacson 1c3a68a3e3 Bug 1825891 - P2: Remove Android's non-CTW implementation. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D174516
2023-04-13 17:58:57 +00:00
Andi-Bogdan Postelnicu 011e3fc2d9 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban 98c675ed3f Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu 5e0156c1e4 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
Eitan Isaacson 50ee810efe Bug 1819160 - Hold a reference to registering session in DocAccessibleParent. r=Jamie
This should fully eliminate the case where remote accessibles fail to
unregister because of the outer PresShell's lifecycle.

Differential Revision: https://phabricator.services.mozilla.com/D172473
2023-03-16 19:16:30 +00:00
Otto Länd 5066d0958f Bug 1817592, 1822205: apply code formatting via Lando
# ignore-this-changeset
2023-03-15 22:38:25 +00:00
Eitan Isaacson cdbf3071be Bug 1822205 - collectionItemInfo.rowIndex should be 0 based in Android. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D172504
2023-03-15 22:09:32 +00:00
Eitan Isaacson 5debcc87ee Bug 1791152 - Drop entire accessible ID map in UnregisterAll. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D160835
2022-11-02 20:55:15 +00:00
Sandor Molnar a72a46e3d2 Backed out changeset 1b65ae3b0371 (bug 1791152) for causing android gv-junit-fis failures in SessionAccessibility CLOSED TREE 2022-11-02 21:05:46 +02:00
Eitan Isaacson 13eddb7738 Bug 1791152 - Drop entire accessible ID map in UnregisterAll. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D160835
2022-11-02 16:23:42 +00:00
Eitan Isaacson b31475cf14 Bug 1789474 - Allow detached documents to be overwritten in accessible mapping. r=Jamie,geckoview-reviewers,owlish
Also assure that unregistering an accessible removes the right one and
doesn't confuse the attached document with the detached one.

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

Differential Revision: https://phabricator.services.mozilla.com/D157528
2022-10-17 23:10:19 +00:00
Sandor Molnar 8cac924430 Backed out changeset 431649004dd4 (bug 1789474) for causing android gv-junit-fis-o crashes CLOSED TREE 2022-10-14 07:59:55 +03:00
Eitan Isaacson a168398a3b Bug 1789474 - Allow detached documents to be overwritten in accessible mapping. r=Jamie,geckoview-reviewers,owlish
Also assure that unregistering an accessible removes the right one and
doesn't confuse the attached document with the detached one.

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

Differential Revision: https://phabricator.services.mozilla.com/D157528
2022-10-13 22:03:03 +00:00
Eitan Isaacson d46f40fc3f Bug 1786519 - Null check BrowserParent's element and its owner doc. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D155729
2022-08-30 23:04:14 +00:00
Eitan Isaacson d2c539ddcc Bug 1783733 - Return null if registered accessible is defunct. r=Jamie
Assert if we reach that condition, since the accessible failed to
unregister.

Differential Revision: https://phabricator.services.mozilla.com/D155086
2022-08-23 21:46:09 +00:00
Emilio Cobos Álvarez 7a9e682999 Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Eitan Isaacson 097787b758 Bug 1778585 - Don't register non-top-level accessibles if there is no top-level regeistered. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D152328
2022-07-21 16:57:04 +00:00
Butkovits Atila fcdea1de94 Bug 1771934 - Lint fix. a=fix. CLOSED TREE 2022-07-07 02:07:45 +03:00
Eitan Isaacson 5bb8d9fcc3 Bug 1771934 - Unregister all SessionAccessibility accessibles when top doc is shut down. r=Jamie
The associated PresShell of the root doc can be used for retrieving the
SessionAccessibility. If the PresShell is about to go away, we should
unregister all the accessibles.

Differential Revision: https://phabricator.services.mozilla.com/D150661
2022-07-06 22:26:08 +00:00
Narcis Beleuzu e1e6eb3595 Backed out 1 changesets (bug 1771934) for crashes on WeakPtr.h . CLOSED TREE
Backed out changeset 5956f91b3975 (bug 1771934)
2022-06-29 00:26:14 +03:00
Eitan Isaacson 84d48fe9e7 Bug 1771934 - Return null accessible when SessionAcc is not fully attached. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D149295
2022-06-28 19:40:08 +00:00
Eitan Isaacson e41ba2fb60 Bug 1772032 - Use DOM document node for getting SessionAcc instance. r=Jamie
Remove assert for doc to be last accessible to be removed because
in a doc shutdown scenario it will be the first to be removed.

Differential Revision: https://phabricator.services.mozilla.com/D148045
2022-06-02 22:10:04 +00:00