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

3000 Коммитов

Автор SHA1 Сообщение Дата
James Teh 52b0b92e8d Bug 1766546: Implement SetCaretOffset for cached Windows RemoteAccessible. r=morgan
We implement setting of the caret using HyperText rather than TextLeafPoint because caret stuff, including events, still uses HyperText internally for now.

This moves the async IPDL method already used on non-Windows into the base classes so Windows can use it.
We keep the COM implementation for Windows RemoteAccessible without the cache.
SetCaretOffset was moved into HyperTextAccessibleBase and platform methods were updated accordingly.
Finally, I did some drive-by cleanup (no user impact) and changed GetCaretOffset in ATK and XPCOM to use HyperTextAccessibleBase.
GetCaretOffset was moved to the base some time ago, but ATK and XPCOM weren't updated at the time.

Differential Revision: https://phabricator.services.mozilla.com/D147852
2022-06-01 19:34:09 +00:00
James Teh 196146ecb6 Bug 1756728 part 2: Support retrieving the URL for cached remote documents. r=morgan
The BrowsingContext already has this information, so we use that instead of redundantly caching it in RemoteAccessible.
This implementation works even when the a11y cache is disabled, so stop using the sync IPDL URL method.
We can't entirely unify the URL method because we don't have a base class for local/remote documents.
However, a method was added in nsAccUtils to unify this as much as possible.

Differential Revision: https://phabricator.services.mozilla.com/D147717
2022-06-01 00:34:17 +00:00
James Teh 0dd4ed02ef Bug 1737919 part 5: Add tests for cached spelling errors. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147245
2022-05-27 10:56:41 +00:00
James Teh 732a2400fe Bug 1771259: Fix crash when calling TextLeafPoint::CharBounds on the insertion point at the end of a text box. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147397
2022-05-27 03:00:34 +00:00
James Teh 447e69d94a Bug 1769166: Update the cache when text bounds change. r=morgan
We detect this in the same way that we detect whether we need to push line starts; i.e. a text update or a bounds change.
Since this is tied to the Text and Bounds domains, I removed the separate TextBounds domain.

Differential Revision: https://phabricator.services.mozilla.com/D147396
2022-05-27 03:00:34 +00:00
Morgan Rae Reschenberg c3d3119342 Bug 1768054: Traverse embedded chars when computing text bounds. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D145908
2022-05-23 21:43:12 +00:00
Mark Banner 7c198e01fd Bug 1769569 - Fix remaining ESLint no-undef and no-unused-vars issues in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146452
2022-05-18 08:13:19 +00:00
Andrew McCreight c8c5c819df Bug 1514936, part 1 - Remove the outer argument to nsIFactory::createInstance. r=xpcom-reviewers,preferences-reviewers,nika,Gijs
This patch won't actually build, because a few bits of code are used
for both nsIFactory::createInstance and static components, and static
components are not fixed until the next patch.

The first place is nsLoadGroupConstructor, which uses an nsIFactory
macro to create a static component constructor. (This could be worked
around by expanding the macro to the state before this patch.)

The other issue is that nsAppShellConstructor is used in an nsIFactory
on OSX, but as a static component on all other platforms. This could
be worked around by wrapping nsAppShellConstructor in an adaptor that
passes in the extra null argument to nsAppShellConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D146456
2022-05-17 20:24:19 +00:00
Sebastian Hengst c552340e0c Backed out 5 changesets (bug 1769569) for causing devtools' browser/browser_page_redirection.js to fail. CLOSED TREE
Backed out changeset 66a42eb3a366 (bug 1769569)
Backed out changeset d3cc9629cd9a (bug 1769569)
Backed out changeset edcd3dade079 (bug 1769569)
Backed out changeset 29d8dd058b7a (bug 1769569)
Backed out changeset 1aed34fdf2d3 (bug 1769569)
2022-05-17 19:49:17 +02:00
Mark Banner 5865f044db Bug 1769569 - Fix remaining ESLint no-undef and no-unused-vars issues in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146452
2022-05-17 16:50:33 +00:00
Morgan Reschenberg 5e491aa675 Bug 1763212: Add tests for vertical text caching r=Jamie
Depends on D143527

