Commit Graph

10427 Commits

Author SHA1 Message Date
James Teh
427da13d9e Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-10 03:49:04 +00:00
James Teh
5ec432103b Bug 1821223: TextLeafPoint: Don't treat an entire table as a paragraph. r=eeejay
Table rows and cells are now treated as paragraph boundaries.
Whether a cell should be a paragraph boundary is debatable, but currently, a cell is treated as a line boundary, so this is consistent; a line shouldn't expand beyond a paragraph.

Differential Revision: https://phabricator.services.mozilla.com/D172079
2023-03-10 03:48:34 +00:00
James Teh
89dc63126c Bug 1808195: Try to make accessible/tests/browser/states/browser_test_link.js more reliable. r=eeejay
1. Open the link in a new tab instead of a new window. I originally did this to make debugging easier with a screenshot, but it seems to actually make the test more reliable. I don't know why.
2. Suffix the URL so we can be sure it will not have been visited before the test.

Differential Revision: https://phabricator.services.mozilla.com/D171948
2023-03-10 03:46:17 +00:00
Eitan Isaacson
3f036ec6b7 Bug 1818450 - StringAttributesFromAccAttributes: Return empty dictionary if input is null. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D172173
2023-03-10 03:40:21 +00:00
Morgan Rae Reschenberg
60f92a62cb Bug 1820029: Inline HyperTextAccessible::TextBounds to TextLeafPoint::CharBounds r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171503
2023-03-09 19:59:00 +00:00
Sean Feng
a039c090eb Bug 1818413 - Add some null pointer checks in HTMLImageMapAccessible::UpdateChildAreas r=Jamie
Given Bug 1815913 made the initialization of ImageMap earlier,
calling HTMLImageMapAccessible::UpdateChildAreas along with that
can lead to some null pointer crashes when reading mContent.

This patch adds some null pointer checks to fix this.

Differential Revision: https://phabricator.services.mozilla.com/D171889
2023-03-08 15:40:52 +00:00
Cristina Horotan
72f5765338 Backed out changeset db31cf17952c (bug 1819799) for causing ba failures at browser_caching_table.js 2023-03-07 09:25:35 +02:00
James Teh
12b8683d00 Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-07 05:09:15 +00:00
James Teh
57869687c5 Bug 1820069: Fix handling of magic offsets in HyperTextAccessible*::Char/TextBounds. r=morgan
1. HyperTextAccessibleBase::CharBounds didn't have code to support magic offsets (like TEXT_OFFSET_CARET) at all, resulting in a crash.
2. HyperTextAccessibleBase::TextBounds handled the end offset being a magic offset, but not the start offset.
3. HyperTextAccessible::CharBounds assumed it could just add 1 to the start offset to pass to TextBounds, which resulted in returning the rect from the caret to the end of the container, since length (-1) is caret (-2) + 1.

This patch addresses all three of these issues.

Differential Revision: https://phabricator.services.mozilla.com/D171545
2023-03-06 08:58:42 +00:00
Eitan Isaacson
7bb059f2e8 Bug 1820213 - Use initial attributes run of first segment after an input. r=morgan
There is a potential null dereference if currentRun is first assigned
using a point in an empty input because the attributes will be null.

