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

10964 Коммитов

Автор SHA1 Сообщение Дата
Gregory Pappas 959520513e Bug 1851541 - Remove html5.inert.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187422
2023-09-05 07:49:53 +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
Tom Marble 022d30e88c Bug 1848994 Allow comments in manifestparser conditions. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D186999
2023-08-29 14:08:57 +00:00
Andrew Halberstadt d814ef1e9d Bug 1850409 - Skip accessible/tests/mochitest/events/docload/test_docload_shutdown.html with Wayland, r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D186969
2023-08-28 20:16:32 +00:00
Gregory Pappas 5ac57f5488 Bug 1724089 - Stop using browser.tabs.remote.autostart pref in accessible/tests/browser/ r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D186184
2023-08-26 03:19:24 +00:00
Dão Gottwald c6b03742f0 Bug 1782783 - Re-enable browser_test_focus_urlbar.js on Linux. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D186868
2023-08-25 20:26:22 +00:00
Emilio Cobos Álvarez 95707c96bb Bug 1849204 - Add generic atom hash keys that use the better distributed atom hash, and use it across the tree. r=mstange,xpcom-reviewers,credential-management-reviewers,sgalich,nika
Differential Revision: https://phabricator.services.mozilla.com/D186496
2023-08-18 18:43:27 +00:00
Tom Marble 3b701778f9 Bug 1847593 - convert .ini manifests to .toml: batch 2 r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D185864
2023-08-14 19:55:09 +00:00
James Teh 8cb1edbab3 Bug 1847489: Detect UIA clients in Windows 10. r=nlapre
The new detection code introduced in bug 1838123 doesn't work on Windows 10.
This patch:

1. Splits the Windows 11 code into its own function.
2. Refactors the system handle enumeration code into its own function which can be called with a lambda, since it is needed for both Windows 11 and Windows 10.
3. Adds code to detect clients on Windows 10 based on the old detection code before bug 1838123, with some noteworthy changes:
    - Hooking the UIA window message doesn't work; our hook runs too late. It also doesn't work well for blocking; some clients will very likely poke us more than the maximum attempts in the old code (5 times).
    - Instead, we run this code as part of LazyInstantiator::ShouldInstantiate, just as we do for all other client detection.
    - This means we use the same UIA detection caching strategy; i.e. reset on foreground changes.
    - It also means we reuse the same instantiator setting and block listing code in LazyInstantiator.

Differential Revision: https://phabricator.services.mozilla.com/D185627
2023-08-10 01:00:13 +00:00
Natalia Csoregi 9358a33249 Backed out changeset e57e57aa46ba (bug 1847489) for causing win bustage on CompatibilityUIA.cpp. CLOSED TREE 2023-08-09 14:37:36 +03:00
James Teh fc74f60e4b Bug 1847489: Detect UIA clients in Windows 10. r=nlapre
The new detection code introduced in bug 1838123 doesn't work on Windows 10.
This patch:

1. Splits the Windows 11 code into its own function.
2. Refactors the system handle enumeration code into its own function which can be called with a lambda, since it is needed for both Windows 11 and Windows 10.
3. Adds code to detect clients on Windows 10 based on the old detection code before bug 1838123, with some noteworthy changes:
    - Hooking the UIA window message doesn't work; our hook runs too late. It also doesn't work well for blocking; some clients will very likely poke us more than the maximum attempts in the old code (5 times).
    - Instead, we run this code as part of LazyInstantiator::ShouldInstantiate, just as we do for all other client detection.
    - This means we use the same UIA detection caching strategy; i.e. reset on foreground changes.
    - It also means we reuse the same instantiator setting and block listing code in LazyInstantiator.

Differential Revision: https://phabricator.services.mozilla.com/D185627
2023-08-09 04:02:46 +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 78ea095d2c Bug 1843227: When scrolling with nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE, scroll to center instead of nearest. r=eeejay
This is consistent with other browsers and thus more web compatible.
In particular, it makes infinite scroll work correctly on YouTube (e.g. when scrolling with screen readers), which didn't work previously.

Differential Revision: https://phabricator.services.mozilla.com/D185516
2023-08-08 01:00:21 +00: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
CanadaHonk a117230132 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 22:11:05 +00:00
Nathan LaPre 13b57d16c2 Bug 1845221: Remove failing mochitest, migrate tests to browser tests,r=eeejay
This revision removes test_link.html since it has been failing mysteriously in
CI. It's unclear why this is happening, and no amount of logging or local
testing has revealed the issue. This revision migrates the tests to the browser
tests, lumping it in with similar tests in browser_caching_actions.js.

Differential Revision: https://phabricator.services.mozilla.com/D185482
2023-08-07 20:14:23 +00:00
Stanca Serban 183a888a39 Backed out 3 changesets (bug 1824121) for causing wpt failures in html5lib_search-element.html. CLOSED TREE
Backed out changeset e3aec91d79e4 (bug 1824121)
Backed out changeset e3a3324b1732 (bug 1824121)
Backed out changeset 6ff5c272ab8e (bug 1824121)
2023-08-07 21:20:18 +03:00
CanadaHonk 631b819e14 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 14:05:32 +00:00
Cosmin Sabou b0f9a6e63d Backed out changeset c309e9b48aec (bug 1824121) for causing element related mochitest failures. CLOSED TREE 2023-08-07 16:05:13 +03:00
CanadaHonk 23a0c9beff Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 12:30:50 +00:00
Makoto Kato 678cb12ea2 Bug 1719535 - Part 13. Fix browser_text_basics.js for new word segmenter. r=Jamie
New word segmenter that is compatible with UAX#29 returns different results
against the old word segmenter. Adding both results.

Differential Revision: https://phabricator.services.mozilla.com/D185272
2023-08-07 06:24:04 +00:00
Makoto Kato 086f83b704 Bug 1719535 - Part 10.1. Update test results of a11y with new segmenter. r=Jamie
Fixing tests for new segmenter rules.

Depends on D180773

Differential Revision: https://phabricator.services.mozilla.com/D180774
2023-08-07 06:24:00 +00:00
Masayuki Nakano 0f39d7eda7 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-07 01:03:58 +00:00
Eitan Isaacson 20819d2182 Bug 1845614 - Null check accessible before getting attributes. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D184639
2023-08-04 17:11:45 +00:00
Eitan Isaacson 0135568045 Bug 1846312 - Use AXAttachment to represent non-text controls in an attributed string. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D184958
2023-08-04 17:11:23 +00:00
Daniel Holbert fe5e99100b Bug 1847161: Request complete mochitest log for three a11y mochitests that are implicated in an intermittent failure. r=Jamie
In each case, I'm putting the declaration at the start of the script block with
the main test logic, to be sure that it gets run ASAP and enables the full log before the failure happens (hopefully).

Once we've gotten what we need from the logs (or determined them to be not
useful), we can remove these requestCompleteLog() statements.

Differential Revision: https://phabricator.services.mozilla.com/D185391
2023-08-04 06:58:50 +00:00
Cristian Tuns f5572b469f Backed out 2 changesets (bug 1266437, bug 1232918) for causing mochitest failures in test_autoplay_policy_key_blacklist.html CLOSED TREE
Backed out changeset 33e3c6593d4b (bug 1232918)
Backed out changeset 1b56e99dd221 (bug 1266437)
2023-08-03 23:29:52 -04:00
James Teh 4286f529f3 Bug 1846660 part 4: Implement IAccessibleTextSelectionContainer interface. r=nlapre
get_selections is largely based on the old IAccessible2_3::get_selectionRanges method.
However, this makes use of HyperTextAccessibleBase::CroppedSelectionRanges, which didn't exist before.
It has also been updated to return IAccessibleText pointers as required by the new interface.