Differential Revision: https://phabricator.services.mozilla.com/D144893
2022-05-11 20:47:36 +00:00
James Teh be0257f0e6 Bug 1767887: Fix TextLeafPoint paragraph boundary search for the second leaf Accessible and beyond after a block. r=morgan
The code checks whether the origin is inside the block, since if not, the block ends before the origin.
However, it previously didn't handle the case where there was a leaf outside the block between the block and the origin.
An additional check has now been added to handle this case.
This required the code to be restructured somewhat, which hopefully also makes it easier to read/debug.

Differential Revision: https://phabricator.services.mozilla.com/D145867
2022-05-09 23:41:02 +00:00
Morgan Reschenberg 4e6096c73d Bug 1735101: Cache char, line coordinate info to support computing TextBounds and CharBounds in the parent process r=Jamie
Depends on D144767

Differential Revision: https://phabricator.services.mozilla.com/D143527
2022-05-09 20:30:27 +00:00
James Teh 7d2201e688 Bug 1192108: Fire focus events after mutation events but before any other events. r=eeejay
It's critical that we fire mutation events first because our RemoteAccessible tree is created thus and we can't fire events on RemoteAccessibles we haven't created yet.
Beyond that, though, focus events are of primary importance.
See the comments in EventQueue::ProcessEventQueue for the reasons.

Differential Revision: https://phabricator.services.mozilla.com/D145319
2022-05-06 23:59:43 +00:00
Cristian Tuns 3a72bf74a9 Backed out changeset a83bfbf2de62 (bug 1735101) for causing mochitest failures on browser_caching_text_bounds.js CLOSED TREE 2022-05-06 17:35:52 -04:00
Morgan Reschenberg f40daec464 Bug 1735101: Cache char, line coordinate info to support computing TextBounds and CharBounds in the parent process r=Jamie
Depends on D144767

Differential Revision: https://phabricator.services.mozilla.com/D143527
2022-05-06 20:10:59 +00:00
Narcis Beleuzu d4b6401f96 Backed out changeset 337ded6c2bfd (bug 1192108) for geckoview failures on testMoveCaretAccessibilityFocus . CLOSED TREE 2022-05-05 04:17:34 +03:00
James Teh b129b887c5 Bug 1192108: Fire focus events after mutation events but before any other events. r=eeejay
It's critical that we fire mutation events first because our RemoteAccessible tree is created thus and we can't fire events on RemoteAccessibles we haven't created yet.
Beyond that, though, focus events are of primary importance.
See the comments in EventQueue::ProcessEventQueue for the reasons.

Differential Revision: https://phabricator.services.mozilla.com/D145319
2022-05-04 20:35:14 +00:00
James Teh 71595ec7c0 Bug 1767173: When retrieving the cached name, set name string to void when it is empty but not explicitly set empty using alt="". r=eeejay
This distinction between void and empty exists in LocalAccessible, so we should be consistent in RemoteAccessible.
This fixes exposure of explicit-name when the name is empty.
To facilitate this, we no longer assume the name flag is not in the cache just because the name string isn't in the cache, since it could be eNoNameOnPurpose.

Differential Revision: https://phabricator.services.mozilla.com/D145179
2022-05-02 22:37:24 +00:00
James Teh acf1d4f77c Bug 1739560: Update line starts in the cache when they change. r=morgan
If text or bounds change, it's very likely that line starts have changed too, so we push an update for them.
However, if a non-rectangular text span changes its line wrapping without changing its text, the bounds might not change.
In that case, we still get a bounds cache update request; we just determine not to push bounds.
This happens a lot, though.
To limit this, we compare against the cached first line start in LocalAccessible and push an update only if it's different.

If text and bounds both change, we don't want to push two separate cache updates.
We use queued cache updates to prevent this.
This necessitated moving where we send queued cache updates so that we do it before firing mutation events, since clients might need the text to be up to date when handling those events.

Differential Revision: https://phabricator.services.mozilla.com/D144949
2022-04-29 00:44:11 +00:00
Morgan Reschenberg 32487fa3e7 Bug 1763214: Convert ImagePosition, ImageSize to use cached bounds r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D142996
2022-04-28 17:03:49 +00:00
James Teh 16c792ed33 Bug 1766560: Don't ignore the first line start of a RemoteAccessible when retrieving the next line. r=morgan
The code previously returned failure for array index 0, but it did this for both movement directions.
It should only do this for eDirPrevious, since we decrement index in that case.

