Commit Graph

1163 Commits

Author SHA1 Message Date
James Teh
0da92731bb Bug 1849590: When hit testing using the cache, only match an inline Accessible if one of its lines includes the requested point. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D192431
2023-11-03 21:32:10 +00:00
James Teh
4f15c940fa Bug 1860724: Use RemoteChildAt instead of RemoteNextSibling when handling RemoteAccessible reorder events. r=eeejay
RemoteNextSibling is slow because it uses IndexInParent, which is not currently cached.

Differential Revision: https://phabricator.services.mozilla.com/D191719
2023-10-25 23:31:53 +00:00
James Teh
9dfdbe18c8 Bug 1860001: Handle invalid events. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D191601
2023-10-23 22:48:11 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Christian Holler (:decoder)
5e6a80d7a8 Bug 1847728 - Handle nullptr in RemoteAccessible::ApplyCache. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D185691
2023-09-04 15:25:22 +00:00
James Teh
f47f70424f Bug 1848991: Attach a RemoteAccessible to its parent before calling ProxyCreated. r=eeejay
This is what we did before the fix for bug 1779578.
Failure to do this meant that RemoteAccessible::IsLink() returned false even for a child of a HyperText Accessible, which meant the ATK object was created without the HyperLink interface.
This change requires that we move the handling of pending OOP child docs, since we can't add a child document until ProxyCreated has been called on the OuterDoc.

Differential Revision: https://phabricator.services.mozilla.com/D186423
2023-08-31 22:01:52 +00:00
James Teh
378e556724 Bug 1372296: Unify ScrollSubstringToPoint for local and remote Accessibles, thus enabling support for RemoteAccessible on Windows. r=eeejay
Eventually, the bulk of this functionality should be moved to TextLeafRange.
In the meantime, let's get rid of the platform specific ugliness here.

Differential Revision: https://phabricator.services.mozilla.com/D185263
2023-08-08 05:18:55 +00:00
Narcis Beleuzu
7fcb244e50 Backed out changeset 270594af44f1 (bug 1372296) for bustages on ia2AccessibleText.cpp 2023-08-08 07:44:53 +03:00
James Teh
0a2d00604f Bug 1372296: Unify ScrollSubstringToPoint for local and remote Accessibles, thus enabling support for RemoteAccessible on Windows. r=eeejay
Eventually, the bulk of this functionality should be moved to TextLeafRange.
In the meantime, let's get rid of the platform specific ugliness here.

Differential Revision: https://phabricator.services.mozilla.com/D185263
2023-08-08 00:59:25 +00:00
James Teh
97a388f4f8 Bug 1845863: Expose HTML placeholder for RemoteAccessible. r=nlapre
We previously cached aria-placeholder, but not HTML placeholder.
These both map to the placeholder object attribute exposed by Accessible::Attributes, but they are retrieved differently internally.

