Diffing text can make for confusing screen reader readouts in live regions. To
address this, this revision causes gecko to avoid sending update events for
solely the diff. Instead, gecko will now send a text update event that causes
us to re-read the entire text node. This brings us in line with Chrome.
Notably, if the text is editable, we'll continue to diff as usual to avoid
clients reading too much text on each edit.
Differential Revision: https://phabricator.services.mozilla.com/D158822
These should never be out of sync.
Previously, they could be out of sync for an ARIA table with display: contents, since we don't create an ARIAGridAccessible in that case (bug 1494196).
While that incorrect creation is itself a bug that we should fix, I don't want to deal with that here.
Instead, don't check ARIA generic types in Accessible::IsTable, only the class generic types, as we already do for IsTableCell.
This fixes a crash in BundleFieldsForCache.
In addition, while the crash is fixed by the above change, as an optimisation, BundleFieldsForCache now just calls AsTable instead of calling IsTable first, since the IsTable call is redundant.
This second fix alone would be sufficient to fix the crash, but the first will catch other potential instances of this problem.
Differential Revision: https://phabricator.services.mozilla.com/D158548
1. When constructing a TextLeafPoint and searching for a leaf, do not descend inside an OuterDoc (iframe/browser).
Otherwise, we end up inside another document.
Other TextLeafPoint code avoids crossing document boundaries, so the constructor must do this too.
2. When searching for a leaf, include an OuterDoc, but don't walk inside it.
Previously, we skipped OuterDocs altogether.
This meant that if you started on an OuterDoc, walking backward and then forward by character would never return you to your origin.
Also, clients walking the document text shouldn't just skip iframes altogether, so exposing them as a single character makes more sense.
This fixes infinite loops in OffsetAtPoint when querying a container with an iframe at the end.
Differential Revision: https://phabricator.services.mozilla.com/D158740
We shouldn't expose the user-pass section of document URI to another apps since
it's sensitive data, but non-malicious a11y API users must not need it.
Additionally, `data` and `blob` URI may be too big (e.g., can be some mega
bytes) and they may need to allocate too big string multiple times in the heap
per URI. Therefore, the accessibility module should stop handling URI as-is if
the document URI is one of them.
Differential Revision: https://phabricator.services.mozilla.com/D158735
After the previous change, the treecolpicker element only wraps a button
and a menu, which are siblings rather than parent/child. I think that's
probably fine but it changes the shape of the a11y tree.
This patch updates the relevant tests, but let me know if you'd rather
keep the behavior. I could do that by either keeping the treecolpicker
entry listed in XULMap (I think), or via other means.
Suggestions welcome if you think this is not the right fix.
Differential Revision: https://phabricator.services.mozilla.com/D158640
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.
Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D158438
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.
Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D158438
mSafeToRecurse was initialized to true in one constructor, but not the other.
Fix this using default member initialization.
Differential Revision: https://phabricator.services.mozilla.com/D158550
This helps on several fronts:
1. Avoids a cache push on accessibles that have yet to be sent to
parent when relying on BindToParent instead.
2. Handles the case of table children removals.
3. Uses the mutation event collation for cache push collation.
No test case for MathML here because it is windows only, but I think
we should add coverage for it too.
Differential Revision: https://phabricator.services.mozilla.com/D158528
This doesn't update usage elsewhere in the code base, but it should be enough to ensure that this doesn't break anything.
We can gradually update other cases in future.
Differential Revision: https://phabricator.services.mozilla.com/D157082
For IPC, we use id 0 to refer to the document.
However, LocalAccessible::UniqueID doesn't return 0 for documents.
This meant that when sending IPC messages, we hitherto had to special case the document in each case.
We don't want to mess with LocalAccessible::UniqueID, but since Accessible::ID was only introduced recently, we can set new expectations there.
Thus, this patch changes LocalAccessible::ID to return 0 for documents.
This means that in future, we can just use Accessible::ID when sending IPC messages.
nsAccUtils::GetAccessibleByID has also been updated to handle this.
Differential Revision: https://phabricator.services.mozilla.com/D157081
If the process is asked to shut down while we're in the middle of handling long-running tasks, we should return early to avoid pointless work and allow the process to shut down sooner.
This patch adds ExpectingShutdown checks near various things which could potentially take a while; e.g. building the local tree, serializing the IPC tree, building the IPC cache, etc.
Differential Revision: https://phabricator.services.mozilla.com/D156809
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.
As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).
For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.
For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.
Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.
Differential Revision: https://phabricator.services.mozilla.com/D157875
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.
As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).
For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.
For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.
Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.
Differential Revision: https://phabricator.services.mozilla.com/D157875
This revision slightly reworks the way that we calculate accessible bounds in
RemoteAccessibleBase::BoundsWithOffset. Rather than looking "below" the current
accessible for a doc accessible to determine whether we should apply a cached
cross-process offset, we instead look "above" the current accessible, to its
parent, to check for a cross-process offset to apply. Then, in ApplyTransform,
we ensure that we maintain that cross-process offset.
Differential Revision: https://phabricator.services.mozilla.com/D157240
I don't understand why we don't allow any box through, but for now this
is a safer change to restore the previous behavior when emulated flex
box is used.
Differential Revision: https://phabricator.services.mozilla.com/D158002
They and their callees work with the result of `GetRoot()` which is the document
element or the body element. If the body is not editable, `Selection` should
not be updated in non-editable region nor `<br>` elements should not be
inserted in both non-focused editable elements and non-editable elements.
Therefore, they should run only when the document element or the `<body>`
element is editable.
To keep testing crashtests as reported, this patch makes tests which have
`contenteditable` except `<html>` and `<body>` initialize `Selection` as
what we've done. And clean up the tests for helping to port them to WPT
in the future (bug 1725850).
Differential Revision: https://phabricator.services.mozilla.com/D157408
Previously, we were not firing active state change events for the options in
<select> elements when the drop-down was expanded. This leads to possibly-stale
cached 'active' state in the parent process, which can cause Firefox to report
incorrect combo box values based on stale state. Rather than fire more 'active'
state change events to fix the problem, this revision addresses the problem by
not firing 'active' state change events for combo boxes at all, and instead
relying on the selection state when determining the combo box value in the
parent process. This revision also adds a test to verify that the behavior is
as expected.
Differential Revision: https://phabricator.services.mozilla.com/D156627
For methods supported by the cache, we already delegate to RemoteAccessibleBase where the caching implementation lives.
However, there are still some less used methods which aren't supported by the cache yet.
These methods are never called by the code which Windows a11y clients interact with (MsaaAccessible and friends).
However, they can be called from XPCOM; e.g. when using the Browser Console.
For now, just early return in these cases so we don't crash.
Eventually, we'll need to unify these methods and support them with the cache enabled.
Differential Revision: https://phabricator.services.mozilla.com/D156771
We expect acc to be a local OuterDocAccessible.
However, the OuterDocAccessible might die before the top level DocAccessibleParent, in which case acc will be null.
In this case, the DocAccessibleParent is about to die anyway, so it doesn't matter that the bounds we return are slightly wrong (since they can't take the OuterDoc into account).
Differential Revision: https://phabricator.services.mozilla.com/D156773
This variable was supposed to be removed long ago in bug 813019, but the
declaration was left behind by accident, it seems.
Differential Revision: https://phabricator.services.mozilla.com/D156879
JAWS won't expose MathML without this.
We can't fully support it; we don't cache info about namespaces, for example.
However, this implementation is enough to get MathML working with JAWS.
Differential Revision: https://phabricator.services.mozilla.com/D156150