Differential Revision: https://phabricator.services.mozilla.com/D144785
2022-04-28 10:42:11 +00:00
Butkovits Atila 19ed218d60 Backed out changeset a901a6c26367 (bug 1766560) for causing failures at browser_caching_text. CLOSED TREE 2022-04-28 05:47:17 +03:00
James Teh 60745bde34 Bug 1748393: Fire a name change event when a document's title changes. r=morgan
This causes the cache to be updated.

Differential Revision: https://phabricator.services.mozilla.com/D144770
2022-04-28 02:12:29 +00:00
James Teh ff8c09efee Bug 1766560: Don't ignore the first line start of a RemoteAccessible when retrieving the next line. r=morgan
The code previously returned failure for array index 0, but it did this for both movement directions.
It should only do this for eDirPrevious, since we decrement index in that case.

Differential Revision: https://phabricator.services.mozilla.com/D144785
2022-04-28 02:11:53 +00:00
James Teh 6743bc23ee Bug 1766206: TextLeafPoint: When determining whether an Accessible is at the start of a line, compare with the last continuation of the previous leaf. r=morgan
Previously, we were always comparing with the primary frame of the previous leaf.
If the previous leaf crossed lines, this meant we incorrectly reported that the following leaf started a new line even if it didn't, since the primary frame of the previous leaf was always on a different line.
Now, we use the last continuation (line) of the previous leaf.
This way, if the next leaf continues the final line of the previous leaf, they will have the same line number and so we won't incorrectly report that the next leaf starts a new line.

Differential Revision: https://phabricator.services.mozilla.com/D144781
2022-04-28 02:09:16 +00:00
Mark Banner 1f8462cfdd Bug 1766238 - Stop using the target argument for ChromeUtils.import in accessibility tests. r=Jamie
Depends on D144561

Differential Revision: https://phabricator.services.mozilla.com/D144562
2022-04-27 08:38:35 +00:00
James Teh 7fabfd3b74 Bug 1766142: Expose explicit-name object attribute for cached RemoteAccessibles. r=morgan
The cache already includes this info.
We just needed to use it when exposing attributes to clients.

Differential Revision: https://phabricator.services.mozilla.com/D144684
2022-04-26 23:15:01 +00:00
James Teh 4e63bbff78 Bug 1765460 part 2: Add the scroll offset of the parent in ParentRelativeBounds. r=morgan
This means that cached bounds stay the same regardless of scroll offset.
The scroll position gets subtracted later when calculating absolute bounds.

Differential Revision: https://phabricator.services.mozilla.com/D144392
2022-04-26 07:05:50 +00:00
James Teh 38d42cbd8e Bug 1765460 part 1: Fix testBoundsInContent to correctly enforce both low and high constraints. r=morgan
We use two constraints to ensure the bounds fall within 5 px of the expected values in either direction.
However, the function was using || , so only one constraint was being enforced.
In practice, this meant that we wouldn't fail for any value.
Change this to && to enforce both constraints.

Differential Revision: https://phabricator.services.mozilla.com/D144391
2022-04-26 07:05:49 +00:00
James Teh 4f1f309c35 Bug 1765964: Don't push scrollPosition to the cache if it's 0. r=morgan
In addition, don't send DeleteEntry for Transform for an initial cache update, since there's nothing to delete.
These fixes don't change the behaviour for users, but optimise both cache storage and IPC trafic.

Differential Revision: https://phabricator.services.mozilla.com/D144421
2022-04-25 22:14:36 +00:00
James Teh a3b482acc2 Bug 1395181 part 2: Support click handlers added to the root element. r=eeejay
Normally, we treat the body as the DOM node for a DocAccessible.
However, a click listener can be added to the root element; e.g. the html element.
We now treat a click listener added to the root element the same as if one were added to the body.

This required a change to nsAccessibilityService to use the DocAccessible when click listeners change for the root element so a cache update is pushed.
This change was made for the body also, since we weren't pushing a cache update for click listener changes on the body either.

Differential Revision: https://phabricator.services.mozilla.com/D144278
2022-04-22 23:13:36 +00:00
James Teh ddd6d00a57 Bug 1395181 part 1: Support "click ancestor" action on descendants when an ancestor has an action. r=eeejay
Previously, we supported an action on text leaf and image accessibles if an ancestor was a link or was clickable.
However, we didn't support it on any other kind of descendant, nor could clients differentiate between a click handler on the descendant itself vs an action propagated because of an ancestor.
In addition, the click was performed on the ancestor element itself, rather than bubbling up to the ancestor.
This was probably never a real problem given the limited scope, but it meant that the actual event target was lost.

