Commit Graph

279 Commits

Author SHA1 Message Date
serge-sans-paille
8a0a0f7524 Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
James Teh
d648744f28 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
Nathan LaPre
b32ecd1bf9 Bug 1794974: Part 1: Add improved client detection, automatic domain setting, r=Jamie
This revision is a step towards ensuring we get the right domains for known
accessibility instantiators. We want to anticipate the needs of known clients
and make sure we have all the cache domains ready, especially for heavy-use
clients like screen readers. The domains we'll need are a bit of a work in
progress, but can be updated easily. For now, err on the side of caution. This
revision also implements better client detection on macOS, so we can handle
multiple clients.

Differential Revision: https://phabricator.services.mozilla.com/D220035
2024-09-09 23:02:19 +00:00
James Teh
d8a12f0303 Bug 1901457 part 2: Refactor TextLeafPoint caret retrieval so that the end of line insertion point can be stored without being tied to the current caret position. r=nlapre
Previously, TextLeafPoint::GetCaret() returned a placeholder representation of the caret.
ActualizeCaret() was then used to get the real caret position, optionally adjusting for the line end depending on the caller's needs.
This causes problems when we need to store the TextLeafPoint information in a UIA text range object because the only way to indicate the line end insertion point is to use the GetCaret() placeholder, but that also means the stored position changes if the caret moves.
For example, if you disabled NVDA's "caret moves review cursor" setting and then moved the caret, the review cursor should stay at the old position, but it didn't previously.

To fix this:

1. TextLeafPoint now has a new mIsEndOfLineInsertionPoint flag which is set to true by GetCaret() if appropriate.
2. GetCaret() sets mAcc and mOffset immediately, rather than needing to call ActualizeCaret() later.
3. TextLeafPoint methods still need to adjust the point to correctly handle the line end insertion point in some cases, but that is now handled by the private TextLeafPoint::AdjustEndOfLine method.
4. FindBoundary now correctly returns the previous character/cluster when requested for this end of line insertion point. Strictly speaking, this bug always existed, but no existing callers ever triggered it.

Differential Revision: https://phabricator.services.mozilla.com/D214342
2024-06-26 10:15:43 +00:00
Ting-Yu Lin
8016adbafa Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-30 06:32:20 +00:00
Sebastian Hengst
ccb101be8f Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin
83578c4adb Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-28 04:46:19 +00:00
James Teh
426407a812 Bug 1810596: When computing the text for a live region on Android, always include the text from the subtree. r=eeejay,geckoview-reviewers,ohall
Previously, we only included the subtree for roles which are allowed to be traversed during recursive name computation.
This meant that no text would be produced for live regions with roles such as status, where name computation traversal is not allowed.
Now, we first get the name to handle cases where the name is explicitly specified; e.g. images with alt text.
We then add the subtree text if the name wasn't already computed from it.

Differential Revision: https://phabricator.services.mozilla.com/D210628
2024-05-22 22:14:01 +00:00
James Teh
55684ad8e9 Bug 1886371 part 6: Add UIA control types to RoleMap. r=nlapre
The actual ControlType property implementation is the subject of a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D205184
2024-03-25 03:28:05 +00:00
Eitan Isaacson
49fbd63cf8 Bug 1861211 - Make isAccessibilityElement conditional on a per-role basis. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D191882
2024-03-04 21:19:09 +00:00
Eitan Isaacson
ba3c5e3b7b 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
Eitan Isaacson
45e41353ee Bug 1868092 - Don't call DoPivot on a null leaf in caret move. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D195599
2023-12-06 22:06:07 +00:00
James Teh
f36ae8432b Bug 1862802 part 5: Remove virtual cursor change event. r=eeejay
Depends on D192645

Differential Revision: https://phabricator.services.mozilla.com/D192646
2023-11-29 03:53:20 +00:00
James Teh
603681f423 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
James Teh
4edd64405a Bug 1862802 part 3: Directly handle scrolling start events on Android instead of converting them to virtual cursor change events. r=eeejay
Depends on D192643

Differential Revision: https://phabricator.services.mozilla.com/D192644
2023-11-29 03:53:19 +00:00
James Teh
c1a190ef64 Bug 1862802 part 2: Support find in page on Android using only caret events instead of converting them to virtual cursor change events. r=eeejay
Depends on D192642

Differential Revision: https://phabricator.services.mozilla.com/D192643
2023-11-29 03:53:19 +00:00
James Teh
447aa32c0e Bug 1862802 part 1: Provide an argument to PlatformCaretMoveEvent specifying whether the event was caused by user input. r=eeejay
This is needed in order to support find in page on Android using remote caret events instead of virtual cursor change events.