setSelections is entirely new, but relies on existing mechanisms to convert offsets and to add and remove selections.

Differential Revision: https://phabricator.services.mozilla.com/D185135
2023-08-04 02:51:43 +00:00
James Teh c36ade2bea Bug 1846660 part 3: Provide a way to safely get an Accessible from a COM pointer provided to us by a client. r=nlapre
IAccessibleTextSelectionContainer::setSelections passes us IAccessibleText COM pointers to identify the target Accessibles.
We need to safely get a Gecko Accessible from such a COM pointer.
The client could hand us anything, so it's not safe to just static_cast without being certain that it's one of our Accessibles.
Instead, we use an internal IID to validate that it's an MsaaAccessible and return the correct pointer, after which we can easily get the Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D185134
2023-08-04 02:51:42 +00:00
James Teh 65cbecf6ad Bug 1846660 part 2: Add IAccessibleTextSelectionContainer interface. r=nlapre
This just adds the COM interface to the build system.
It will be implemented in an upcoming patch.

Differential Revision: https://phabricator.services.mozilla.com/D185133
2023-08-04 02:51:42 +00:00
James Teh 96cc6ec069 Bug 1846660 part 1: Remove deprecated IAccessible2_3 implementation and interface. r=nlapre
No clients actually use this due to inherent flaws.

Differential Revision: https://phabricator.services.mozilla.com/D185132
2023-08-04 02:51:42 +00:00
Natalia Csoregi 84729900a3 Backed out 4 changesets (bug 1846660) for causing bustage on ia2AccessibleTextSelectionContainer.h. CLOSED TREE
Backed out changeset c097c6502edc (bug 1846660)
Backed out changeset 9bf0e6ec2653 (bug 1846660)
Backed out changeset eb0515d87ee5 (bug 1846660)
Backed out changeset f12d2f98186b (bug 1846660)
2023-08-04 04:30:18 +03:00
Masayuki Nakano 0664d98bce Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-04 00:10:11 +00:00
James Teh 074cfeaa5f Bug 1846660 part 4: Implement IAccessibleTextSelectionContainer interface. r=nlapre
get_selections is largely based on the old IAccessible2_3::get_selectionRanges method.
However, this makes use of HyperTextAccessibleBase::CroppedSelectionRanges, which didn't exist before.
It has also been updated to return IAccessibleText pointers as required by the new interface.

setSelections is entirely new, but relies on existing mechanisms to convert offsets and to add and remove selections.

Differential Revision: https://phabricator.services.mozilla.com/D185135
2023-08-03 23:00:01 +00:00
James Teh 5e107cd26a Bug 1846660 part 3: Provide a way to safely get an Accessible from a COM pointer provided to us by a client. r=nlapre
IAccessibleTextSelectionContainer::setSelections passes us IAccessibleText COM pointers to identify the target Accessibles.
We need to safely get a Gecko Accessible from such a COM pointer.
The client could hand us anything, so it's not safe to just static_cast without being certain that it's one of our Accessibles.
Instead, we use an internal IID to validate that it's an MsaaAccessible and return the correct pointer, after which we can easily get the Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D185134
2023-08-03 23:00:01 +00:00
James Teh b5c3023dfa Bug 1846660 part 2: Add IAccessibleTextSelectionContainer interface. r=nlapre
This just adds the COM interface to the build system.
It will be implemented in an upcoming patch.

Differential Revision: https://phabricator.services.mozilla.com/D185133
2023-08-03 23:00:00 +00:00
James Teh 85a75acb0e Bug 1846660 part 1: Remove deprecated IAccessible2_3 implementation and interface. r=nlapre
No clients actually use this due to inherent flaws.

Differential Revision: https://phabricator.services.mozilla.com/D185132
2023-08-03 23:00:00 +00:00
James Teh e110b02d35 Bug 1846922: Allow QueryInterface to IAccessibleEditableText and IAccessibleHypertext2 for RemoteAccessible. r=nlapre
The methods have already been updated to used unified cross-platform methods.
All that was preventing these from working was the IsLocal restriction in QueryInterface.

Differential Revision: https://phabricator.services.mozilla.com/D185253
2023-08-03 21:53:57 +00:00
Sandor Molnar 13c7e4a350 Backed out 14 changesets (bug 1719535) for causing mochitest failures in accessible/tests/browser/mac/browser_text_basics.js CLOSED TREE
Backed out changeset 338c2c8d91af (bug 1719535)
Backed out changeset 3fdb2e999aba (bug 1719535)
Backed out changeset 63b9d2064827 (bug 1719535)
Backed out changeset 09c216cdbbc8 (bug 1719535)
Backed out changeset 29977dc00fb3 (bug 1719535)
Backed out changeset d3f8850a343b (bug 1719535)
Backed out changeset 90f1f621031f (bug 1719535)
Backed out changeset 52ca9bdc5bd4 (bug 1719535)
Backed out changeset 94536f0d5a1f (bug 1719535)
Backed out changeset d615264f9f5f (bug 1719535)
Backed out changeset f16f9e583378 (bug 1719535)
Backed out changeset e1abdee07587 (bug 1719535)
Backed out changeset 45f9ad406428 (bug 1719535)
Backed out changeset caa2b8a731dc (bug 1719535)
2023-08-02 14:55:26 +03:00
Makoto Kato 121babf1a8 Bug 1719535 - Part 10.1. Update test results of a11y with new segmenter. r=Jamie
Fixing tests for new segmenter rules.

Depends on D180773

Differential Revision: https://phabricator.services.mozilla.com/D180774
2023-08-02 10:32:56 +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 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 6ce218982c Bug 1743749 part 1: Create aliases for RemoteAccessible cache keys. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D184667
2023-07-31 23:09:55 +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
Chris Peterson f2d830104b Bug 1845226 - Fix non-unified macOS build due to link error about missing IsDefunct() function definition. r=eeejay
Some member functions are defined in LocalAssessible-inl.h as inline functions, but where declared in LocalAccessible.h without inline specifiers. When compiling files, such as AccIterator.cpp, that include the LocalAccessible.h declarations but not the LocalAccessible-inl.h definitions, the compiler doesn't know that those member functions are not defined out-of-line. The linker expects to find those out-of-line definitions, but can't because they are defined inline.

Solution:

1. Include LocalAccessible-inl.h where needed.
2. Mark LocalAccessible.h's member function declarations as inline if they are defined inline in LocalAccessible-inl.h. This allows the compiler to warn when a file fails to include the LocalAccessible-inl.h definitions. Example warning:

obj-aarch64-apple-darwin22.5.0/dist/include/mozilla/a11y/LocalAccessible.h:174:30: error: inline function 'mozilla::a11y::LocalAccessible::ARIARole' is not defined [-Werror,-Wundefined-inline]
  inline mozilla::a11y::role ARIARole();
                             ^
accessible/generic/DocAccessible-inl.h:127:32: note: used here
    roles::Role role = aChild->ARIARole();

instead of linker errors (in non-unified builds) like:

ld64.lld: error: undefined symbol: mozilla::a11y::LocalAccessible::IsDefunct() const
>>> referenced by AccIterator.cpp:288 (/Users/chris/Code/mozilla/firefox/accessible/base/AccIterator.cpp:288)
>>>               ../../../accessible/base/AccIterator.o:(symbol mozilla::a11y::SingleAccIterator::Next()+0x48)

Differential Revision: https://phabricator.services.mozilla.com/D184603
2023-07-27 15:02:25 +00:00
Morgan Rae Reschenberg 66db5c7d8c Bug 1837414: Modify viewport cache to ignore frames that are visible, but have pointer-events:none r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D184449
2023-07-26 22:50:39 +00:00
Iulian Moraru 3f7ad1f211 Backed out changeset 85de6d1cd724 (bug 1837414) for causing browser-a11y failures on browser_test_general.js. CLOSED TREE 2023-07-26 06:32:25 +03:00
Morgan Rae Reschenberg 0ffb4aa274 Bug 1837414: Modify viewport cache to ignore frames that are visible, but have pointer-events:none r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D184449
2023-07-26 02:33:25 +00:00
James Teh 7c30e82179 Bug 1844238 part 2: Generate Role.h from nsIAccessibleRole.idl. r=eeejay
This eliminates duplication.

Differential Revision: https://phabricator.services.mozilla.com/D183941
2023-07-26 02:19:42 +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 055682edb3 Bug 1845228: Never descend into script or style elements when computing the accessible text equivalent of hidden subtrees. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D184452
2023-07-26 01:37:55 +00:00
Nathan LaPre f8b9470054 Bug 854796: Anchor, area elements without href shouldn't have link role, r=Jamie,devtools-reviewers
Per the HTML-AAM spec, a and area elements without href attributes should have
generic roles. This revision implements this preference by creating hypertext
accessibles when said elements lack href attributes (or click listeners). A
byproduct of this change is recognizing that a elements have no intrinsic role
mapping; they could be generics or links. This revision handles situations
where href or click listeners might appear or dissapear, and recreates the
accessibles when necessary. Since image map areas are handled by their
containing image maps, this revision specializes HTMLAreaAccessible::NativeRole
to account for the discrepancy that we can't account for in the markup map.
This revision also changes the relevant WPT test expectations, updates existing
tests that this change affects, and adds tests to verify that changing href
and click listeners dynamically changes the role appropriately.

Differential Revision: https://phabricator.services.mozilla.com/D183550
2023-07-24 19:31:29 +00:00
James Teh fb616a6994 Bug 1843540: Ensure that EventQueue::PushNameOrDescriptionChange never queues events for an Accessible outside its document. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D184070
2023-07-21 23:20:50 +00:00
James Teh 4d6b8a2e6c Bug 1843389: HTMLTableCellAccessible::Col/RowExtent: Get the table frame from layout instead of walking the a11y tree. r=nlapre
In some edge cases (such as in accessible/tests/crashtests/1472024-1.html), there can be an outer HTML table which contains an inner table according to layout, but the inner table isn't included in the a11y tree.
The inner table has no semantic value, so including it wouldn't be appropriate.
However, HTMLTableAccessible::Col/RowExtent previously retrieved the table using the a11y tree, which meant we used the layout frame for the outer table instead of the inner table.
This resulted in assertions.
To fix this, always ask the cell's layout frame for the correct table frame, rather than walking the a11y tree.
As a bonus, this simplifies and trims the code somewhat.

Differential Revision: https://phabricator.services.mozilla.com/D184066
2023-07-21 04:03:39 +00:00
James Teh 4ff50c7676 Bug 1765968: Call QueueCacheUpdate instead of SendCache wherever possible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D183950
2023-07-21 02:24:44 +00:00
Frederic Wang 4cb140558d Bug 1843694 Default a11y mochitest to runByManifest and set test_mathml pref in manifest. r=emilio,ahal
Enabling the preference in the test file seems to be causing some
flakiness, so do it in the manifest instead. Tweak the runner to make
that possible for a11y tests.

Differential Revision: https://phabricator.services.mozilla.com/D183722
2023-07-19 20:32:33 +00:00
Otto Länd 2ff3f8d593 Bug 1694573, 412902: apply code formatting via Lando
# ignore-this-changeset
2023-07-19 03:00:02 +00:00
James Teh daf109ee7f Bug 412902: Remove unused accessibility events. r=eeejay
This removes the unused AccTableChangeEvent class, as well as the following unused event constants:

- EVENT_ACTIVE_DECENDENT_CHANGED
- EVENT_LOCATION_CHANGE
- EVENT_HELP_CHANGE
- EVENT_DEFACTION_CHANGE
- EVENT_ACTION_CHANGE
- EVENT_ACCELERATOR_CHANGE
- EVENT_FOREGROUND
- EVENT_CAPTURE_START
- EVENT_CAPTURE_END
- EVENT_MOVESIZE_START
- EVENT_MOVESIZE_END
- EVENT_CONTEXTHELP_START
- EVENT_CONTEXTHELP_END
- EVENT_DRAGDROP_END
- EVENT_DIALOG_START
- EVENT_DIALOG_END
- EVENT_MINIMIZE_START
- EVENT_MINIMIZE_END
- EVENT_DOCUMENT_ATTRIBUTES_CHANGED
- EVENT_DOCUMENT_CONTENT_CHANGED
- EVENT_PROPERTY_CHANGED
- EVENT_PAGE_CHANGED
- EVENT_TEXT_CHANGED
- EVENT_TEXT_UPDATED
- EVENT_VISIBLE_DATA_CHANGED
- EVENT_TEXT_COLUMN_CHANGED
- EVENT_SECTION_CHANGED
- EVENT_TABLE_CAPTION_CHANGED
- EVENT_TABLE_MODEL_CHANGED
- EVENT_TABLE_SUMMARY_CHANGED
- EVENT_TABLE_ROW_DESCRIPTION_CHANGED
- EVENT_TABLE_ROW_HEADER_CHANGED
- EVENT_TABLE_ROW_INSERT
- EVENT_TABLE_ROW_DELETE
- EVENT_TABLE_ROW_REORDER
- EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED
- EVENT_TABLE_COLUMN_HEADER_CHANGED
- EVENT_TABLE_COLUMN_INSERT
- EVENT_TABLE_COLUMN_DELETE
- EVENT_TABLE_COLUMN_REORDER
- EVENT_WINDOW_CREATE
- EVENT_WINDOW_DESTROY
- EVENT_WINDOW_RESIZE
- EVENT_HYPERLINK_END_INDEX_CHANGED
- EVENT_HYPERLINK_NUMBER_OF_ANCHORS_CHANGED
- EVENT_HYPERLINK_SELECTED_LINK_CHANGED
- EVENT_HYPERTEXT_LINK_ACTIVATED
- EVENT_HYPERTEXT_LINK_SELECTED
- EVENT_HYPERLINK_START_INDEX_CHANGED
- EVENT_HYPERTEXT_CHANGED
- EVENT_HYPERTEXT_NLINKS_CHANGED

