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
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
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
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
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
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
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
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
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
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
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
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
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
We already have a similar cache in local HyperTextAccessible.
Unfortunately, we can't use common code here because we don't want to waste memory having a member variable on all RemoteAccessibles, but local HyperTextAccessibles don't have mCachedFields.
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.
Differential Revision: https://phabricator.services.mozilla.com/D145079
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
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
This creates a clearer distinction between local pivots and remote
pivots. The former happens in the parent process and the latter happens
in the remote content process.
Differential Revision: https://phabricator.services.mozilla.com/D144482
This creates a clearer distinction between local pivots and remote
pivots. The former happens in the parent process and the latter happens
in the remote content process.
Differential Revision: https://phabricator.services.mozilla.com/D144482
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
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
We can use the base classes for both local and cached remote Accessibles.
However, non-cached RemoteAccessibles need to be handled separately still because we can't implement the table interfaces for those.
Differential Revision: https://phabricator.services.mozilla.com/D141218
This gets/creates the CachedTableAccessible when AsTableBase/AsTableCellBase is called.
It also invalidates the table cache when mutations occur.
Differential Revision: https://phabricator.services.mozilla.com/D141208
These are needed to support RemoteAccessible tables.
Stuff specific to LocalAccessible is still in TableAccessible and TableCellAccessible, which now inherit from the new Base classes.
Covariant return types have been used to minimise changes in LocalAccessible callers.
Differential Revision: https://phabricator.services.mozilla.com/D141205
There is no base class for local (DocAccessible) and remote (DocAccessibleParent) documents, so this adds nsAccUtils::GetAccessibleByID.
Differential Revision: https://phabricator.services.mozilla.com/D141207
Testing this is hard because the point of failure would be if we
recieved NotifyOfResolutionChange before the IPC doc is constructed.
Differential Revision: https://phabricator.services.mozilla.com/D141904
We can use the base classes for both local and cached remote Accessibles.
However, non-cached RemoteAccessibles need to be handled separately still because we can't implement the table interfaces for those.
Differential Revision: https://phabricator.services.mozilla.com/D141218
This gets/creates the CachedTableAccessible when AsTableBase/AsTableCellBase is called.
It also invalidates the table cache when mutations occur.
Differential Revision: https://phabricator.services.mozilla.com/D141208
These are needed to support RemoteAccessible tables.
Stuff specific to LocalAccessible is still in TableAccessible and TableCellAccessible, which now inherit from the new Base classes.
Covariant return types have been used to minimise changes in LocalAccessible callers.
Differential Revision: https://phabricator.services.mozilla.com/D141205
There is no base class for local (DocAccessible) and remote (DocAccessibleParent) documents, so this adds nsAccUtils::GetAccessibleByID.
Differential Revision: https://phabricator.services.mozilla.com/D141207
A non-document RemoteAccessible can have a null parent while it is being moved.
This is only temporary, but it's possible for a client call to execute in this state.
We must not return the local OuterDoc in this case, as this definitely isn't a valid child of an OuterDoc.
To achieve this, the logic for handling document parents was moved to DocAccessibleParent.
This makes it easier to understand exactly how documents are handled in contrast to normal RemoteAccessibles.
Differential Revision: https://phabricator.services.mozilla.com/D141065
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.
Differential Revision: https://phabricator.services.mozilla.com/D140004
The original non-Windows RemoteAccessible SelectionBoundsAt method still exists because it allows the caller to retrieve both the offsets and the text in a single call, which can't be done with the unified API.
Thus, platform code still needs a separate code path for non-cached RemoteAccessible.
Differential Revision: https://phabricator.services.mozilla.com/D139343
Current mochitests should prove the soundness of this. The only thing
preventing this from becoming a non-virtual method is the reliance
on TagName which is only available when cached is enabled. When it
is disabled we need to fallback on the sync IPDL call.
Differential Revision: https://phabricator.services.mozilla.com/D138964
This also adds Accessible::DisplayStyle, as we sometimes want to be able to get the display style without fetching all the Attributes.
Differential Revision: https://phabricator.services.mozilla.com/D138629
When a linkable accessible has an action because of an ancestor, don't
cache it directly, but instead walk up in the parent process to find it.
Depends on D137200
Differential Revision: https://phabricator.services.mozilla.com/D137201
This was causing LinkAt to return a bullet instead of the first embedded object in a list item, breaking rendering with NVDA when the cache was enabled.
Rather than adding another role to RemoteAccessibleBase::IsEmbeddedObject, I changed it to use IsText().
This is consistent with how embedded objects are determined for LocalAccessible in EmbeddedObjCollector.
I think the reason this previously used roles is that when this was originally implemented, AccTypes weren't remoted, so IsText() couldn't be used.
Differential Revision: https://phabricator.services.mozilla.com/D138506
Similar to StartOffset:
1. There was a Windows non-cached RemoteAccessible implementation, but it was never actually called, so I removed it.
2. The sync IPDL RemoteAccessible implementation previously provided a boolean indicating success.
I removed this because the LocalAccessible implementation doesn't have this and it doesn't seem like remote is special in this respect.
Differential Revision: https://phabricator.services.mozilla.com/D138243
This is a mechanical change which was performed by a script based on the
contents of direct_call.py, and then manually checked over to fix
various rewriting bugs caused by my glorified sed script. See the
previous part for more context on the change.
Differential Revision: https://phabricator.services.mozilla.com/D137227
This also unifies the code path for TextAtOffset in ATK, rather than having different local and remote code paths.
This isn't strictly related to this patch series, but this change was missed before, so I took the opportunity to deal with it here.
Differential Revision: https://phabricator.services.mozilla.com/D137504
Now that we cache ActionCount, we can check for the absence of actions
and return false, or send an async message and return true.
Differential Revision: https://phabricator.services.mozilla.com/D135909
Move ActionCount/ActionNameAt/ActionDescriptionAt to Accessible,
use cached values in RemoteAccessible, and tweak platforms.
Also introduce browser test.
Differential Revision: https://phabricator.services.mozilla.com/D135908
Now that we cache ActionCount, we can check for the absence of actions
and return false, or send an async message and return true.
Differential Revision: https://phabricator.services.mozilla.com/D135909
Move ActionCount/ActionNameAt/ActionDescriptionAt to Accessible,
use cached values in RemoteAccessible, and tweak platforms.
Also introduce browser test.
Differential Revision: https://phabricator.services.mozilla.com/D135908
Now that we cache ActionCount, we can check for the absence of actions
and return false, or send an async message and return true.
Differential Revision: https://phabricator.services.mozilla.com/D135909
Move ActionCount/ActionNameAt/ActionDescriptionAt to Accessible,
use cached values in RemoteAccessible, and tweak platforms.
Also introduce browser test.
Differential Revision: https://phabricator.services.mozilla.com/D135908