Differential Revision: https://phabricator.services.mozilla.com/D171596
2023-03-04 06:57:39 +00:00
Jan-Niklas Jaeschke
ebf3cd6240 Bug 1808565, part 1: Adapt Selection to support StaticRanges. r=webidl,saschanaz,masayuki,smaug
This change is necessary to support the [CSS Highlight API](https://drafts.csswg.org/css-highlight-api-1/),
which uses `Selection` internally.

To replace `nsRange` with `AbstractRange`, some sections needed to be
adapted since `nsRange`-specific features were used.
Therefore, some methods (such as `GetRangeAt()`) may only be called if
the `Selection` is *not* of type `SelectionType::eHighlight`,
as it (per spec) returns an `nsRange`.
These methods will now `MOZ_ASSERT` if called for a highlight selection.
Additional methods are implemented which return `AbstractRange`
instead and are safe to be called for every selection type.

This commit also improves support of highlight features:
- Invalidation of highlight ranges: adding/removing Ranges in-place instead of
  removing and re-adding the Selection object associated with the highlight.
- Ranges are only associated with the Selection that shares the same Document
- Fixed minor IDL issue

Differential Revision: https://phabricator.services.mozilla.com/D170582
2023-03-03 14:59:47 +00:00
James Teh
75b296d493 Bug 1819802 part 2: Pre-allocate some arrays in LocalAccessible::BundleFieldsForCache. r=morgan,nlapre
For the viewport cache and character rects, we have at least a reasonable estimate of the number of elements that will be required.
Pre-allocating these saves on potentially costly re-allocation as we append elements.

Differential Revision: https://phabricator.services.mozilla.com/D171420
2023-03-03 03:26:22 +00:00
James Teh
958055f388 Bug 1819802 part 1: When getting cached a11y character bounds, return a single rect rather than an array of rects. r=morgan
When hit testing, we retrieve the bounds for every character in a text leaf in a separate call.
Because we need to convert from an array of flat ints to rects, this previously meant we built the entire array for every character.
For a large text leaf, building this rect array is relatively expensive.
We only need a single rect at a time.
Therefore, RemoteAccessibleBase now returns the rect for a single requested character instead of building an array of rects.

Differential Revision: https://phabricator.services.mozilla.com/D171419
2023-03-03 03:26:21 +00:00
Morgan Rae Reschenberg
7a080d4df8 Bug 1778441: Call into HyperTextAccessible::CharBounds when computing char bounds for local-acc TextLeafPoint's r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171285
2023-03-02 18:08:15 +00:00
James Teh
34209c1742 Bug 1819245: Null check FocusMgr() in DocAccessibleChild::RecvRestoreFocus. r=eeejay
This can (rarely) be null if the accessibility service shuts down before we've processed this queued IPDL message.

Differential Revision: https://phabricator.services.mozilla.com/D171178
2023-03-01 23:51:33 +00:00
Eitan Isaacson
66cf5a32ef Bug 1818450 - Support getting attributed text with empty inputs. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D170939
2023-03-01 19:00:08 +00:00
Nathan LaPre
f7edb0b474 Bug 1494196: Create Accessible for elements with ARIA role, attributes and display: contents, r=Jamie
This revision modifies the logic in CreateAccessible such that we create
Accessibles for elements that have ARIA roles (other than presentation, none) or
other ARIA attributes, even if those elements have the display: contents style.
This revision also adds tests to verify the above.

Differential Revision: https://phabricator.services.mozilla.com/D170718
2023-03-01 05:53:30 +00:00
James Teh
5f7a89e17f Bug 1818726 part 2: Remove the aDispatchShowEvent argument to PDocAccessible::Cache. r=eeejay
This is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D171047
2023-02-28 09:19:33 +00:00
James Teh
a1cc7c8fe9 Bug 1818726 part 1: Include the cache in PDocAccessible::ShowEvent. r=eeejay
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.

Differential Revision: https://phabricator.services.mozilla.com/D171046
2023-02-28 09:19:33 +00:00
Csoregi Natalia
7ae06781c0 Backed out 2 changesets (bug 1818726) for causing failures on browser_caching_relations.js. CLOSED TREE
Backed out changeset 19b59c1f4a3b (bug 1818726)
Backed out changeset 0854bd8c6db1 (bug 1818726)
2023-02-28 06:43:35 +02:00
James Teh
3d617b7f9e Bug 1818726 part 2: Remove the aDispatchShowEvent argument to PDocAccessible::Cache. r=eeejay
This is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D171047
2023-02-28 00:03:54 +00:00
James Teh
891c2db763 Bug 1818726 part 1: Include the cache in PDocAccessible::ShowEvent. r=eeejay
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.

Differential Revision: https://phabricator.services.mozilla.com/D171046
2023-02-28 00:03:54 +00:00
James Teh
5ba97b5396 Bug 1818720: Skip inert attribute a11y tests if inert is preffed off. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171044
2023-02-27 21:15:25 +00:00
Ryan VanderMeulen
8924fd2459 Bug 1818997 - Re-enable some passing browser-a11y tests and cleanup test manifests. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171040
2023-02-27 04:45:27 +00:00
James Teh
4b8d5d446d Bug 1784752 part 2: Disable A11YLOG for accessible/tests/browser/events. r=eeejay
This was only ever meant to be temporary, but I forgot to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D170557
2023-02-25 01:12:05 +00:00
James Teh
3d09bf554e Bug 1784752 part 1: Reset the mutation events queue and Accessible state bits before firing any mutation events. r=eeejay
See the code comments for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D170556
2023-02-25 00:50:36 +00:00
James Teh
621d06d8bd Bug 1781848: Split accessible/tests/browser/e10s/browser_obj_group.js into two files to avoid exceeding the timeout threshold. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170562
2023-02-24 23:56:36 +00:00
James Teh
9a96659b76 Bug 1818176: Support querying to IAccessibleImage. r=nlapre
Bug 1763214 unified the Accessible image interface, including support in ia2AccessibleImage.
However, MsaaAccessible::Create wasn't updated accordingly and would only create an ia2AccessibleImage for a LocalAccessible.
The only thing we need to do here is to drop the Local requirement.
I also did some other drive-by cleanup in this function, converting LocalAccessible if checks to assertions for things that can only ever be Local.

Differential Revision: https://phabricator.services.mozilla.com/D170589
2023-02-23 23:42:23 +00:00
James Teh
2b84971d26 Bug 1767561 part 2: Add a11y tests for inert, dialog and fullscreen. r=emilio,morgan
Differential Revision: https://phabricator.services.mozilla.com/D170789
2023-02-23 21:01:41 +00:00
Emilio Cobos Álvarez
ef73e7c47c Bug 1767561 - Deal with inert much like we deal with visibility: hidden. r=Jamie
Needs tests but this should do.

Differential Revision: https://phabricator.services.mozilla.com/D170752
2023-02-23 19:56:47 +00:00
Morgan Rae Reschenberg
9363d07cc1 Bug 1809695: Make DOM coords screen relative before comparing in testTextRange r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D170691
2023-02-23 18:54:14 +00:00
Morgan Rae Reschenberg
06c234d803 Bug 1800586: Refactor IsARIAControls to work with untilCacheIs r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170541
2023-02-23 00:02:21 +00:00
Eitan Isaacson
cd1cd3c259 Bug 1730095 - P6: Introduce CachedTextMarker on MacOS. r=morgan
These text marker and marker range classes use our text cache and don't rely on any sync calls.

There are some edge cases where the range for boundary type code diverges from the non-caching one. The tests have amended exceptions for that in cases where the caching code is more correct, or at least not more wrong :)

