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 should log attribute setting or action performing. We also probably should log AXRole, AXSubrole, AXSize and AXPosition in debug mode, just verbose.
Differential Revision: https://phabricator.services.mozilla.com/D96635
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
We should delayload DLLs that for APIs that are only used during registration
so that they aren't referenced during normal operation.
Differential Revision: https://phabricator.services.mozilla.com/D95609
We should delayload DLLs that for APIs that are only used during registration
so that they aren't referenced during normal operation.
Differential Revision: https://phabricator.services.mozilla.com/D95609
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
It seems like the GeckoTextMarker::Range can sometimes return invalid ranges.
We need to check if they are valid or not before marshalling them.
Differential Revision: https://phabricator.services.mozilla.com/D95230
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
There are at least 8 different methods for getting a range from an offset:
1. left word
2. right word
3. line
4. left line
5. right line
6. sentence
7. paragraph
8. range with same style.
Having a single wrapper and IPDL method for all of those with an enum would remove
a lot of redundancies.
Differential Revision: https://phabricator.services.mozilla.com/D90936
This check is a remnant of the first version of e10s a11y, where there was no sandbox and content processes could expose their own HWNDs.
We return early if IPCAccessibilityActive(), which is now always true when running in a content process, so this check will never be hit.
If it *were* hit, this would cause serious breakage now, so having this in the code only serves to confuse things at best.
Differential Revision: https://phabricator.services.mozilla.com/D91233
This patch is similar to part 4 but for Android a11y.
Conversions over to `NativeWeakPtr` are pretty straight forward thanks to the
type system. Basically we take a `NativeWeakPtr`, call `Access()` on it, and
if the accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D87365
Changes to nsIScrollableFrame.h cause the world to rebuild which I find annoying.
This removes the inclusion into Element.h which is responsible for the
world-rebuilding and is relatively easy to eliminate. A bunch of usages of
nsIScrollableFrame get moved from .h files into .cpp files and I include the
header into .cpp files as needed.
Differential Revision: https://phabricator.services.mozilla.com/D90735
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
For TextBeforeOffset and TextAfterOffset, bail out with an empty text and 0-initialized out integers if the boundary type is nsIAccessibleText::BOUNDARY_PARAGRAPH.
Differential Revision: https://phabricator.services.mozilla.com/D90115
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
For TextBeforeOffset and TextAfterOffset, bail out with an empty text and 0-initialized out integers if the boundary type is nsIAccessibleText::BOUNDARY_PARAGRAPH.
Differential Revision: https://phabricator.services.mozilla.com/D90115
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