By spec, it would need to be an area for aria-multiline=true and a field for aria-multiline=false. Chrome seems to assign all aria text boxes to areas. For some reason this allows VO to recognize links when editing. Webkit doesn't need this, for some reason and can get links announces in AXTextField as well.
Depends on D99312
Differential Revision: https://phabricator.services.mozilla.com/D99313
This is consistent with how WebKit does it: if offset is between two accessibles,
return the previous one.
Depends on D99311
Differential Revision: https://phabricator.services.mozilla.com/D99312
For focusable ancestor, just use editable ancestor since the IPC toll
on finding closest focusable ancestor isn't worth it.
Differential Revision: https://phabricator.services.mozilla.com/D99311
This is done via an ifdef in the ARIAMap. Provisions, however, are there to simply remove the ifdef and if clauses from here and the test file to enable this on other platforms once alert double-speaking and other unwanted side effects are fixed on said platforms.
Differential Revision: https://phabricator.services.mozilla.com/D97584
XUL documents have a bunch of non-hypetext accessibles in their heirarchy. So you can't assume that a hyperlink's parent is a hypertext. To get around that, when we construct ranges for elements they should be internal ranges when possible.
Differential Revision: https://phabricator.services.mozilla.com/D98394
The normalize function was putting the current container/offset past the end boundary. This caused overruns with getting the text for the range of the input object, and some unexpected invalid ranges.
Differential Revision: https://phabricator.services.mozilla.com/D98236
It seems that VO mistakenly thinks the web area is a descendant of itself. This causes all kinds of cyclical parent child relationships that makes VO over-query us.
This patch remedies that by not returning the web area when do an immediate child search starting from the root group - in any direction.
Differential Revision: https://phabricator.services.mozilla.com/D97819
Safari has an inconsistent way to deal with list bullets in text.
If a given range has a list or list item nested inside it - but it is not
at the beginning, the bullet will not be returned as part of the text.But if the range begins at the start
of a list item, the preceding bullet is included. For example, given the following list:
* First Item
* Second Item
If the range is [irst Item], the text for that range should return as "irst Item",
but if the range is [First it], the returned text is "* First it".
This patch emulates that inconsistency by removing the list item considerations
in the text segments iterator, and instead prepending a bullet if needed.
Differential Revision: https://phabricator.services.mozilla.com/D97717
This allows `contenteditable` textboxes to work correctly with flattened text values.
The attribute setters, aside from AXValue, don't work in Chrome or Safari with aria textboxes,
so those are not a high priority. These include:
- AXSelectedText
- AXSelectedTextRange
- AXVisibleCharacterRange
In addition, AXVisibleCharacterRange's getter doesn't function as expected in Chrome or Safari either, so I didn't touch it.
Differential Revision: https://phabricator.services.mozilla.com/D97629
This also irons out some event syncing issues. We need to wait for selection changes in the future patch in order to take advantage of selection caching.
Differential Revision: https://phabricator.services.mozilla.com/D97628
UPDATED
-------
accessible/tests/mochitest/elm/test_HTMLSpec.html
Bug 905215
Test that a11y shadow DOM gets objects of the right type and state from HTML dom.
Changed <object> and <embed> plugin tests to find no accessible.
accessible/tests/mochitest/elm/test_MathMLSpec.html
Bug 1001634
Basic MathML a11y tests. Didn't use plugin, just initializes it.
Remove plugin initialization.
accessible/tests/mochitest/elm/test_plugin.html
Test that a11y shadow tree gets proper type/state for plugin objects and their subtrees, even if there is an HTML fallback provided.
Removed.
accessible/tests/mochitest/focus/test_takeFocus.html
Bug 677467
Test that a11y shadow tree focus follows DOM focus
Remove plugin init but keep plugin test.
Differential Revision: https://phabricator.services.mozilla.com/D95905
UPDATED
-------
accessible/tests/mochitest/elm/test_HTMLSpec.html
Bug 905215
Test that a11y shadow DOM gets objects of the right type and state from HTML dom.
Changed <object> and <embed> plugin tests to find no accessible.
accessible/tests/mochitest/elm/test_MathMLSpec.html
Bug 1001634
Basic MathML a11y tests. Didn't use plugin, just initializes it.
Remove plugin initialization.
accessible/tests/mochitest/elm/test_plugin.html
Test that a11y shadow tree gets proper type/state for plugin objects and their subtrees, even if there is an HTML fallback provided.
Removed.
accessible/tests/mochitest/focus/test_takeFocus.html
Bug 677467
Test that a11y shadow tree focus follows DOM focus
Remove plugin init but keep plugin test.
Differential Revision: https://phabricator.services.mozilla.com/D95905
VoiceOver seems to do all the heavy lifting of figuring out what portion of the
live region should be read.
Depends on D96293
Differential Revision: https://phabricator.services.mozilla.com/D96294
I think VoiceOver uses this to pull in all live regions so it
can check for deletions when they change later on.
Depends on D96292
Differential Revision: https://phabricator.services.mozilla.com/D96293
We use an ivar boolean flag to cache the existance of a live region. This lets us
hide the live region AX attributes and avoid sync round trips to content.
Depends on D96291
Differential Revision: https://phabricator.services.mozilla.com/D96292
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
VoiceOver seems to do all the heavy lifting of figuring out what portion of the
live region should be read.
Depends on D96293
Differential Revision: https://phabricator.services.mozilla.com/D96294
I think VoiceOver uses this to pull in all live regions so it
can check for deletions when they change later on.
Depends on D96292
Differential Revision: https://phabricator.services.mozilla.com/D96293
We use an ivar boolean flag to cache the existance of a live region. This lets us
hide the live region AX attributes and avoid sync round trips to content.
Depends on D96291
Differential Revision: https://phabricator.services.mozilla.com/D96292
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
We use an ivar boolean flag to cache the existance of a live region. This lets us
hide the live region AX attributes and avoid sync round trips to content.
Differential Revision: https://phabricator.services.mozilla.com/D96292
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
Safari maps role=tooltip to AXGroup/AXUserInterfaceTooltip.
I suspect AXHelpTag is meant for native tooltips.
This fixes an issue when VO encounters a tooltip in read-all it jumps out of the web content.
Differential Revision: https://phabricator.services.mozilla.com/D96626
We use an ivar boolean flag to cache the existance of a live region. This lets us
hide the live region AX attributes and avoid sync round trips to content.
Differential Revision: https://phabricator.services.mozilla.com/D96292
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
Both chrome and safari preserve the AXWebArea with no subroles, and apply the application subrole to the root group. Not doing so apparently breaks web applications badly.
Differential Revision: https://phabricator.services.mozilla.com/D96475
Both chrome and safari preserve the AXWebArea with no subroles, and apply the application subrole to the root group. Not doing so apparently breaks web applications badly.
Differential Revision: https://phabricator.services.mozilla.com/D96475
The SELECTABLE_TEXT state is currently under-utilized and probably wrong, since it simply relies on testing if a hypertext has any text. A more correct reflection of the state should be taken from layout's IsSelectable method.
Note, even if an element is styled `user-select: none`, the text will still be keyboard selectable if it is editable (eg. input or contenteditable), so we should consider that SELECTABLE_TEXT.
Differential Revision: https://phabricator.services.mozilla.com/D95783
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
The SELECTABLE_TEXT state is currently under-utilized and probably wrong, since it simply relies on testing if a hypertext has any text. A more correct reflection of the state should be taken from layout's IsSelectable method.
Note, even if an element is styled `user-select: none`, the text will still be keyboard selectable if it is editable (eg. input or contenteditable), so we should consider that SELECTABLE_TEXT.
Differential Revision: https://phabricator.services.mozilla.com/D95783
The browser test is really a crash test, but it's really difficult to test a11y APIs properly using the crashtest framework.
Differential Revision: https://phabricator.services.mozilla.com/D95107
If an HTML table's children (tr/thead/tfoot) are anything but row or row
group frames, our layout-based HTMLTableAccessible implementation won't work.
Differential Revision: https://phabricator.services.mozilla.com/D94888
If an inline-block element contains nested elements that may contain line breaks, or whitespace that comes from how the HTML file is formatted, both start and end offsets returned from layout may be incorrect. Adjust for the following cases:
* The start offset goes too far back from the passed-in offset, overshooting a line boundary.
* The end offset returned is smaller than the passed-in offset, even though we want the start of the next line. Even on the last line, this should never happen.
Differential Revision: https://phabricator.services.mozilla.com/D94744
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
If the offset for an embedded character is queried, and it is an inline element, such as a link, and it contains a line break, return the full parent line.
Likewise, if querying character offsets before that embedded character, include its line break in the end offset.
Differential Revision: https://phabricator.services.mozilla.com/D94024
AXTopLevelUIElement is not really testable because it doesn't give a useful result in
headless mode. Since it is a clone of AXWindow, this shouldn't be much of an issue.
Differential Revision: https://phabricator.services.mozilla.com/D94154
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
In pre-formatted text (including textareas), text leaf nodes can contain line break characters ("\n").
Therefore, when searching for a paragraph boundary, we must match these.
Pivot can't return an ofset, only an Accessible, so we store the offset for the last match on the rule.
Because our origin point might be within a text leaf which contains a line break before/after it, we must also pass in the offset in our origin in this case so we can begin the text search from the right place.
Differential Revision: https://phabricator.services.mozilla.com/D93719
<object> and <embed> elements can handle a number of media-like resources, like images, videos, audio, PDFs. This patch adds tests for all but video. See bug 1670803 for video tests.
Differential Revision: https://phabricator.services.mozilla.com/D93273
Besides the ARIA role invalidation, this fixes an issue where the mozAccessible's role is also incorrect when the aria role changes on a body tag.
Depends on D93439
Differential Revision: https://phabricator.services.mozilla.com/D93440
1. Text nodes can be created in the DOM just because there was white space in the source, but this isn't always visible.
We shouldn't create an Accessible in the invisible case.
However, there could be an inline frame after/before an invisible text node, so we still need to check for that.
2. We should create div Accessibles if there are inline-block children such as buttons.
Previously, we weren't doing this because these aren't caught by IsInlineFrame.
We now use IsInlineOutside, which also catches text and br.
Aside from being a bug, this fix was needed in this patch to fix tests which previously created div Accessibles because of invisible text nodes, but lost the Accessibles once this was fixed.
3. Similarly, we should create div Accessibles if there is a previous text sibling.
Again, IsInlineFrame wasn't catching these, but IsInlineOutside does.
4. Adjust various tests to fix assumptions based on the previous behaviour.
Some needed role="none" to force flattening, while some needed an id to force creation.
Differential Revision: https://phabricator.services.mozilla.com/D92170
This uses the Pivot class to search backwards and forwards from the current offsets until either end is reached, or an accessible that is either a line break or has a block frame, is found, and therefore constitutes a boundary of interest.
Differential Revision: https://phabricator.services.mozilla.com/D91407
In many cases with wpt, most of the tests in the file pass, but it is rather time consuming to annotate
.ini files case by case.
Differential Revision: https://phabricator.services.mozilla.com/D91977
This uses the Pivot class to search backwards and forwards from the current offsets until either end is reached, or an accessible that is either a line break or has a block frame, is found, and therefore constitutes a boundary of interest.
Differential Revision: https://phabricator.services.mozilla.com/D91407
Instead of having the web area be the implicit root, the search results should
exclusively be descendants of the target element that the search is called on.
Differential Revision: https://phabricator.services.mozilla.com/D91826
The left and right line getters don't seem to be used often by voiceover,
so I am not sure if they always return the expected result.
Differential Revision: https://phabricator.services.mozilla.com/D90938
There are going to be a whole bunch of things we want to check for each
text marker in a document. I think loops should be avoided as much as possible,
but this lets us store a single array with everything we expect for each marker.
This is going to expand in the future.
Differential Revision: https://phabricator.services.mozilla.com/D90937
If in a textarea, a blank line is inserted, we need to return the offsets of just that new inner paragraph, or the braille display of a screen reader will show the previous line and not a blank one.
Differential Revision: https://phabricator.services.mozilla.com/D90655
1. Make sure the paragraph text and start and end ofsets returned for offsets on either the text or its adjacent br always match.
2. For a single line break at the beginning of the enclosing paragraph, or two consecutive line breaks, treat the second one as its own paragraph without text, and its start offset corresponding to its offset, and end offset being 1 greater.
3. Add a test case exercising all cases.
Differential Revision: https://phabricator.services.mozilla.com/D90355
Tagging onto what we already do for getting line offsets, also doing the same when the paragraph selection is requested.
Differential Revision: https://phabricator.services.mozilla.com/D90238
When a doc does not have top-level DOM group, or consists of a single leaf,
we need to insert a generated root group. The rotor API expects this and uses
it for boundary detection.
Differential Revision: https://phabricator.services.mozilla.com/D90174
1. Make sure the paragraph text and start and end ofsets returned for offsets on either the text or its adjacent br always match.
2. For two consecutive line breaks, treat the second one as its own paragraph without text, and its start offset corresponding to its offset, and end offset being 1 greater.
3. Add a test case exercising all cases.
Differential Revision: https://phabricator.services.mozilla.com/D90355
Tagging onto what we already do for getting line offsets, also doing the same when the paragraph selection is requested.
Differential Revision: https://phabricator.services.mozilla.com/D90238
When a doc does not have top-level DOM group, or consists of a single leaf,
we need to insert a generated root group. The rotor API expects this and uses
it for boundary detection.
Differential Revision: https://phabricator.services.mozilla.com/D90174
Currently used mostly by Twitter and Facebook to allow them to specify which virtual quick navigation keys assistive technologies should not use when in those web applications, but instead pass them through to the browser. JAWS is currently the only known assistive technology making use of this feature.
This works in Chrome and the new Edge, but not in Firefox, because JAWS stopped using ISimpleDOM in Firefox, which no longer gave them access to this attribute.
This bug is to allow exposure of the non-standardized data-at-shortcutkeys attribute value via a same-named IAccessible2 and ATK Object Attribute.
Differential Revision: https://phabricator.services.mozilla.com/D86181
It seems that VoiceOver expects AXDescriptionList and AXDescription
as subroles in order to report the correct number of items in a dl.
Differential Revision: https://phabricator.services.mozilla.com/D88890
We need to navigate past bullets when moving markers by character or word,
but we need to still include bullets when retrieving the string of a given
marker range.
Differential Revision: https://phabricator.services.mozilla.com/D87813
The fact that this control is a slider is communicated through its role.
Having the word "slider" in the label is thus redundant and results in unnecessary verbosity for screen reader users.
Differential Revision: https://phabricator.services.mozilla.com/D87401
1. Label it.
2. Expose the position and duration as its value text.
The raw numeric value exposed previously wasn't meaningful to users.
3. Hide the progressBar for a11y.
While the scrubber and progressBar are visually combined, they are exposed as entirely separate controls for a11y.
As well as duplicating information, progress bars are automatically reported by screen readers even if they aren't focused, which intrudes on the audio being played.
4. Remove tabindex="-1" on the progressBar.
A progress element isn't focusable by default.
tabindex="-1" makes it programmatically focusable (but not tabbable).
This isn't interactive, so there's no reason for this to be programmatically focusable.
Moreover, this is now aria-hidden and aria-hidden elements should never be focusable.
Differential Revision: https://phabricator.services.mozilla.com/D87400
There's two issues being fixed here - the first is that no-unused-vars now reports against the last instance of the unused variable. The second is no-dupe-else-if is now on by default.
Depends on D84816
Differential Revision: https://phabricator.services.mozilla.com/D84818
This patch adds several new parameters:
* AXLeftWordTextMarkerRangeForTextMarker
* AXRightWordTextMarkerRangeForTextMarker
* AXStartTextMarkerForTextMarkerRange
* AXEndTextMarkerForTextMarkerRange
* AXNextTextMarkerForTextMarker
* AXPreviousTextMarkerForTextMarker
Our word boundaries API is pretty buggy. Instead of trying to
resolve or triage each issue I found, I added todo tests
for them.
Differential Revision: https://phabricator.services.mozilla.com/D83680
This causes the browser to steal focus from any element that was focused prior
to the completion of the remoteness flip. This is particularly a problem for
fission because every cross-origin navigation requires a process switch.
This code is still necessary for "normal" session restores (see bug 1410591),
but focus is handled elsewhere for remote navigations.
Differential Revision: https://phabricator.services.mozilla.com/D82783
It seems the window location isn't the issue here at all.
Rather, we never get the expected a11y events.
So, let's try to find out what events we *do* get.
Differential Revision: https://phabricator.services.mozilla.com/D81478
Previously, this returned a value if the ARIA value rule was not eNoValue, which covered eHasValueMinMaxIfFocusable.
However, eHasValueMinMaxIfFocusable needs the focusable state to be checked.
Rather than checking the value rule directly, just use HasNumericValue(), which already knows how to handle this.
Differential Revision: https://phabricator.services.mozilla.com/D81483
This includes 3 changes:
1. Add a lazy ranges getter to AccTextSelChangeEvent.
2. Create an XPCOM interface for testing purposes.
3. Add IPDL bindings for passing ranges in e10s.
Differential Revision: https://phabricator.services.mozilla.com/D80556
This is the actual fix.
Previously, we opened a download prompt, but we didn't close it.
This download prompt could sometimes get focus and prevent subsequent tests from getting focus.
Explicitly closing it should prevent this from happening.
Differential Revision: https://phabricator.services.mozilla.com/D80590
It's just too difficult/confusing to mix a11y and non-a11y async stuff using eventQueue.
This patch should be functionally equivalent; it doesn't fix the bug.
Differential Revision: https://phabricator.services.mozilla.com/D80589
Using overlay scrollbars will avoid the need to account for the trimmed
space that is introduced after an overflowing zoom caused by scrollbars.
Differential Revision: https://phabricator.services.mozilla.com/D80102
This patch exposes the dialog element as a HyperTextAccessible with role DIALOG and enables the test after flipping the pref temporarily. Once the pref is on by default, the if block should be removed and the test run always.
Differential Revision: https://phabricator.services.mozilla.com/D79798