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

9821 Коммитов

Автор 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 5f868bebc7 Bug 1771736 part 2: Only push a cache update for text if the text actually changes. r=morgan
Layout sends a11y text update notifications during reflow even if the text hasn't changed.
TextUpdater already detects this case, so just move our cache update calls to TextUpdater.

Differential Revision: https://phabricator.services.mozilla.com/D147656
2022-06-01 00:35:26 +00:00
James Teh 1fcd045e66 Bug 1771736 part 1: Update cached spelling errors when a spelling error is removed. r=morgan,smaug
I originally thought we didn't need to be explicitly notified about removals because a correction always triggers a text change and we push a cache update for spelling errors whenever the text changes.
However, it seems that even when a correction is made and the text changes, the spell check ranges aren't yet up to date.
Previously, we were pushing a cache update whenever text was reflowed, which was taking care of this.
Soon, we don't want to push text cache updates if the text doesn't actually change.
We remove the reliance on these redundant text updates by having an explicit notification for spell check removals.

Differential Revision: https://phabricator.services.mozilla.com/D147655
2022-06-01 00:35:26 +00:00
James Teh 8cda799e04 Bug 1756728 part 3: Remove now unused PDocAccessible::URL. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D147718
2022-06-01 00:34:18 +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 4d3f66b120 Bug 1756728 part 1: Make it possible to retrieve a BrowsingContext from a DocAccessibleParent. r=morgan
Previously, even for remote in-process iframes, it was only possible to retrieve the top level BrowsingContext for the remote process by getting the managing BrowserParent.
This makes it possible to get the correct BrowsingContext even for in-process iframes.

Differential Revision: https://phabricator.services.mozilla.com/D147716
2022-06-01 00:34:17 +00:00
Eitan Isaacson 766f8978fc Bug 1772019 - Wait for PresShell to be initialized before doing WillRefresh tick. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147812
2022-05-31 22:56:32 +00:00
Eitan Isaacson efc6b17146 Bug 1771271 - Check for mCachedFields for all remote accessibles in BoundsWithOffset. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147791
2022-05-31 19:24:27 +00:00
serge-sans-paille d815003637 Bug 1771369 - Cleanup accessible/atk includes r=sylvestre DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D147445
2022-05-31 10:06:54 +00:00
Emilio Cobos Álvarez 9c190fff4b Bug 1771564 - Constify ComputedStyle usage in nsComputedDOMStyle. r=dholbert
None of the consumer need to mutate styles, and this saves some ugly
const_casting on the next patch.

Doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D147555
2022-05-28 01:04:24 +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 7564ed957c Bug 1737919 part 4: Update cached spelling errors when a spelling error is added without the text changing. r=morgan,smaug
We already have an nsISelectionListener, but that only tells us that a change happened somewhere in the selection, not which range changed.
We don't want to push a cache update for all ranges when only one changed.
Therefore, this patch adds an accessibility notification in mozInlineSpellChecker::AddRange.
We don't need this for removed ranges because the text will change for any spelling error corrections and text updates trigger spelling error cache updates.

Differential Revision: https://phabricator.services.mozilla.com/D147244
2022-05-27 10:56:41 +00:00
James Teh 3daa72eb49 Bug 1737919 part 3: Support spelling errors for cached RemoteAccessibles. r=morgan
Even though spelling errors can cross Accessibles and are represented in the DOM as ranges, we cache them for each text leaf.
This is necessary so that we correctly update the offsets when text is inserted or removed from a leaf.
We cache them as an array of offsets, including both the start and end offset for each range.
We use -1 as the start offset to indicate when a spelling error starts in a previous Accessible.
When a spelling error starts in an Accessible but ends in a subsequent one, we simply don't include an end offset in the array.
This structure means we can easily query spelling error points or ranges with a binary search.

Differential Revision: https://phabricator.services.mozilla.com/D147243
2022-05-27 10:56:41 +00:00
James Teh e02ce0a43e Bug 1737919 part 2: Support spelling errors in TextLeafPoint for LocalAccessibles. r=morgan
The implementation searches for spelling errors in each leaf, as this is how we will need to do it for RemoteAccessibles.