Differential Revision: https://phabricator.services.mozilla.com/D183709
2023-07-19 02:56:55 +00:00
James Teh c4c4fee14f Bug 1694573 part 6: Remove now empty Windows HyperTextAccessibleWrap. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D183705
2023-07-19 02:56:55 +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 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 ecc3d38304 Bug 1694573 part 3: Add a unified version of Windows UpdateSystemCaretFor. r=eeejay
This takes an Accessible and a rect and calls the local or remote versions appropriately.
This avoids the duplication of conditional behaviour in PlatformFocusEvent and PlatformCaretMoveEvent.

Differential Revision: https://phabricator.services.mozilla.com/D183702
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 93ea0f991e Bug 798492: Don't return BSTR from IAccessible::get_accRole. r=nlapre
This is a hack that was implemented a long time ago before IAccessible2.
However, it violates the MSAA API, breaks Microsoft's Inspect tool and violates the Core/HTML AAM specs.
In terms of backwards compatibility, anyone who wants to really access web content will be using IAccessible2 anyway.
Also, Chromium has never implemented this hack.

The mappings were largely taken from the Core and HTML AAM specs.
Where those specs didn't specify an MSAA role, ROLE_SYSTEM_GROUPING has been used, which is the closest we can get to a generic mapping and is also used by Chromium for these cases.

Differential Revision: https://phabricator.services.mozilla.com/D183828
2023-07-19 02:51:29 +00:00
James Teh b90eb82b66 Bug 1843825 part 2: Renumber roles to fill in the gaps left by removed roles. r=eeejay
This was done with the following script:

```
import re

RE_ENUM = re.compile(r'^([^=]*= *)([\d]+)([^=]*\n)$')

def processFile(fn):
  inLines = open(fn, 'rt').readlines()
  outLines = []
  outNum = 0
  for inLine in inLines:
    m = RE_ENUM.match(inLine)
    if m:
      # Group 1 is the part of the line before the number.
      # Group 2 is the number.
      # Group 3 is the rest of the line after the number.
      inNum = int(m.group(2))
      if outNum == 0 and inNum != 0:
        raise ValueError("The first enum value isn't 0: %s" % inLine)
      outLine = m.group(1) + str(outNum) + m.group(3)
      outNum += 1
    else:
      outLine = inLine
    outLines.append(outLine)
  open(fn, 'wt').writelines(outLines)

processFile("accessible/base/Role.h")
processFile("accessible/interfaces/nsIAccessibleRole.idl")
```

Differential Revision: https://phabricator.services.mozilla.com/D183717
2023-07-19 02:51:29 +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
Tooru Fujisawa 94bff436ad Bug 1843792 - Part 4: Rewrite toolkit/components/downloads/Downloads.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=mossop
Depends on D183674

Differential Revision: https://phabricator.services.mozilla.com/D183675
2023-07-19 00:43:28 +00:00
Tooru Fujisawa b11f8d4216 Bug 1843790 - Part 5: Rewrite toolkit/modules/InlineSpellChecker.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D183664
2023-07-18 23:06:32 +00:00
Tooru Fujisawa 60215ad826 Bug 1843790 - Part 1: Rewrite toolkit/modules/AppConstants.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D183660
2023-07-18 23:06:31 +00:00
Tooru Fujisawa d8c21fafdb Bug 1843789 - Part 3: Rewrite testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=ahal,fxview-reviewers,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D183659
2023-07-18 23:06:30 +00:00
Tooru Fujisawa b4106e3f4f Bug 1843788 - Part 2: Rewrite testing/modules/TestUtils.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=ahal,credential-management-reviewers,fxview-reviewers,sgalich,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D183656
2023-07-18 23:06:29 +00:00
Jonathan Kew be1289d750 Bug 1843608 - Correct the handling of IsTextCombined in nsTextFrame::GetPointFromIterator and GetCharacterRectsInRange. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183749
2023-07-17 21:37:51 +00:00
Jon Coppeard 4bfb0babc0 Bug 1839455 - Disable some accessibility crashtests for known failures r=Jamie
I found these two tests started failing with the other patch in this bug
applied. This patch changes the timing of GCs but should have no effect on
accessibility code, which doesn't touch GCed objects.

Depends on D181539

Differential Revision: https://phabricator.services.mozilla.com/D183579
2023-07-17 10:03:36 +00:00
Gregory Pappas 6f7cbf8d5a Bug 1842974 - Remove dom.dialog_element.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183711
2023-07-17 10:02:53 +00:00
Frederic Wang 8343f88354 Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 19:44:04 +00:00
Cristian Tuns 9f238811ed Backed out changeset db50582c2b9f (bug 1821980) for causing mochitest failures in browser_mathml.js CLOSED TREE 2023-07-14 13:49:13 -04:00
Frederic Wang 0a3179c31f Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 15:53:34 +00:00
Iulian Moraru 68cbf5e276 Backed out changeset 6cceaca5e653 (bug 1821980) for causing multiple failures. CLOSED TREE 2023-07-14 15:41:31 +03:00
Frederic Wang 1e731ab03c Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 10:52:59 +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
june wilde c4e06b0d44 Bug 1550792 - Change LoadInfo to use GetIsOriginPotentiallyTrustworthy; r=ckerschb,necko-reviewers,freddyb,kershaw,extension-reviewers,devtools-reviewers,robwu
Differential Revision: https://phabricator.services.mozilla.com/D175649
2023-07-13 22:40:30 +00:00
James Teh 6d32b64ab0 Bug 1838123: Update UI Automation client detection to work with modern versions of Windows. r=nlapre,handyman
The window message we previously hooked no longer gets sent and the associated shared memory no longer seems to be created either.
Also, we don't seem to be notified about the load of UIAutomationCore.dll until after it has already instantiated a11y, which is obviously too late for us to hook anything.
Instead, we block UIA instantiation via LazyInstantiator, just as we do for MSAA/IA2:

1. Refactor CompatibilityUIA so that rather than being called by a hook, it simply allows the caller to query the process ids of any UIA clients.
2. CompatibilityUIA now searches handles in our process for named pipes created by UIA for communication with the remote process and then uses GetNamedPipeServerProcessId to get the process id on the other end of each pipe.
3. Refactor LazyInstantiator so that it first tries to get the MSAA/IA2 client process id, then calls CompatibilityUIA to get any UIA client process ids.
4. LazyInstantiator now handles setting the instantiator and blocking of clients for UIA as well as MSAA/IA2 using the same code.
5. Because UIA client detection can be expensive if clients repeatedly query us, cache the result. Reset that cache only when one of our windows comes to the foreground.

Differential Revision: https://phabricator.services.mozilla.com/D181958
2023-07-13 05:25:20 +00:00
Iulian Moraru 1cfd3a3bc7 Backed out changeset 0724fde82b2f (bug 1838123) for causing build bustages. CLOSED TREE 2023-07-13 07:35:44 +03:00
James Teh b9171ec2f1 Bug 1838123: Update UI Automation client detection to work with modern versions of Windows. r=nlapre,handyman
The window message we previously hooked no longer gets sent and the associated shared memory no longer seems to be created either.
Also, we don't seem to be notified about the load of UIAutomationCore.dll until after it has already instantiated a11y, which is obviously too late for us to hook anything.
Instead, we block UIA instantiation via LazyInstantiator, just as we do for MSAA/IA2:

