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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Now that we always have the core parent process cache, this is no longer necessary.
This also removes EVENT_TABLE_STYLING_CHANGED, which was only used to keep the Mac cache up to date.
Differential Revision: https://phabricator.services.mozilla.com/D178425
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.
Differential Revision: https://phabricator.services.mozilla.com/D177963
This includes AccessibleHandler, HandlerProvider, IGeckoCustom and the IAccessible2 COM proxy dll.
Even with the new architecture, we still use IAccessible2, but we no longer need a COM proxy because we aren't using COM across processes ourselves.
If clients want to use IAccessible2 across processes, they're responsible for registering a COM proxy themselves as with all other IAccessible2 applications.
Alternatively, they can rely on the IAccessible2 COM proxy which is included with Windows 10 and later.
Differential Revision: https://phabricator.services.mozilla.com/D177963