Depends on D192641

Differential Revision: https://phabricator.services.mozilla.com/D192642
2023-11-29 03:53:19 +00:00
Butkovits Atila
1cb12b49dd 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
44caba5c0c Bug 1862802 part 5: Remove virtual cursor change event. r=eeejay
Depends on D192645

Differential Revision: https://phabricator.services.mozilla.com/D192646
2023-11-28 22:03:21 +00:00
James Teh
0bafc2f978 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
3f0c5fad25 Bug 1862802 part 3: Directly handle scrolling start events on Android instead of converting them to virtual cursor change events. r=eeejay
Depends on D192643

Differential Revision: https://phabricator.services.mozilla.com/D192644
2023-11-28 22:03:20 +00:00
James Teh
ea3ee1204a Bug 1862802 part 2: Support find in page on Android using only caret events instead of converting them to virtual cursor change events. r=eeejay
Depends on D192642

Differential Revision: https://phabricator.services.mozilla.com/D192643
2023-11-28 22:03:19 +00:00
James Teh
cfdccbd78f Bug 1862802 part 1: Provide an argument to PlatformCaretMoveEvent specifying whether the event was caused by user input. r=eeejay
This is needed in order to support find in page on Android using remote caret events instead of virtual cursor change events.

Depends on D192641

Differential Revision: https://phabricator.services.mozilla.com/D192642
2023-11-28 22:03:19 +00:00
James Teh
0b2de0e6be 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
James Teh
23fd30a006 Bug 1845883: Remove HyperTextAccessibleWrap. r=nlapre
This is now just an alias for HyperTextAccessible on all platforms.
This was done with the following bash script:

```
cd accessible
find -name HyperTextAccessibleWrap.h -delete
sed -i 's/#include "HyperTextAccessibleWrap.h"/#include "HyperTextAccessible.h"/;/"HyperTextAccessibleWrap.h",/d;s/HyperTextAccessibleWrap/HyperTextAccessible/g' `git grep -l HyperTextAccessibleWrap`
```

Differential Revision: https://phabricator.services.mozilla.com/D184796
2023-08-02 01:42:17 +00:00
James Teh
c68c3ca8b3 Bug 1844238 part 1: Change includes of Role.h to mozilla/a11y/Role.h. r=eeejay
Role.h will soon be generated, but it is generated within the obj dir, so local includes won't work.
Our C++ style guide says we should prefer exported includes wherever possible anyway.

This was done with this shell command inside the accessible/ directory:

```
sed -i 's,#include "Role.h",#include "mozilla/a11y/Role.h",' `git grep -l '#include "Role.h"'`
```

Differential Revision: https://phabricator.services.mozilla.com/D183940
2023-07-26 02:19:41 +00:00
James Teh
7c63b7fc05 Bug 1694573 part 5: Make LocalAccessible call Platform*Event. Remove most of the platform HandleAccEvent overrides. r=eeejay
Mac and Android still override HandleAccEvent for platform specific behaviour other than firing the event.
The Android behaviour can be unified properly in future work.

ATK is the platform layer with the most churn because there were inconsistencies in the way local and remote events were handled.
I'm reasonably sure these were unintentional inconsistencies, so I've done my best to unify them.

Differential Revision: https://phabricator.services.mozilla.com/D183704
2023-07-19 02:56:54 +00:00
James Teh
4d2410a13e Bug 1694573 part 2: Make Platform*Event functions take Accessible instead of RemoteAccessible. r=eeejay
Some of these methods don't yet handle LocalAccessible properly, but that will be fixed in subsequent patches.

Differential Revision: https://phabricator.services.mozilla.com/D183701
2023-07-19 02:56:53 +00:00
James Teh
7e43083f11 Bug 1694573 part 1: Rename Proxy*Event to Platform*Event. r=eeejay
This was done with the following command in the accessible/ directory:

```
sed -i 's/\bProxy\(.*\)Event\b/Platform\1Event/' `git grep -l 'Proxy.*Event'`
```

Differential Revision: https://phabricator.services.mozilla.com/D183700
2023-07-19 02:56:53 +00:00
James Teh
0cc53ffbc5 Bug 1843825 part 1: Remove unused Gecko a11y roles. r=eeejay
Some of these roles were duplicates, while others were just never used.
This removes the following roles:

- TITLEBAR
- GRIP
- SOUND
- CURSOR
- CARET
- WINDOW
- CHART
- BORDER
- COLUMN
- HELPBALLOON
- CHARACTER
- INDICATOR
- DROPLIST
- DIAL
- HOTKEYFIELD
- EQUATION
- BUTTONDROPDOWNGRID
- CLOCK
- SPLITBUTTON
- IPADDRESS
- ACCEL_LABEL
- ARROW
- COLOR_CHOOSER
- DESKTOP_ICON
- DESKTOP_FRAME
- DIRECTORY_PANE
- FILE_CHOOSER
- FONT_CHOOSER
- GLASS_PANE
- HTML_CONTAINER
- ICON
- LAYERED_PANE
- OPTION_PANE
- POPUP_MENU
- ROOT_PANE
- SCROLL_PANE
- SPLIT_PANE
- TABLE_COLUMN_HEADER
- TABLE_ROW_HEADER
- TEAR_OFF_MENU_ITEM
- TERMINAL
- VIEWPORT
- HEADER
- FOOTER
- RULER
- AUTOCOMPLETE
- EDITBAR
- PAGE
- REDUNDANT_OBJECT
- IME
- CALENDAR
- EMBEDDED_OBJECT

Differential Revision: https://phabricator.services.mozilla.com/D183716
2023-07-19 02:51:29 +00:00
James Teh
6c99023552 Bug 1840295: Remove Windows specific ifdefs for PDocAccessible:: FocusEvent and CaretMoveEvent. r=eeejay
On Windows, focus and caret move events include the caret rectangle.
This isn't used on other platforms.
To simplify the cross-platform interface (including Platform.h), remove the ifdefs from there.
However, we use ifdefs to avoid calculating the rectangle on non-Windows platforms, instead just sending an empty rectangle.

Differential Revision: https://phabricator.services.mozilla.com/D182138
2023-07-05 04:15:27 +00:00
Eitan Isaacson
6998527d19 Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-28 21:45:16 +00:00
Iulian Moraru
98478e7490 Backed out changeset f3095da827d9 (bug 1754905) for causing build bustages on DocAccessibleWrap. CLOSED TREE 2023-06-28 03:03:37 +03:00
Eitan Isaacson
556fa1bfbb Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-27 16:59:54 +00:00
Butkovits Atila
9ac839ebe2 Backed out changeset 4d92a76cedd0 (bug 1754905) for causing bustages at LocalAccessible. CLOSED TREE 2023-06-27 03:46:47 +03:00
Eitan Isaacson
87391fa922 Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-27 00:05:16 +00:00
James Teh
65baf08086 Bug 1831035 part 7: Remove (now empty) platform specific RemoteAccessible classes and rename RemoteAccessibleBase to RemoteAccessible. r=eeejay
This involved moving ApplyCache from the .h into the .cpp because now that the class is no longer a template, forward declaration of DocAccessibleParent is not sufficient.

Differential Revision: https://phabricator.services.mozilla.com/D181852
2023-06-26 21:20:13 +00:00
Stanca Serban
f0967c3305 Backed out changeset 8be4693aecbb (bug 1754905) for causing bustages in xpcAccessiblePivot.h. CLOSED TREE 2023-06-24 03:22:31 +03:00
Eitan Isaacson
f872bcc7cc Bug 1754905 - Match Pivot API in nsIAccessiblePivot. r=Jamie
This patch does several things:
1. Remove virtual cursor doc accessible member.
2. Remove state-keeping nsAccessiblePivot implementation and replace it
   with something that is much more similar to the native Pivot
   interface.
3. Move nsIAccessiblePivot implementation to xpcom and rename it
   xpcAccessiblePivot.
4. Delete mochitests and introduce browser tests.
5. Make new xpcom implementation work on remote accessibles as well.

Differential Revision: https://phabricator.services.mozilla.com/D181813
2023-06-23 23:22:34 +00:00
Eitan Isaacson
4dce76304c Bug 1839515 - Remove pivot text navigation API. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181576
2023-06-21 21:15:47 +00:00
Norisz Fay
f8505d5db9 Backed out changeset 8178c74a4c65 (bug 1839515) for causing mochitest failures on browser_events_vcchange.js 2023-06-21 22:21:29 +03:00
Eitan Isaacson
da7273bd10 Bug 1839515 - Remove pivot text navigation API. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181576
2023-06-21 17:55:06 +00:00
Eitan Isaacson
446672d058 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
b3cea24dfd 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
85a5ad4790 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
0b3727802d 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
893830a805 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
f79fdd39f3 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
329d21371b Backed out changeset dbb7e27f8464 (bug 1833313) for causing android gv-junit crashes. CLOSED TREE 2023-05-24 14:08:03 +03:00
James Teh
fbf1ab52f8 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