This has been replaced by a "click ancestor" action supported on all descendants of ancestors providing an action.
The click is dispatched to the descendant and bubbles up to the ancestor.
Aside from consistency and the ability to differentiate the action, this allows clients to stop relying on simulating clicks themselves to directly target a descendant.
This avoids problems caused by obscured web elements, obscured browser windows and other weird screen coordinate issues.
It thus fixes several problems reported by NVDA screen reader users.

Differential Revision: https://phabricator.services.mozilla.com/D144252
2022-04-22 23:13:36 +00:00
James Teh cc18ee7d76 Bug 1764500: Fire correct state change events when designMode is changed on a document. r=eeejay
Previously, we used the obs_documentCreated observer message fired by editor.
However, this is fired when an editor is created anywhere in the document, even if it's for a descendant.
This meant that we were firing an editable state change on the document when a descendant became contentEditable.
In turn, this resulted in the document always having the editable state in the cache if there was a contentEditable descendant.

This message also isn't fired if an editor already exists (e.g. for a contentEditable descendant) and designMode is turned on for the document.
This meant that we wouldn't fire an event in that case, resulting in an incorrect cache.

There is no usable equivalent to detect when designMode is turned off.
While there is obs_documentWillBeDestroyed, that doesn't ever seem to get fired.
This meant that we didn't fire a state change when designMode was turned off, also resulting in an incorrect cache.

To fix all of these issues, we now watch for NS_EVENT_STATE_READWRITE changes on the root element of the document.
Because we use the root element (not the body), this should avoid duplicate state changes for contentEditable changes on the body, which get handled by LocalAccessible::DOMAttributeChanged.

Finally, we previously fired only an editable state change, but changing the editable state of a document also impacts the read-only state.
This too resulted in an incorrect cache.
We now fire a read-only state change as well.

Differential Revision: https://phabricator.services.mozilla.com/D143969
2022-04-22 00:02:29 +00:00
James Teh fef89de8c9 Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan
Aside from adding ScrollTo to the Windows PDocAccessible IPDL, This mostly just moves methods into base classes and adapts platform code to use the unified Accessible::ScrollTo.

