This required changing the RemoteAccessible implementations to return Relation instead of an array of RemoteAccessible.
Platform implementations have been updated to use the unified method where appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D152959
Previously, Relation::Next returned a LocalAccessible.
Now, it returns an Accessible so that it can support RemoteAccessible as well.
Relation::LocalNext has been added as a convenience to return a LocalAccessible when the caller is certain that only LocalAccessible is relevant.
Callers have either been updated to use LocalNext or to handle an Accessible returned from Next.
ia2AccessibleRelation now holds an array of MsaaAccessible, as we need to hold references and we can't hold references to RemoteAccessible.
Differential Revision: https://phabricator.services.mozilla.com/D152957
1. When we receive text for a text leaf, even for an initial cache push. Previously, we only did this for a cache update. However, a client call could arrive between the tree push and the initial cache push, resulting in an incorrect offsets cache.
2. When an Accessible is moved. Previously, if a client queried an Accessible while it was being moved or if an Accessible had children before the move but no children after, the cached HyperText offsets could be invalid.
Differential Revision: https://phabricator.services.mozilla.com/D153139
This is possible if a client query arrives between the two IPDL calls for the tree and the cache.
This might even happen for an ancestor in the case of an OOP iframe, where IPDL calls for the two documents might be interspersed.
Differential Revision: https://phabricator.services.mozilla.com/D153134
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.
Non-virtual actors can still use `nsString` if they need to on the
receiving end.
Differential Revision: https://phabricator.services.mozilla.com/D152519
1. Move AccessKey to base Accessible.
2. Retrieve AccessKey from the cache for RemoteAccessible.
3. Update XPCOM and platform specific code accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D151202
KeyboardShortcut is only supported for XUL menu items.
XUL menu items can never be remote, so there's no point in querying this via IPDL.
Differential Revision: https://phabricator.services.mozilla.com/D151199
1. Move AccessKey to base Accessible.
2. Retrieve AccessKey from the cache for RemoteAccessible.
3. Update XPCOM and platform specific code accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D151202
KeyboardShortcut is only supported for XUL menu items.
XUL menu items can never be remote, so there's no point in querying this via IPDL.
Differential Revision: https://phabricator.services.mozilla.com/D151199
As part of this, aria-relevant is now exposed via object attributes.
This is necessary to ensure it is included in the cache.
There's no good reason not to expose it anyway, since we already expose the other live region attributes.
Differential Revision: https://phabricator.services.mozilla.com/D150380
As part of this, aria-relevant is now exposed via object attributes.
This is necessary to ensure it is included in the cache.
There's no good reason not to expose it anyway, since we already expose the other live region attributes.
Differential Revision: https://phabricator.services.mozilla.com/D150380
This also changes LocalAccessible::Attributes to ignore the edge case of an empty role attribute when calculating xml-roles.
This is consistent with how we handle the role attribute elsewhere (see aria::GetRoleMapIndex) and makes it easier to handle this consistently between local and remote.
Differential Revision: https://phabricator.services.mozilla.com/D149594
We were previously looking for a doc (IsDoc), but we'll never get any doc in a viewport cache except for the doc whose viewport we are searching.
Instead, if we encounter an iframe, we'll hit an OuterDoc (IsOuterDoc) which is the Accessible for the iframe element.
In that case, we walk *inside* that OuterDoc to get its embedded document, then recurse from there if appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D149247
Sometimes, the document occurs too early in the viewport cache, perhaps even right at the start.
We weren't benefitting from it being in the cache anyway, since we always skipped it.
We already have a fallback in ChildAtPoint for the case where we didn't find a matching Accessible, so we rely on that to handle returning the document when appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D149493
Our hit testing tests need this.
This adds a base Accessible::BoundsInCSSPixels implementation which relies on BoundsInAppUnits.
BoundsInAppUnits was also moved to Accessible, but it is implemented differently for local and remote, so the base method is abstract.
I also did a drive-by removal of a pointless conditional in xpcAccessible::GetBounds.
Differential Revision: https://phabricator.services.mozilla.com/D149374
This hittesting approach is borrowed from our Android implementation.
We maintain a cache of ID's for accessibles which are visible in the viewport.
This cache is created with a call to `nsLayoutUtils::GetFramesForArea`, which
returns frames in the viewport, in hittesting order.
In the parent process, we walk through the cache, keeping track of accs whose
bounds contain the hittesting point. Depending on if we're searching for the
direct child, or the deepest child, we walk the entire cache or return the
first match.
Each document (in the content process) maintains a dirty bit, which gets set
any time an acc it contains bundles either a text update, or an update that
affects bounds. We check whether this bit is set in `DidRefresh` after getting
a notification from our post-refresh observer. If that bit is set, we
queue a cache update for the `::Viewport` domain on the current document.
Because this cache depends on the viewport being painted, we include the
`IgnorePaintSuppression` flag in our `GetFramesForArea` call. This ensures
the display lists are built before the page finishes loading.
Differential Revision: https://phabricator.services.mozilla.com/D147225
This hittesting approach is borrowed from our Android implementation.
We maintain a cache of ID's for accessibles which are visible in the viewport.
This cache is created with a call to `nsLayoutUtils::GetFramesForArea`, which
returns frames in the viewport, in hittesting order.
In the parent process, we walk through the cache, keeping track of accs whose
bounds contain the hittesting point. Depending on if we're searching for the
direct child, or the deepest child, we walk the entire cache or return the
first match.
Each document (in the content process) maintains a dirty bit, which gets set
any time an acc it contains bundles either a text update, or an update that
affects bounds. We check whether this bit is set in `DidRefresh` after getting
a notification from our post-refresh observer. If that bit is set, we
queue a cache update for the `::Viewport` domain on the current document.
Because this cache depends on the viewport being painted, we include the
`IgnorePaintSuppression` flag in our `GetFramesForArea` call. This ensures
the display lists are built before the page finishes loading.
Differential Revision: https://phabricator.services.mozilla.com/D147225
When a DocAccessibleParent is destroyed, we don't call Shutdown on its RemoteAccessibles to avoid pointless cleanup overhead.
Previously, this meant we weren't cleaning up associated CachedTableAccessibles.
We now explicitly clean these up in DocAccessibleParent::Destroy.
Differential Revision: https://phabricator.services.mozilla.com/D148086
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