Differential Revision: https://phabricator.services.mozilla.com/D147242
2022-05-27 10:56:40 +00:00
James Teh efe397519e Bug 1737919 part 1: TextLeafPoint::FindTextAttrsStart: Don't allow the caller to supply origin attributes. r=morgan
This was done for LocalAccessibles to avoid the need to fetch attributes twice when we're simultaneously fetching boundaries and returning the attributes to a client.
However, GetTextAttributes will soon handle spelling errors, so it will no longer return the same data as GetTextAttributesLocalAcc (which doesn't handle spelling errors).
This breaks the equality checks in FindTextAttrsStart.
Aside from this, this argument was somewhat confusing.

For now, just remove aOriginAttrs, which means there will be some redundant calls to GetTextAttributesLocalAcc.
Parent process documents shouldn't be that large anyway.
If this ends up being a real problem, we can either revert to the local HyperTextAccessible implementation of text attributes or implement a smarter temporary cache.

Differential Revision: https://phabricator.services.mozilla.com/D147241
2022-05-27 10:56:40 +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
James Teh 0ea37698e8 Bug 1771060: Make use of the line cursor in IsLocalAccAtLineStart to improve performance. r=jfkthame
For block frames, nsLineIterator doesn't use the line cursor, so switch to nsBlockInFlowLineIterator.
We don't actually care about the line number here anyway.

Differential Revision: https://phabricator.services.mozilla.com/D147237
2022-05-27 01:22:07 +00:00
James Teh a5eb156496 Bug 1770162: Fix MsaaIdGenerator timer assertion during shutdown. r=morgan
There can be LocalAccessibles which don't die until the final cycle collection during XPCOM shutdown.
MsaaIdGenerator::ReleaseID (called during deletion of a LocalAccessible) uses a timer when the cache is enabled, but timers can't be used after XPCOM shutdown.
This was causing an assertion.
In addition, because MsaaIdGenerator is a static instance, the timer could be deleted after XPCOM shutdown, causing a warning.
To fix this:

1. If accessibility is shut down, just release ids immediately.
2. Clean up any remaining ids and the timer on XPCOM shutdown.

A better solution would be to create and terminate MsaaIdGenerator during a11y startup and shutdown, but this is a bit tricky while we still have the non-cache code paths.
Once we don't need the non-cache code, MsaaIdGenerator will become a lot simpler, so this refactor will be easier then.

Differential Revision: https://phabricator.services.mozilla.com/D146866
2022-05-23 22:05:52 +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
Florian Quèze cd5e71dee5 Bug 1745024 - avoid keeping an 'Accessibility notifications' refresh observer for initial about:blank documents, r=Jamie.
Differential Revision: https://phabricator.services.mozilla.com/D143747
2022-05-21 00:23:09 +00:00
Eitan Isaacson c42dbc8b0f Bug 1769640 - P1: Cache content AUPDP in DocAccessibleParents. r=morgan,emilio
This change allows us to remove the `FullZoom` multiplier and fixes text
bounds caclulations in a zoomed page.

Testing: The current browser scroll/bounds tests pass (with the
exception of fission iframes which were already broken).

Differential Revision: https://phabricator.services.mozilla.com/D146507
2022-05-20 16:39:50 +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
James Teh 592446771c Bug 1768219: Don't walk ancestors on all Accessibles to find an action when serialising the IPC tree. r=eeejay
This was causing a performance regression.
We now only do this for text leaf and image Accessibles, which gets us back to where we were before bug 1395181.
This means we can't support "click ancestor" on ATK.
There weren't requests for this on ATK anyway.
In future, we can probably support this using the information in the cache.

Differential Revision: https://phabricator.services.mozilla.com/D146528
2022-05-17 06:31:45 +00:00
Nika Layzell 2b307c5cea Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-13 14:16:09 +00:00
Eitan Isaacson dbd21dbf8b Bug 1768927 - Preload localized role strings and heading levels at init. r=Jamie
We can't use the StringBundle object off the main thread. We need to
pre-load all the strings we may use. This is a small set of roles. We
also need formatted heading levels, so we preload heading level 1 to 6.

Differential Revision: https://phabricator.services.mozilla.com/D146112
2022-05-13 05:00:55 +00:00
Eitan Isaacson 85225ac3d9 Bug 1768972 - Introduce FireEvent to avoid android monitor lock reentry. r=Jamie
We rely on Recv events to be called from child processes and not from
other Recv events. If this happens we risk reentry in regards to the
android monitor lock. So this patch introduces FireEvent for internal
use where secondary events need to be fired like a reorder when a new
sub-document is added.

Differential Revision: https://phabricator.services.mozilla.com/D146134
2022-05-12 22:41:44 +00:00
Eitan Isaacson 4bec8d9205 Bug 1768913 - Don't send window content changed event when loaded about:blank. r=morgan
Testing note - this enables junit tests to start and pass more reliably
when caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D146106
2022-05-11 22:09:12 +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
Noemi Erli 45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Eitan Isaacson 7e7246091a Bug 1768726 - Make RemoteAccessibleBase::BoundsWithOffset thread safe for Android. r=morgan
In Android we need to keep the remote accessible methods thread safe. That means no direct references to local accessibles, or anything DOM or layout.

We have the advantage of always being remote except for a 0 offset browser element, and no support for full page zoom.

Also removed the visual/layout viewport offset in the bounds method since
the top level doc will always have its visual and layout viewport match.

Differential Revision: https://phabricator.services.mozilla.com/D146006
2022-05-10 22:57:32 +00:00
James Teh 780d656a9c Bug 1768391: Invalidate the remote HyperText offsets cache when we mutate the tree. r=eeejay
Previously, we invalidated this cache when the reorder event arrived.
Because the mutation and the reorder event happen in separate IPDL calls, it's possible for a client call to arrive between them.
If that client call queried HyperText offsets, this could result in returning incorrect information to the client or even a parent process crash.
Now, we invalidate the cache during the mutation, so there's no possibility of an intervening client call.
It made sense to put this invalidation call in RemoteAccessibleBase, so I also moved the call to invalidate for text leaf updates into RemoteAccessibleBase so that they're both in the same class.

Differential Revision: https://phabricator.services.mozilla.com/D145845
2022-05-10 22:56:57 +00:00
Nika Layzell 728ba534f6 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-10 22:27:42 +00:00
James Teh 3a25e381f9 Bug 1766270: Null check IPCDoc() in Android DocAccessibleWrap::CacheViewportCallback. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D145847
2022-05-10 22:19:53 +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
Noemi Erli 39469989c9 Backed out 22 changesets (bug 1759572, bug 1759563, bug 1754004, bug 1754031, bug 1759569, bug 1696894) for causing multiple failures CLOSED TREE
Backed out changeset d69647a725a1 (bug 1754004)
Backed out changeset 09fc506865d7 (bug 1754004)
Backed out changeset 648e3dd4b62f (bug 1754004)
Backed out changeset 3465158ee230 (bug 1696894)
Backed out changeset b08475bbfbd9 (bug 1754004)
Backed out changeset dfabce587a56 (bug 1754004)
Backed out changeset cebe8d5dda34 (bug 1754004)
Backed out changeset 55b4b0c9a504 (bug 1754004)
Backed out changeset e8649de9dd22 (bug 1754004)
Backed out changeset 0f480fc861c0 (bug 1754004)
Backed out changeset e515b7edd1c8 (bug 1754004)
Backed out changeset fe90db9158ac (bug 1754004)
Backed out changeset c6388d682d48 (bug 1754004)
Backed out changeset 2374420d9fed (bug 1754004)
Backed out changeset 44dfd76472aa (bug 1754004)
Backed out changeset 000fb99de0cf (bug 1754004)
Backed out changeset 0ca1856b5fc9 (bug 1754004)
Backed out changeset 10c3683b998b (bug 1754004)
Backed out changeset 4abc98ed6b99 (bug 1759572)
Backed out changeset cdd271a5af42 (bug 1759563)
Backed out changeset fadb6cc0d81c (bug 1759569)
Backed out changeset 44be9709a93e (bug 1754031)
2022-05-06 04:28:47 +03:00
Nika Layzell 0308ac11a4 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-05 23:34:21 +00:00
James Teh 65c8359c0d Bug 1766794: Lazily cache HyperText offsets for RemoteAccessibles. r=eeejay
We already had a similar cache in local HyperTextAccessible.
This improves performance significantly when walking the text attributes of a container with a large number of text leaf children, such as is encountered when using view source.
This patch unifies that cache across local and remote.
For simplicity, the cache invalidation strategy is more naive/aggressive.

Differential Revision: https://phabricator.services.mozilla.com/D145079
2022-05-05 11:14:12 +00:00
Sebastian Hengst 400d67b480 Merge autoland to mozilla-central. a=merge 2022-05-05 11:38:28 +02:00
Sebastian Hengst 7ddbeea9d6 Backed out 17 changesets (bug 1696894, bug 1754004) for causing crashes e.g. bug 1767808, and hanging Gmail (bug 1767918). a=backout DONTBUILD
Backed out changeset 63f17a06eba9 (bug 1754004)
Backed out changeset 017e1552d549 (bug 1754004)
Backed out changeset 010dfd821cf3 (bug 1696894)
Backed out changeset 96a39c2ba7a3 (bug 1754004)
Backed out changeset a147df47a0e3 (bug 1754004)
Backed out changeset 9018dd592230 (bug 1754004)
Backed out changeset 234ff9e092c2 (bug 1754004)
Backed out changeset c4f1e86992b6 (bug 1754004)
Backed out changeset 51bd50b57dd5 (bug 1754004)
Backed out changeset d95e7ad0eafa (bug 1754004)
Backed out changeset 35a69828091c (bug 1754004)
Backed out changeset 6802a4326963 (bug 1754004)
Backed out changeset e40e810e18fc (bug 1754004)
Backed out changeset 82b38c12b298 (bug 1754004)
Backed out changeset 0a6cf0817bf5 (bug 1754004)
Backed out changeset 6d8e51b3e8d7 (bug 1754004)
Backed out changeset 2059c2d0d880 (bug 1754004)
2022-05-05 11:27:42 +02:00
Butkovits Atila 7854b3ad09 Backed out changeset a81a40b250b4 (bug 1766794) for causing marionette failures. CLOSED TREE 2022-05-05 08:42:09 +03:00
James Teh 3754f65b27 Bug 1766794: Lazily cache HyperText offsets for RemoteAccessibles. r=eeejay
We already had a similar cache in local HyperTextAccessible.
This improves performance significantly when walking the text attributes of a container with a large number of text leaf children, such as is encountered when using view source.
This patch unifies that cache across local and remote.
For simplicity, the cache invalidation strategy is more naive/aggressive.

Differential Revision: https://phabricator.services.mozilla.com/D145079
2022-05-05 04:31:12 +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