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

10862 Коммитов

Автор SHA1 Сообщение Дата
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
Eitan Isaacson 2237be2626 Bug 1832353 - P3: Make editable text methods async and return void. r=Jamie,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178724
2023-05-25 20:38:29 +00:00
Eitan Isaacson 6d1721c180 Bug 1832353 - P2: Convert editable text tests to browser tests. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178715
2023-05-25 20:38:29 +00:00