1. Refactor CompatibilityUIA so that rather than being called by a hook, it simply allows the caller to query the process ids of any UIA clients.
2. CompatibilityUIA now searches handles in our process for named pipes created by UIA for communication with the remote process and then uses GetNamedPipeServerProcessId to get the process id on the other end of each pipe.
3. Refactor LazyInstantiator so that it first tries to get the MSAA/IA2 client process id, then calls CompatibilityUIA to get any UIA client process ids.
4. LazyInstantiator now handles setting the instantiator and blocking of clients for UIA as well as MSAA/IA2 using the same code.
5. Because UIA client detection can be expensive if clients repeatedly query us, cache the result. Reset that cache only when one of our windows comes to the foreground.

Differential Revision: https://phabricator.services.mozilla.com/D181958
2023-07-13 03:57:30 +00:00
James Teh e72ae1eb3e Bug 1841943: Remove broken LazyInstantiator code to resolve a fake root accessible. r=nlapre
The code previously called DefWindowProc to get a system generated client IAccessible. However, DefWindowProc doesn't do this and I'm fairly sure it never has.
Even if we use CreateStdAccessibleObject instead:

1. We crash in LazyInstantiator's destructor because we try to call into mWeakMsaaRoot, which doesn't exist in this case.
2. We crash when some clients call us because AddRef and Release assume that we've transplanted our ref count into mRealRootUnk, but we don't do that in the case of a fake root.
3. We don't (and can't) aggregate the fake root COM object, so QueryInterface would be asymmetric. This may well cause obscure crashes/leaks.

We could fix all of these issues, but since this has clearly never been used or relied upon, we should just remove it.
We already have stub implementations for key methods and the others will just fail as they always have.
There should be no visible change with this patch.

Differential Revision: https://phabricator.services.mozilla.com/D182864
2023-07-11 21:58:49 +00:00
James Teh cb27283aab Bug 1841942: Don't call GetProp in LazyInstantiator::GetRootAccessible if a11y is already instantiated. r=nlapre
If a11y is instantiated, we always want to return the real root.
Furthermore, we clear the instantiator prop anyway when we instantiate a11y.
Therefore, calling GetProp is wasteful if a11y is instantiated.
Instead, we now only call GetProp if a11y isn't instantiated yet.

Differential Revision: https://phabricator.services.mozilla.com/D182863
2023-07-11 21:58:16 +00:00
James Teh bac4f88bdf Bug 1841941: Use CreateStdAccessibleObject instead of AccessibleObjectFromWindow when getting the window IAccessible. r=nlapre
We use AccessibleObjectFromWindow to get a system generated IAccessible for the window.
While this works well enough, it first sends WM_GETOBJECT to our window, goes through our window proc, etc., which is pointless since it will return nothing.
We should just call CreateStdAccessibleObject directly instead, which is what the existing code ends up doing indirectly.

Differential Revision: https://phabricator.services.mozilla.com/D182862
2023-07-11 21:57:29 +00:00
James Teh e3e58818c4 Bug 1837163: Use correct ATK text attribute names. r=eeejay
Gecko uses different text attribute names to ATK.
Some of the values are also in a different format.
This detail was missed in the conversion from nsPersistentProperties to AccAttributes (bug 1714390), thus regressing text attributes for ATK.
Ther old conversion code added additional attributes, mangled strings, etc.
AccAttributes allows us to do better than this, so refactor the code accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D183156
2023-07-11 01:32:08 +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
Nathan LaPre 8cc0caf4f2 Bug 1840732 Part 6: Remove unnecessary includes from accessible/html, r=Jamie
This revision removes unnecssary include directives from cpp files in the
accessible/html directory. These suggestions came from the Include What You Use
tool.

Depends on D182400

Differential Revision: https://phabricator.services.mozilla.com/D182401
2023-07-07 03:22:08 +00:00
Nathan LaPre ba5fbc3d21 Bug 1840732 Part 5: Remove unnecessary includes from accessible/aom, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/aom directory. These suggestions came from the Include What You Use
tool.

Depends on D182399

Differential Revision: https://phabricator.services.mozilla.com/D182400
2023-07-07 03:22:08 +00:00
Nathan LaPre dbc0beb714 Bug 1840732 Part 4: Remove unnecessary includes from accessible/xpcom, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/xpcom directory. These suggestions came from the Include What You
Use tool.

Depends on D182398

Differential Revision: https://phabricator.services.mozilla.com/D182399
2023-07-07 03:22:08 +00:00
Nathan LaPre 957de6a77f Bug 1840732 Part 3: Remove unnecessary includes from accessible/generic, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/generic directory. These suggestions came from the Include What You
Use tool.

Depends on D182397

Differential Revision: https://phabricator.services.mozilla.com/D182398
2023-07-07 03:22:07 +00:00
Nathan LaPre 45c1a55d92 Bug 1840732 Part 2: Remove unnecessary includes from accessible/basetypes, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/basetypes directory. These suggestions came from the Include What You
Use tool.

Depends on D182288

Differential Revision: https://phabricator.services.mozilla.com/D182397
2023-07-07 03:22:07 +00:00
Nathan LaPre 85a3b00160 Bug 1840732 Part 1: Remove unnecessary includes from accessible/base, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/base directory. These suggestions came from the Include What You Use
tool.

Differential Revision: https://phabricator.services.mozilla.com/D182288
2023-07-07 03:22:07 +00:00
James Teh e343609eb8 Bug 1841216: Fire a11y description change event when aria-description is changed. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D182544
2023-07-06 01:32:56 +00:00
James Teh 7dc93a32c1 Bug 1835728: Don't expose the display attribute in Accessible::Attributes for presentational elements for which we forced a generic Accessible. r=morgan
role="presentation" is used by pdf.js on certain spans so that display: block won't be exposed to screen readers.
Because they also have a transform, we force generic Accessibles for them.
Previously, we exposed the display attribute in this case, just like we would for any other Accessible.
To fix this, special case these presentational forced generics:

1. LocalAccessible::DisplayStyle returns null if this is a presentational element for which we forced a generic Accessible.
2. LocalAccessible::BundleFieldsForCache already used DisplayStyle, so no change was needed for the cache.
3. LocalAccessible::Attributes now uses DisplayStyle instead of calculating the display attribute itself so that it can benefit from the conditional exposure in (1).

