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

1175 Коммитов

Автор SHA1 Сообщение Дата
Eitan Isaacson 25b310a6c2 Bug 1851273 - P1: Add accessible/ios directory. r=Jamie,morgan,nlapre
Differential Revision: https://phabricator.services.mozilla.com/D187328
2024-03-04 21:11:49 +00:00
James Teh 4f57a512d7 Bug 1870783 part 2: Expose ispopup object attribute. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D197038
2024-02-12 06:24:15 +00:00
Stanca Serban 5a48aa44db Backed out 6 changesets (bug 1875528) for causing leakcheck failures. CLOSED TREE
Backed out changeset dcbbb7316940 (bug 1875528)
Backed out changeset a5c0564f9761 (bug 1875528)
Backed out changeset f3bc6e972f79 (bug 1875528)
Backed out changeset 535378dd79b0 (bug 1875528)
Backed out changeset 3cef14ed0f25 (bug 1875528)
Backed out changeset f0941fdbbabb (bug 1875528)
2024-01-25 01:26:46 +02:00
Nika Layzell 3c0d6b5c0b Bug 1875528 - Part 1: Make IProtocol hold a strong reference to manager, r=ipc-reviewers,mccr8
This makes accessing `Manager()` on an IPDL protocol safer, and replaces the
previous ActorLifecycleProxy reference, which would only keep the manager alive
until IPDL drops its reference.

Unfortunately this introduces some leaks due to reference cycles, which will be
fixed in follow-up parts.

Differential Revision: https://phabricator.services.mozilla.com/D198624
2024-01-24 20:54:40 +00:00
Frédéric Wang c1463070d9 Bug 1871361 - Fix typo "recieved" in accessibility code. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D197062
2024-01-05 07:32:39 +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 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 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 297b3d04a4 Bug 1864511: When hit testing a RemoteAccessible image, image map or inline element without children, just use the rect instead of walking children. r=morgan
An image or image map can't contain text, so it doesn't make sense to walk the lines of any children.
Previously, for normal images (not image maps), we would find no children and thus return false because there were no children containing the point, thus breaking hit testing for images.
For image maps, hit testing would fail for any points that weren't covered by areas.
Now, we don't walk children in these cases, instead just using the element's rect.
We apply this same rule for other inline elements without children, since there are no children to walk in that case and we should use the rect there rather than always returning false.
I don't know if this last case is something that ever happens in practice, but I figured it was best to handle it just in case.

Differential Revision: https://phabricator.services.mozilla.com/D193509
2023-11-17 06:37:27 +00:00
James Teh 384d7e17fe Bug 1863482 part 1: Change includes of RelationType.h to mozilla/a11y/RelationType.h. r=eeejay
RelationType.h will soon be generated, but it will be 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 "RelationType.h",#include "mozilla/a11y/RelationType.h",' `git grep -l '#include "RelationType.h"'`
```

Differential Revision: https://phabricator.services.mozilla.com/D193001
2023-11-14 02:31:54 +00:00
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