10805 Commits

Author SHA1 Message Date
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