Differential Revision: https://phabricator.services.mozilla.com/D168451
2023-02-22 04:53:01 +00:00
Eitan Isaacson
875d8f8095 Bug 1730095 - P5: Add GeckoTextMarker proxy class. r=morgan
Abstracting the text marker will allow us to have a drop-in caching version in the next patch.
In this change I moved the (de)serializing code to the proxy class and changed it from being a constructor to a static method. I also added standalone get-range-for methods instead of the enum because the caching version will transition away from it. It was useful in the non-caching version because it allowed us to have one sync message with an enum and a switch statement in the recieving end.

Differential Revision: https://phabricator.services.mozilla.com/D168450
2023-02-22 04:53:01 +00:00
Eitan Isaacson
b544041558 Bug 1730095 - P4: Rename GeckoTextMarker to LegacyTextMarker. r=morgan
Done here in a standalone patch to keep things simpler. Includes a typedef to bridge the
gap for the next patch where we will reintroduce `GeckoTextMarker` as an abstracting
wrapper class.

Differential Revision: https://phabricator.services.mozilla.com/D168449
2023-02-22 04:53:00 +00:00
Eitan Isaacson
53633c7159 Bug 1730095 - P3: Move common functions to MacUtils. r=morgan
This will be needed for another text marker implementation.

Differential Revision: https://phabricator.services.mozilla.com/D168448
2023-02-22 04:53:00 +00:00
Eitan Isaacson
39cc60ffe5 Bug 1730095 - P2: Unify checked state enum in header and include needed headers. r=morgan
When files shift around into other unified build files things go wrong.
This puts an identically named enum in a header do it doesn't get redefined.

Differential Revision: https://phabricator.services.mozilla.com/D168447
2023-02-22 04:53:00 +00:00
Eitan Isaacson
31c0b1e98c Bug 1730095 - P1: Refactor text Mac marker tests. r=morgan
This change gives a bit more flexibility for isolating issues and seeing which specific marker offset is giving trouble when a test fails.

Depends on D168445

Differential Revision: https://phabricator.services.mozilla.com/D168446
2023-02-22 04:52:59 +00:00
James Teh
f826326f5f Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 04:46:50 +00:00
James Teh
75092d8fb0 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 04:46:50 +00:00
Eitan Isaacson
8bf95c7d17 Bug 1814220 - Allow ignoring list item markers in TextLeafPoint::FindBoundary. r=Jamie
Refactor in FindBoundary to allow easier skipping of leaves in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D168445
2023-02-22 04:17:31 +00:00
Butkovits Atila
d45ed2897d Backed out 2 changesets (bug 1816346) for causing failures at test_table.html. CLOSED TREE
Backed out changeset eeb78c17513c (bug 1816346)
Backed out changeset 22b32e106152 (bug 1816346)
2023-02-22 04:45:07 +02:00
James Teh
4f47e992e7 Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 02:17:56 +00:00
James Teh
193890e062 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 02:17:55 +00:00
Emilio Cobos Álvarez
a228002bd2 Bug 1815229 - Remove nsImageBoxFrame. r=tnikkel,layout-reviewers
nsImageFrame has support for displaying style URIs / an owned image
request, so use it.

The main behavior difference is that we don't fire `load` / `error`
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.

Differential Revision: https://phabricator.services.mozilla.com/D168958
2023-02-21 17:36:11 +00:00
Eitan Isaacson
4cdf1e6cc0 Bug 1816536 - Fix document edge issues in FindBounary. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169726
2023-02-21 16:37:24 +00:00
Eitan Isaacson
a8c6dc0db1 Bug 1816573 - Use flags in TextLeafPoint::FindBoundary instead of boolean arguments. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169740
2023-02-21 16:37:23 +00:00
Florian Quèze
7567717c5e Bug 1817506 - Make accessible/tests/mochitest/tree/test_media.html wait for Fluent to update asynchronously the accessible value of the scrubber, r=Gijs.
Differential Revision: https://phabricator.services.mozilla.com/D170396
2023-02-20 22:16:19 +00:00
Razvan Cojocaru
a334f46de8 Bug 755621 - Add downcasting for nsXULTreeItemAccessibleBase. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D170051
2023-02-20 06:37:16 +00:00
James Teh
e425f02438 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-16 11:57:14 +00:00