Differential Revision: https://phabricator.services.mozilla.com/D143655
2022-04-18 21:55:39 +00:00
James Teh a69dcf58d4 Bug 1764249: Make HyperTextAccessibleBase::CroppedSelectionRanges remove collapsed ranges when called on a document. r=morgan
There's no point cropping ranges when called on the document, but we still want to remove collapsed ranges.
The path to hell is paved with premature optimisation. :(

Differential Revision: https://phabricator.services.mozilla.com/D143579
2022-04-13 21:22:49 +00:00
James Teh 800dd1d2a8 Bug 1760735: Support TableAccessibleBase in AccGroupInfo. r=eeejay
This enables AccGroupInfo::TotalItemCount to work for CachedTableAccessibles.
This still doesn't yet support aria-row/colcount for cached RemoteAccessibles.

Differential Revision: https://phabricator.services.mozilla.com/D141818
2022-04-12 23:49:57 +00:00
James Teh fa5d442869 Bug 1760939 part 2: Move LinkCount to HyperTextAccessibleBase. r=eeejay
This updates the XPCOM, ATK and Windows implementations too.

Differential Revision: https://phabricator.services.mozilla.com/D142028
2022-04-11 23:20:14 +00:00
James Teh 28d9ce246b Bug 1735970 part 18: Add browser tests to exercise table support for both local and remote Accessibles. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D141221
2022-04-01 09:50:02 +00:00
James Teh dbbb25abc4 Bug 1735970 part 17: Load a11y browser test snippets in standards mode instead of quirks mode. r=morgan
This is needed to make rowspan="0" work, as this is ignored in quirks mode.

Differential Revision: https://phabricator.services.mozilla.com/D141220
2022-04-01 09:50:02 +00:00
James Teh cc758fd688 Bug 1550644: nsTextEquivUtils: Add space for block elements when we encounter them. r=eeejay,adw
Previously, when we were about to add text from a text node, we looked at the parent to determine if it was a block element and added space based on that.
This caused problems if there were multiple text nodes inside a block because we ended up adding space between those text nodes, even if there was no intervening block.
Instead, since we're walking the tree, we now add space whenever we encounter a block, both before and after its descendants.
If there are multiple adjacent blocks, this does mean we append multiple spaces, but we compress space befor returning to the caller anyway.
This fixes highlights in address bar suggestions being separated from the rest of the suggestion.

Differential Revision: https://phabricator.services.mozilla.com/D141722
2022-03-24 00:06:15 +00:00
criss 34d3fb88a2 Backed out 18 changesets (bug 1735970) for causing hazard bustages.CLOSED TREE
Backed out changeset e7af2be486ce (bug 1735970)
Backed out changeset 73c93a18f65b (bug 1735970)
Backed out changeset 7e48716784d2 (bug 1735970)
Backed out changeset 30f61cdfd3c0 (bug 1735970)
Backed out changeset 3e4697e57570 (bug 1735970)
Backed out changeset 16ac3bec2412 (bug 1735970)
Backed out changeset 945ef21895ec (bug 1735970)
Backed out changeset 5dbfbf341ff8 (bug 1735970)
Backed out changeset d498d61c8f5a (bug 1735970)
Backed out changeset 50a2ee53b763 (bug 1735970)
Backed out changeset 9e2e11ea1a3d (bug 1735970)
Backed out changeset cf84daf9e40f (bug 1735970)
Backed out changeset 003bbf7f5f24 (bug 1735970)
Backed out changeset 00f1fbedc774 (bug 1735970)
Backed out changeset b17a1182539b (bug 1735970)
Backed out changeset 6d0f4821ddcf (bug 1735970)
Backed out changeset d82660fb5408 (bug 1735970)
Backed out changeset e506a5b04bf4 (bug 1735970)
2022-03-23 10:27:08 +02:00
Marian-Vasile Laza a019566c16 Backed out changeset 60cf5a19aa68 (bug 1550644) for causing bc failures on browser_autocomplete_a11y_label.js. 2022-03-23 00:03:11 -07:00
James Teh eac5a2f41a Bug 1550644: nsTextEquivUtils: Add space for block elements when we encounter them. r=eeejay
Previously, when we were about to add text from a text node, we looked at the parent to determine if it was a block element and added space based on that.
This caused problems if there were multiple text nodes inside a block because we ended up adding space between those text nodes, even if there was no intervening block.
Instead, since we're walking the tree, we now add space whenever we encounter a block, both before and after its descendants.
If there are multiple adjacent blocks, this does mean we append multiple spaces, but we compress space befor returning to the caller anyway.
This fixes highlights in address bar suggestions being separated from the rest of the suggestion.

Differential Revision: https://phabricator.services.mozilla.com/D141722
2022-03-23 05:49:46 +00:00
James Teh 52f5f0fc2d Bug 1735970 part 18: Add browser tests to exercise table support for both local and remote Accessibles. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D141221
2022-03-23 04:00:32 +00:00
James Teh 5e8371dc5a Bug 1735970 part 17: Load a11y browser test snippets in standards mode instead of quirks mode. r=morgan
This is needed to make rowspan="0" work, as this is ignored in quirks mode.

Differential Revision: https://phabricator.services.mozilla.com/D141220
2022-03-23 04:00:32 +00:00
Eitan Isaacson ce4771430d Bug 1713050 - P3: Add more granularities to AXSelectedTextChanged events. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D139747
2022-03-16 05:56:26 +00:00
Eitan Isaacson a479c8f191 Bug 1713050 - P2: Add granularity to a11y caret move events. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D139746
2022-03-16 05:56:25 +00:00
Morgan Reschenberg 1fcc546b3a Bug 1733268: Cache states::OPAQUE1, update state on style change r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D140894
2022-03-15 18:46:46 +00:00
Emilio Cobos Álvarez 7ae76472af Bug 1759121 - Adjust an accessibility test that depended on a selectable block being after a <br>. r=morgan
An alternative would be to adjust the test expectation to not include
the trailing newline, but this seemed more likely to be what the test
wanted to test.

Differential Revision: https://phabricator.services.mozilla.com/D140954
2022-03-14 21:22:30 +00:00