This also fixes LocalAccessible::Attributes to always prefer HTML placeholder over aria-placeholder as per the ARIA spec.
Previously, the attribute we preferred was somewhat indeterminate (from the user's perspective) due to the ordering of hash maps.

Differential Revision: https://phabricator.services.mozilla.com/D184795
2023-08-02 01:42:17 +00:00
James Teh
313b0fbdf5 Bug 1743749 part 2: Replace usage of atoms as cache keys with the new CacheKey aliases. r=nlapre
This was done with the following Python script:

```
import re

cacheConsts = open("accessible/base/CacheConstants.h", "rt").read()
aliases = {
  alias: atom
  for atom, alias in
  re.findall(
    r'static constexpr nsStaticAtom\*\s+(.*?)\s+=\s+(nsGkAtoms::.*?);',
    cacheConsts
  )
}

RE_ATOM = re.compile(r'(fields->SetAttribute|(?:mCachedFields|aFields)->(?:GetAttribute|GetAttributeRefPtr|GetMutableAttribute|HasAttribute|Remove|SetAttribute)(?:<.+>)?)(\(\s*)(nsGkAtoms::[a-zA-Z_]+)')

def repl(m):
  # Group 3 is the atom.
  alias = aliases.get(m.group(3))
  if not alias:
    # No alias for this atom. Return input unaltered.
    return m.group(0)
  alias = "CacheKey::" + alias
  # Groups 1 and 2 should be returned unaltered. Group 3 (the atom) is replaced
  # with the alias.
  return m.group(1) + m.group(2) + alias

for fn in (
  # Found with: git grep -l 'ields->'
  "accessible/base/CachedTableAccessible.cpp",
  "accessible/base/nsAccessibilityService.cpp",
  "accessible/base/TextLeafRange.cpp",
  "accessible/generic/LocalAccessible.cpp",
  "accessible/ipc/DocAccessibleParent.cpp",
  "accessible/ipc/RemoteAccessible.cpp",
  "accessible/ipc/RemoteAccessible.h",
  "accessible/windows/sdn/sdnAccessible.cpp",
):
  input = open(fn, "rt").read()
  output = RE_ATOM.sub(repl, input)
  open(fn, "wt").write(output)
```

Differential Revision: https://phabricator.services.mozilla.com/D184791
2023-07-31 23:09:56 +00:00
James Teh
e4fa79ba05 Bug 1779578 part 2: Split serialization of a11y subtrees across multiple IPDL calls if we are likely to exceed the IPDL maximum message size. r=eeejay
In the content process, we simply split into multiple calls when the number of Accessibles exceeds our maximum.
The maximum is calculated to allow for every Accessible to consume 2 KB in the IPDL message.
Currently, this means we split every 131072 Accessibles.
Of course, we could still exceed this IPDL message size if one or more  Accessibles consumed a lot more than this; e.g. many labels longer than 2 KB.
However, this seems unlikely in the real world.
If this turns out to be a problem, we'll need to count the actual size of the serialized data for each Accessible.
For example, we could use AccAttributes::SizeOfExcludingThis, though that isn't exactly the serialized size.
I worry though that such data structure traversal could get expensive at scale.

In the parent process, we defer attaching the root of the new subtree to its parent until the final call.
This is achieved by saving the root during the first call and using that to attach and fire events in the final call.

Differential Revision: https://phabricator.services.mozilla.com/D184367
2023-07-31 04:49:52 +00:00
James Teh
95624b7f57 Bug 1779578 part 1: When serializing a11y subtrees, include parent id and index in parent for each Accessible. r=eeejay
When we serialize a subtree, we put it into a flat list.
Previously, we included the child count for each Accessible so that we knew how many Accessibels to consume as children when de-serializing.
We also de-serialized recursively.
This made it very difficult to split serialization across IPDL calls, since we would always end up splitting in the middle of some Accessible's children.
Instead, we now no longer include the child count, but we do include the parent id and the index of the child in that parent.
This means that each Accessible can be de-serialized independently and iteratively, making it possible to split wherever we need to.
RemoteAccessible creation has also been separated from attachment of the child to its parent, since we will need this when splitting.

Differential Revision: https://phabricator.services.mozilla.com/D184366
2023-07-31 04:49:51 +00:00
James Teh
4458083853 Bug 1694573 part 4: Make PlatformTextSelectionEvent take TextRange instead of TextRangeData. r=eeejay
TextRangeData is specific to IPDL and thus RemoteAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D183703
2023-07-19 02:56:54 +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
0b5455131f Bug 1842160: Support the LABELLED_BY/LABEL_FOR relations on HTML figure/figcaption for RemoteAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D183316
2023-07-14 01:20:24 +00:00
Nathan LaPre
3986073957 Bug 1840732 Part 7: Remove unnecessary includes from accessible/ipc, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/ipc directory. These suggestions came from the Include What You Use
tool.

Note that this is probably not everything here. It needs to be checked again
after rebasing on the latest unification changes.

Depends on D182401

Differential Revision: https://phabricator.services.mozilla.com/D182402
2023-07-07 03:22:09 +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
James Teh
ad06ac989f Bug 1840298: Unify ScrollToPoint for local and remote Accessibles, thus enabling support for RemoteAccessible on Windows. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D181952
2023-07-04 22:25:33 +00:00
Morgan Rae Reschenberg
c2caef688a Bug 1840343: Track containers and text leaves separately when fuzzy hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D182269
2023-06-29 18:09:46 +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
James Teh
3f8b159846 Bug 1831035 part 6: Move platform specific methods into RemoteAccessibleBase. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D181851
2023-06-26 21:20:13 +00:00
James Teh
d9633f5b97 Bug 1831035 part 5: Remove the (now empty) platform specific DocAccessibleChild classes and rename DocAccessibleChildBase to DocAccessibleChild. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D181850
2023-06-26 21:20:13 +00:00
James Teh
544fdb5dc4 Bug 1831035 part 4: Move platform specific methods into DocAccessibleChildBase. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D181849
2023-06-26 21:20:13 +00:00
James Teh
9de9c2f856 Bug 1831035 part 3: Unify PDocAccessible. r=eeejay
There are now only small differences across platforms and even those will probably go away eventually.
Rather than having separate ipdls with a lot of duplicate content, we now have a single ipdl with ifdefs.

Differential Revision: https://phabricator.services.mozilla.com/D181848
2023-06-26 21:20:12 +00:00
James Teh
d762f87c52 Bug 1831035 part 2: Remove DocAccessibleChild::RecvAddToSelection. r=eeejay,ipc-reviewers,mccr8
The sync IPDL RemoteAccessible::AddToSelection was removed in bug 1811092, but the DocAccessibleChildBase method remained.
This is no longer used, so remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181937
2023-06-26 21:20:12 +00:00
James Teh
aecc1ba54a Bug 1831035 part 1: Remove PDocAccessible::SyncTextChangeEvent. r=nlapre,ipc-reviewers,mccr8
I neglected to remove this in bug 1821956.

Differential Revision: https://phabricator.services.mozilla.com/D181847
2023-06-26 21:20:12 +00:00
Morgan Rae Reschenberg
9ab02c66d0 Bug 1837024: Only do fuzzy hittesting on descendants of clipped accs r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D181166
2023-06-21 22:42:07 +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
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
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
James Teh
7ae0834dd8 Bug 1832228 part 3: Rename TableAccessibleBase to TableAccessible and TableCellAccessibleBase to TableCellAccessible. r=nlapre
Now that the local-only TableAccessible and TableCellAccessible have been removed, we no longer need this Base suffix for the unified classes.
Aside from renaming the header files, most of the rest of this was done with the following script:

```
function replace {
  sed -i 's/'$1'/'$2'/g' `git grep -l $1`
}
replace TableAccessibleBase TableAccessible
replace TableCellAccessibleBase TableCellAccessible
replace AsTableBase AsTable
replace AsTableCellBase AsTableCell
```

Differential Revision: https://phabricator.services.mozilla.com/D179803
2023-06-08 09:50:28 +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
Nathan LaPre
9dc4cae6ba Bug 1455416: Relocate aria-owned accessibles on (aria) parent removal, r=Jamie
This revision modifies UncacheChildrenInSubtree such that removed but relocated
accessibles that are aria-owned are actually relocated to their proper parent
after the removal of the formerly-aria-owning parent. It also contains some
fixes for issues that allowing this relocation unleashes. In particular:
- Logic in PutChildrenBack is reworked in order to better handle different
  reparenting situations, such as unacceptable parents or original containers
  (or ancestors thereof) that are no longer in the document. These changes help
  us avoid failure modes related to events on defunct accessibles, or bad
  coalescence due to partially-shut-down trees.
- ShutdownOrPrepareForMove has been updated to handle moving children. We now
  recurse through children and move them rather than just shutting them down.
This revision adds tests which verify that the functionality works as intended.

Differential Revision: https://phabricator.services.mozilla.com/D176204
2023-06-06 18:43:40 +00:00
Morgan Rae Reschenberg
9d0d6d2840 Bug 1832686: Fuzzy-match text leaves contained within generics when hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178578
2023-05-31 02:12:00 +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
Eitan Isaacson
4b8822a071 Bug 1826869 - Cache doc mime type and make available via DocAccessibleParent. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178887
2023-05-26 22:17:13 +00:00
Eitan Isaacson
63f60f5072 Bug 1826866 - DocAccessible::DocType and remote equivalents. r=Jamie,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178886
2023-05-26 22:17:13 +00:00
Eitan Isaacson
9b58fed3a9 Bug 1821965 - P2: Remove sync IPC extension messages for text operations. r=morgan,ipc-reviewers,mccr8
We can get rid the entire local HyperTextAccessible-based implementation as well!

Depends on D178717

Differential Revision: https://phabricator.services.mozilla.com/D178718
2023-05-26 22:17:13 +00:00
Eitan Isaacson
dbdf01888d Bug 1832353 - P3: Make editable text methods async and return void. r=Jamie,ipc-reviewers,mccr8
Depends on D178715

Differential Revision: https://phabricator.services.mozilla.com/D178724
2023-05-26 22:17:12 +00:00
Noemi Erli
ab21b0f95b Backed out 6 changesets (bug 1832353, bug 1821965) for causing build bustages in GeckoTextMarker.mm
Backed out changeset 6df0877f288a (bug 1821965)
Backed out changeset e663ccc0334e (bug 1821965)
Backed out changeset 36b250225e50 (bug 1821965)
Backed out changeset 6df5d07bf19f (bug 1832353)
Backed out changeset 409966c76f0f (bug 1832353)
Backed out changeset 3be446e44436 (bug 1832353)
2023-05-26 02:48:29 +03:00
Noemi Erli
e56011d5e2 Backed out changeset 22203924d7b7 (bug 1832686) for causing failures in browser_test_general.js 2023-05-26 02:10:49 +03:00
Morgan Rae Reschenberg
628ffa8efe Bug 1832686: Fuzzy-match text leaves contained within generics when hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178578
2023-05-25 22:20:59 +00:00
Eitan Isaacson
0caef88bb0 Bug 1821965 - P2: Remove sync IPC extension messages for text operations. r=morgan,ipc-reviewers,mccr8
We can get rid the entire local HyperTextAccessible-based implementation as well!

Depends on D178717

Differential Revision: https://phabricator.services.mozilla.com/D178718
2023-05-25 20:38:29 +00:00
Eitan Isaacson
2237be2626 Bug 1832353 - P3: Make editable text methods async and return void. r=Jamie,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178724
2023-05-25 20:38:29 +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