Differential Revision: https://phabricator.services.mozilla.com/D182754
2023-07-06 00:57:57 +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
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
Nathan LaPre 4e99c1bf21 Bug 1838752: Handle other event types in DropMutationEvent,r=eeejay
This revision updates DropMutationEvent such that it handles other event
types besides REORDER, HIDE, and SHOW. If we somehow put a different event
type through this function (particularly an inner reorder, which indicates
a reorder event that's already been dropped), we should (and now do) handle
it more gracefully.

Differential Revision: https://phabricator.services.mozilla.com/D182218
2023-06-28 19:14:55 +00:00
James Teh 983b81b013 Bug 1826194 part 2: When calculating a text equivalent, walk the flat tree instead of only direct children. r=morgan
Previously, when calculating a text equivalent by walking the DOM tree, we only walked direct children of a DOM node.
However, a slot element is a placeholder for content which comes from outside of a shadow root.
In order to include this content when a slot isn't accessible (e.g. because it is hidden), we need to walk the DOM flat tree instead.

Differential Revision: https://phabricator.services.mozilla.com/D181841
2023-06-28 01:18:18 +00:00
James Teh 33bfc9b615 Bug 1826194 part 1: When calculating a text equivalent, don't treat an element with display: contents as invisible. r=morgan
A slot element has display: contents by default.
Previously, when computing a text equivalent, we would ignore the accessibility subtree if there was no frame.
This made sense back when no frame always meant display: none, but now, it could also mean display: contents.
To fix this, just look at whether the DOM node has an Accessible; don't check visibility at all.
If something really is invisible (including visibility: invisible), it shouldn't be in the a11y tree anyway.

Note that even without this fix, we should have been able to get the text equivalent for a slot by falling back to walking the DOM tree instead of the a11y tree.
Unfortunately, that is also broken... but the next patch will fix it.

Differential Revision: https://phabricator.services.mozilla.com/D181840
2023-06-28 01:18:18 +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
Nathan LaPre f6bdc0682a Bug 1840253: Defend against NotifyOfAnchorJumpTo null pointer dereference, r=Jamie
This revision adds a check for null to the document variable in order to avoid
dereferencing it if it's null. This defends us against a crash we can observe
when the document isn't built yet or is hidden, in which case we can't handle
an anchor jump anyway. This revision also cleans up the function a bit by adding
an early null check on the documentNode variable.

Differential Revision: https://phabricator.services.mozilla.com/D182095
2023-06-27 17:43:58 +00: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
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
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
James Teh 00fb437d8e Bug 1838983: When dispatching a focus event, clear the stored active item if it is different to the target. r=eeejay
When the Accessible is recreated for the focused node, DocAccessible::CreateSubtree calls FocusManager::DispatchFocusEvent directly.
If FocusManager::mActiveItem was set, DispatchFocusEvent previously didn't clear it, even though DispatchFocusEvent was given a new target overriding mActiveItem.
This meant that the old mActiveItem would remain until it was next set or cleared, causing assertions if it died and potentially other problems.
To fix this, DispatchFocusEvent clears mActiveItem if it is different to the target, since the target should override.

Differential Revision: https://phabricator.services.mozilla.com/D181605
2023-06-23 22:56:19 +00:00
Nathan LaPre 20a234326d Bug 1804054: Identify nested tables with non-zero cell border width as data tables,r=Jamie
This revision changes the table classification algorithm such that tables with
cells that have non-zero border width are identified as data tables. This revision
moves the check for border width above the nested table check, since we consider
that to be a more pertinent indicator. This revision also adds a test to verify
the changes.

Differential Revision: https://phabricator.services.mozilla.com/D181825
2023-06-23 19:54:28 +00:00
Malte Juergens f05473a284 Bug 1835983: Update accessible/tests/browser/e10s/browser_caching_document_props.js to work with https-first enabled r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D181769
2023-06-23 11:24:54 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Nathan LaPre 04801901d1 Bug 1615972: Fire a scrolling start event for non-interactive targets, r=Jamie
This revision changes our focus event and anchor scroll handling to fire
scrolling start events for non-interactive targets, where "non-interactive" is
defined as "any generic, landmark, or region Accessible." This revision also
adds a test to verify that the scrolling start event is fired.

Differential Revision: https://phabricator.services.mozilla.com/D181329
2023-06-22 20:14:41 +00:00
Morgan Rae Reschenberg 5c657481a5 Bug 1781926: Verify image map exists before hittesting its conetnts r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D177413
2023-06-21 23:33:03 +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 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
Vincent Hilla 99810beb2a Bug 1708370 - adjust UA stylesheet to match spec for form rendering. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180812
2023-06-21 07:35:34 +00:00
James Teh 2f752feae8 Bug 1839111: Don't fire an alert event if we're processing insertions due to layout frame reconstruction but we don't actually insert anything. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D181354
2023-06-21 06:52:29 +00:00
James Teh 987c8e49d5 Bug 1838782: Add null checks in HyperTextAccessibleBase::OffsetAtPoint. r=morgan
1. nsAccUtils::DocumentFor might return null if the Accessible is being moved and a client queried it during the move.
2. ChildAtPoint might return null if the point can't be located at all.

Differential Revision: https://phabricator.services.mozilla.com/D181213
2023-06-20 22:02:40 +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
Nathan LaPre 221859a0e6 Bug 1837315: Avoid queueing a hide event on an accessible that's already being moved, r=Jamie
If we move an accessible via an aria-owns relocation on a grandparent, then move
it again via an aria-owns relocation on a parent, we can end up with multiple
hide events in the queue: one for the shallowest hide (of the grandparent), and
one for the hide of the grandchild accessible. We can't always coalesce (drop)
the hide event of the grandchild since the first move severs the relationship
between its parent and its grandparent. To address this, this revision stops us
from queueing a hide event on an accessible that's already being moved. This
revision also adds a test to verify we're getting the proper events.

Differential Revision: https://phabricator.services.mozilla.com/D180888
2023-06-15 23:12:00 +00:00
James Teh 962a479c5c Bug 1728676: Correctly expose ARIA table cells in SVG. r=nlapre
Previously, the code to create ARIAGridCellAccessible only ran for HTML elements.
This meant that ARIA cells weren't exposed correctly in SVG.
This code has now been moved outside of the HTML check so that it works for SVG as well.

Differential Revision: https://phabricator.services.mozilla.com/D181077
2023-06-15 22:48:17 +00:00
James Teh 9231425225 Bug 1838540: Don't recurse in ApplyARIAState on a grid cell if the cell is also a table. r=nlapre
This can only happen due to authoring error; <table role=gridcell outside of an ARIA grid isn't valid.
Nevertheless, we would previously recurse infinitely in this case in ApplyARIAState.
Prevent this by not recursing if IsTable() is true.

Differential Revision: https://phabricator.services.mozilla.com/D181026
2023-06-15 22:48:17 +00:00
James Teh 12e8d401f1 Bug 1838151: Remove unused a11y::filters::GetRow/GetCell. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D180784
2023-06-14 03:31:45 +00:00
James Teh c49bf94d77 Bug 1838138: Remove InSendMessageEx hack. r=nlapre
This was only necessary when we had cross-process COM proxies for accessibility.

Differential Revision: https://phabricator.services.mozilla.com/D180776
2023-06-14 03:30:40 +00:00
James Teh 1f73a200af Bug 1837430: Fix LocalAccessible::EmbeddedChildAt such that it returns a remote document if appropriate. r=morgan
In bug 1834006, I unified the ATK child retrieval code so that it uses Accessible::EmbeddedChildAt, rather than having different code paths for local, remote, local OuterDocAccessibles embedding remote documents, etc.
Unfortunately, LocalAccessible::EmbeddedChildAt previously didn't handle remote document children, even though LocalAccessible::EmbeddedChildCount returned 1.
This meant that we weren't returning a child at all in this case on Linux, resulting in a broken tree.
To fix this, make LocalAccessible::EmbeddedChildAt fall back to ChildAt instead of LocalChildAt.

Differential Revision: https://phabricator.services.mozilla.com/D180606
2023-06-14 01:44:50 +00:00
Stanca Serban 3ab64511ea Backed out changeset 25b7d7779f41 (bug 1838138) for causing bp-nu bustages in Compatibility.cpp. 2023-06-14 04:52:07 +03:00
James Teh 01d480b80d Bug 1837332: Remove unused HyperTextAccessible::EnclosingRange/VisibleRanges/RangeByChild/RangeAtPoint, TextRange::EmbeddedChildren/Text and xpcAccessibleTextRange::ScrollIntoView. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D180301
2023-06-14 00:43:11 +00:00
James Teh c1a2fd8cdb Bug 1838138: Remove InSendMessageEx hack. r=nlapre
This was only necessary when we had cross-process COM proxies for accessibility.

Differential Revision: https://phabricator.services.mozilla.com/D180776
2023-06-14 00:38:57 +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 a984d0f58f Bug 1780667: Don't fire a11y focus on the DOM element when its aria-activedescendant is cleared/invalidated if the element doesn't have DOM focus. r=eeejay
aria-activedescendant should only take effect when the element has DOM focus.
Previously, clearing aria-activedescendant or setting it to an invalid id on an element without DOM focus would incorrectly fire a11y focus on that element.
Also, this caused an assertion to be fired due to a defunct active item if this happened alongside a text selection change.

Differential Revision: https://phabricator.services.mozilla.com/D180630
2023-06-13 00:30:49 +00:00
James Teh 03ab4e1314 Bug 1837825: Always cache the src of images, even those with alt text. r=morgan
Unfortunately, authors providing useless alt text is becoming increasingly common, so in the real world, we can't assume that having alt text makes an image accessible.

Differential Revision: https://phabricator.services.mozilla.com/D180608
2023-06-13 00:20:51 +00:00
Morgan Rae Reschenberg 08e73e0c07 Bug 1837030: Treat fuzzily-matched text leaves as valid in OffsetAtPoint r=Jamie,nlapre
Differential Revision: https://phabricator.services.mozilla.com/D180515
2023-06-12 21:01:04 +00:00
Nathan LaPre f20a8d8057 Bug 1723195: Allow intervening generic accessibles between table rows and cells, r=Jamie
This commit ensures that we get the proper non-generic parent when creating a
grid cell accessible. Before this patch, we wouldn't see this grid cell as a
grid cell accessible. This patch also adds a test for this case, along with a
test for a similar case that inserts a generic accessible between the table
itself and a rowgroup.

Differential Revision: https://phabricator.services.mozilla.com/D180393
2023-06-09 23:43:25 +00:00
Anna Yeddi c7d66d7729 Bug 1834931 - Map HTML <code> to roles::CODE. r=Jamie
Mapping HTML `<code>` and updating its corresponding tests and meta files.

Differential Revision: https://phabricator.services.mozilla.com/D179602
2023-06-08 13:38:15 +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
James Teh 23a28d03bb Bug 1832228 part 2: Remove TableAccessible and TableCellAccessible. r=nlapre
These classes are no longer used.
The remaining XUL subclasses now derive from Table*AccessibleBase.
XULTreeGridAccessible depended on some methods in TableAccessible which are no longer used by anything else, so these have been moved into XULTreeGridAccessible itself.

Differential Revision: https://phabricator.services.mozilla.com/D179802
2023-06-08 09:50:28 +00:00
James Teh 220f6dfece Bug 1832228 part 1: Remove ARIAGridAccessible, ARIARowAccessible and most of ARIAGridCellAccessible. r=nlapre
We now use CachedTableAccessible for ARIA tables and grids, so most of the code in the ARIA table classes was unused.

1. Remove ARIAGridAccessible and ARIARowAccessible completely.
2. ARIAGridCellAccessible no longer derives from TableCellAccessible.
3. Remove most of ARIAGridCellAccessible.
4. We still use ARIAGridCellAccessible to differentiate between valid and invalid cells. Valid cells create an ARIAGridCellAccessible and ARIAGridCellAccessible::IsTableCell() returns true due to mGenericTypes. Invalid cells don't get an ARIAGridCellAccessible, so IsTableCell() returns false on those.
5. We also keep the code in ARIAGridCellAccessible to expose some states and attributes.
6. The code for creating ARIAGridCellAccessible in CreateAccessible has been refactored, both for simplification and to fix bugs. display: contents tables now properly get the table and table cell interfaces; i.e. IsTable() and IsTableCell() return true when appropriate. Walking non-generic ancestors should fix ARIA tables with intervening generics, though this will be dealt with fully in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D179801
2023-06-08 09:50:28 +00:00
James Teh 9ecdad92e8 Bug 1832261: Remove most of HTMLTable*Accessible. r=nlapre
We now use CachedTableAccessible for HTML tables, so much of the code in the HTMLTable*Accessible classes was unused.
However, we still depend on these classes for some data needed to build the cached table.

1. HTMLTableAccessible and HTMLTableCellAccessible no longer derive from TableAccessible and TableCellAccessible, respectively. Instead, callers which need specific access to HTML table data use the HTMLTable*Accessible class directly.
2. All table specific methods have been removed except those that provide data required to build a CachedTableAccessible. The remaining methods are those for querying the row/column span (which depends on layout) and getting the caption (which depends on DOM).
3. HTMLTable*Accessible are now used for all <table>, <td>, <th> and <tr> elements and MathML equivalents. ARIA*Accessible are never used for these elements. This improves consistency, simplifies the code and means that behavior specific to these HTML elements is handled in these classes, rather than in the ARIA classes as well.
4. The table and row roles are now specified in HTMLMarkupMap and MathMLMarkupMap, rather than overriding NativeRole.  Cell roles are still handled in a NativeRole override; see the code comments for details.
5. IsProbablyLayoutTable has been moved from TableAccessible to HTMLTableAccessible, as it is only relevant for HTML tables, not for ARIA tables.
6. HTMLTableHeaderCellAccessible::NativeRole has been rewritten such that it no longer depends on querying table coordinates, as that would now require building a CachedTableAccessible, which would be very wasteful here. This replaces TableCellAccessible::HeaderCellRole, which has been removed.

Differential Revision: https://phabricator.services.mozilla.com/D179799
2023-06-08 09:50:28 +00:00
Anna Yeddi 3ae23f78be Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-08 00:28:38 +00:00
Nathan LaPre bb0eac529c Bug 1789235: Fire a scrolling start event for anchor jump if focus in doc, r=Jamie
This revision modifies NotifyOfAnchorJump in order to ensure that we fire a
scrolling start event for AT clients. Without this, clients might miss anchor
jump updates, since anchor jumps can arrive after getting focus. This revision
also adds a test to verify that the scrolling start event is now being sent.

Differential Revision: https://phabricator.services.mozilla.com/D177419
2023-06-08 00:06:39 +00:00
James Teh a89668b961 Bug 1837105: Add methods for determining generic Accessibles and getting the nearest non-generic ancestor. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179800
2023-06-07 22:34:49 +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 bd9bd8733b Bug 1835967: Remove TableAccessibleBase::Select/UnselectCol/Row. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179513
2023-06-07 01:40:25 +00:00
Hunseop Jeong bc6e2d89d2 Bug 1826904 - Add the AXSubrole for role="meter". r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D179884
2023-06-06 20:42:24 +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
Norisz Fay 63fa83129d Backed out changeset 1d562ee8729b (bug 1796178) for causing mochitest failures on test_general.html CLOSED TREE 2023-06-06 22:22:18 +03:00
Norisz Fay 357f177c83 Backed out changeset dbe49d0e5b60 (bug 1834931) for causing mochitest failures on browser_caching_text_bounds.js 2023-06-06 22:21:09 +03:00
Anna Yeddi af5fecdbd1 Bug 1829269 - Add support for ARIA 1.3 role="image". r=Jamie
Adding ARIAMap for nsGkAtoms::image and mapping to it GRAPHIC to nsGkAtoms::image instead of img in RoleMap. This allows both tests listed in the expectations metadata file in `testing/web-platform/meta/wai-aria/role/synonym-roles.html.ini` to be passing, thus removing this file.

Differential Revision: https://phabricator.services.mozilla.com/D179720
2023-06-06 15:23:32 +00:00
Anna Yeddi efb3216a37 Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-06 15:17:26 +00:00
Anna Yeddi 578616014d Bug 1834931 - Map HTML <code> to roles::CODE. r=Jamie
Mapping HTML `<code>` and updating its corresponding test and meta files.

Differential Revision: https://phabricator.services.mozilla.com/D179602
2023-06-06 15:15:20 +00:00
Morgan Rae Reschenberg c3544381e4 Bug 1835194: Add Use System Colors telemtry probe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D179180
2023-05-31 22:18:03 +00:00
Gregory Pappas 941d7766f8 Bug 1822864 - Remove browser.download.improvements_to_download_panel pref r=Gijs,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D179300
2023-05-31 10:29:37 +00:00
James Teh 6f49fe6b0c Bug 1828295 part 3: Add tests for GetCaretRect. r=morgan
This required exposing GetCaretRect via XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D179346
2023-05-31 10:04:18 +00:00
James Teh b17144e206 Bug 1828295 part 2: When setting the fake a11y Windows caret, convert the screen coordinates to client coordinates. r=nlapre
Previously, we were making the screen coordinates relative to the window rect.
However, the window rect includes the non-client area of the window, which includes the title bar.
SetCaretPos expects client coordinates.
In Firefox, this normally doesn't matter because the title bar is disabled, so there is no non-client area.
However, when the title bar is disabled, the coordinates were previously incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D176620
2023-05-31 10:04:18 +00:00
James Teh f34c3edf90 Bug 1828295 part 1: Fix HyperTextAccessible::GetCaretRect when the title bar is enabled. r=morgan
I don't quite know which part of this was breaking, but the coordinates were quite wrong in the parent process.
They were wrong enough that when we adjusted for the character height, we ended up with a negative height in the resulting rect.
This code is now more similar to how we do this in LocalAccessible::BoundsInAppUnits.
This should also take CSS transforms into account in most cases where we weren't previously, though perhaps not for some iframe transforms.

Differential Revision: https://phabricator.services.mozilla.com/D176619
2023-05-31 10:04:18 +00:00
Natalia Csoregi 6f5c0c586c Backed out 3 changesets (bug 1828295) for causing failures on browser_caret_rect.js. CLOSED TREE
Backed out changeset 52b9bf7e6344 (bug 1828295)
Backed out changeset 6e6ee5fe337f (bug 1828295)
Backed out changeset 4e8ff9c439ef (bug 1828295)
2023-05-31 08:44:34 +03:00
James Teh c342e57201 Bug 1828295 part 3: Add tests for GetCaretRect. r=morgan
This required exposing GetCaretRect via XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D179346
2023-05-31 03:43:29 +00:00
James Teh ef2bb865b5 Bug 1828295 part 2: When setting the fake a11y Windows caret, convert the screen coordinates to client coordinates. r=nlapre
Previously, we were making the screen coordinates relative to the window rect.
However, the window rect includes the non-client area of the window, which includes the title bar.
SetCaretPos expects client coordinates.
In Firefox, this normally doesn't matter because the title bar is disabled, so there is no non-client area.
However, when the title bar is disabled, the coordinates were previously incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D176620
2023-05-31 03:43:29 +00:00
James Teh 3fe3bb9a1f Bug 1828295 part 1: Fix HyperTextAccessible::GetCaretRect when the title bar is enabled. r=morgan
I don't quite know which part of this was breaking, but the coordinates were quite wrong in the parent process.
They were wrong enough that when we adjusted for the character height, we ended up with a negative height in the resulting rect.
This code is now more similar to how we do this in LocalAccessible::BoundsInAppUnits.
This should also take CSS transforms into account in most cases where we weren't previously, though perhaps not for some iframe transforms.

Differential Revision: https://phabricator.services.mozilla.com/D176619
2023-05-31 03:43:29 +00:00
James Teh 09d623679d Bug 1818404: Use HTMLLinkAccessible for SVG <a> elements. r=nlapre
This ensures that these are HyperTextAccessibles if they contain text, which prevents assertions and exposes formatting information.
It also gives these the correct role.

Differential Revision: https://phabricator.services.mozilla.com/D179409
2023-05-31 02:33:57 +00:00
James Teh 6a9d344564 Bug 1835725: Remove unused a11y::IsCacheActive. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179404
2023-05-31 02:28:30 +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
Sandor Molnar c013058f4f Backed out changeset f688d9dff006 (bug 1835194) for causing mochitest failures in accessible/tests/browser/telemetry/browser_HCM_telemetry.js 2023-05-27 03:24:23 +03:00
Morgan Rae Reschenberg 17bcd7d1b8 Bug 1835194: Add Use System Colors telemetry probe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D179180
2023-05-26 23:03:17 +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 b23c3d0657 Bug 1821965 - P3: Merge diverging text test results. r=morgan.
We had some different results in non-caching mode. We can now unify the results and not worry about that.

Depends on D178718

Differential Revision: https://phabricator.services.mozilla.com/D178719
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 19ab04b63e Bug 1821965 - P1: Remove legacy and proxy text marker classes. r=morgan
With caching on we can remove the legacy text marker and the abstracting class that allowed us to operate in both modes.

Depends on D178724

Differential Revision: https://phabricator.services.mozilla.com/D178717
2023-05-26 22:17:12 +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
Eitan Isaacson 832b5bfb9a Bug 1832353 - P2: Convert editable text tests to browser tests. r=Jamie
Depends on D178714

Differential Revision: https://phabricator.services.mozilla.com/D178715
2023-05-26 22:17:12 +00:00
Eitan Isaacson 1daec2903b Bug 1832353 - P1: Move all text related browser tests into text subdir. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178714
2023-05-26 22:17:12 +00:00
Chris Peterson 386cfe958f Bug 1791961 - accessible: Fix C++20 -Wambiguous-reversed-operator warnings. r=Jamie
clang is warning that C++20 expects comparison operators to be commutative: `a == b` and `b == a` should resolve to the same comparison operator function. Warnings about the comparison of const and non-const objects can be fixed by making the comparison operator function const.

accessible/base/TextAttrs.h:139:54 [-Wambiguous-reversed-operator] ISO C++20 considers use of overloaded operator '!=' (with operand types 'mozilla::a11y::TextAttrsMgr::TextDecorValue' and 'mozilla::a11y::TextAttrsMgr::TextDecorValue') to be ambiguous despite there being a unique best viable function with non-reversed arguments
...

Differential Revision: https://phabricator.services.mozilla.com/D179019
2023-05-26 04:51:43 +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 c5a24689b5 Bug 1821965 - P3: Merge diverging text test results. r=morgan.
We had some different results in non-caching mode. We can now unify the results and not worry about that.

Depends on D178718

Differential Revision: https://phabricator.services.mozilla.com/D178719
2023-05-25 20:38:30 +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 de34976841 Bug 1821965 - P1: Remove legacy and proxy text marker classes. r=morgan
With caching on we can remove the legacy text marker and the abstracting class that allowed us to operate in both modes.

Differential Revision: https://phabricator.services.mozilla.com/D178717
2023-05-25 20:38:29 +00:00