The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements
Differential Revision: https://phabricator.services.mozilla.com/D215688
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements
Differential Revision: https://phabricator.services.mozilla.com/D215688
This revision implements UIA's TextUnit_Format, a TextUnit used to position the
boundary of a text range based on the formatting attributes of the text. This
revision modifies FindTextAttrsStart such that it does not stop at container
boundaries, and will traverse to the next or previous leaf if necessary. With
this change, FindTextAttrsStart matches FindBoundary in that it returns the true
"start" of the text run. This revision then adds a call to FindTextAttrsStart in
UIA code, and many tests exercising TextUnit_Format.
Differential Revision: https://phabricator.services.mozilla.com/D226853
This is vestigial dead code from before CtW when HyperTextAccessible used TextAttrsMgr to calculate offsets for text attribute runs.
Now, offset calculation is handled by TextLeafPoint::FindTextAttrsStart and HyperTextAccessibleBase::TextAttributes.
Aside from removing code directly related to offsets, this also involved removal of TextAttr::Equal and TextAttr::GetValueFor.
These were only used for offset calculation.
Even if we wanted something similar in future, these can't be made compatible with RemoteAccessible in their current form.
Differential Revision: https://phabricator.services.mozilla.com/D227312
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.
Differential Revision: https://phabricator.services.mozilla.com/D223341
The target might be an element for which we don't create an Accessible; e.g. a <b> element.
Previously, we wouldn't fire an event in NotifyOfAnchorJumpTo and would instead defer the event until the next document focus.
However, the document might already have focus, in which case we won't fire this event when the user expects it (if ever).
Instead, use GetAccessibleOrContainer, which is also consistent with the deferred anchor jump code in FocusManager.
This means we will fire the event on the correct container Accessible immediately.
Differential Revision: https://phabricator.services.mozilla.com/D226437
The target might be an element for which we don't create an Accessible; e.g. a <b> element.
Previously, we wouldn't fire an event in NotifyOfAnchorJumpTo and would instead defer the event until the next document focus.
However, the document might already have focus, in which case we won't fire this event when the user expects it (if ever).
Instead, use GetAccessibleOrContainer, which is also consistent with the deferred anchor jump code in FocusManager.
This means we will fire the event on the correct container Accessible immediately.
Differential Revision: https://phabricator.services.mozilla.com/D226437
Since the method is deferred we need to do extra guesswork for possible
situtations where the name has changed because we don't have the
privilege to calculate the name in-line when content is deleted.
I tried to account for all cases as we have in our test coverage. I
hope that if there are edge cases they are false positives, and we are
firing extra name changes and not the opposite.
Differential Revision: https://phabricator.services.mozilla.com/D223877
This revision adds an operator<< that writes a text representation of an
AccAttributes object to an ostream object. This makes it possible to call
ToString on an AccAttributes object, which is useful for printing AccAttributes
objects embedded in AccAttributes objects, and relevant to how Gecko stores
ARIA and text attributes. This revision rewrites DebugPrint in terms of ToString
and uses ToString in StringFromNameAndValue to print AccAttributes in AccAttributes.
Differential Revision: https://phabricator.services.mozilla.com/D224558
Since the method is deferred we need to do extra guesswork for possible
situtations where the name has changed because we don't have the
privilege to calculate the name in-line when content is deleted.
I tried to account for all cases as we have in our test coverage. I
hope that if there are edge cases they are false positives, and we are
firing extra name changes and not the opposite.
Differential Revision: https://phabricator.services.mozilla.com/D223877
Introduce a gecko live region changed event and fire it from within content.
This way it gets coalesced in the case of many insertions/deletions.
Also, rely on text insert/delete instead of reorder because there can be cases
where the text in a leaf changes as opposed to a tree mutation.
We get text insert/delete on mutations too, so that should cover it.
Differential Revision: https://phabricator.services.mozilla.com/D224388
This revision adds a pref, read only on startup, that enables all cache domains.
By default, cache domains are only enabled as-needed. This pref is uesful for
test environments, such as fuzzing.
Differential Revision: https://phabricator.services.mozilla.com/D224187
This revision adds an operator<< that writes a text representation of an
AccAttributes object to an ostream object. This makes it possible to call
ToString on an AccAttributes object, which is useful for printing AccAttributes
objects embedded in AccAttributes objects, and relevant to how Gecko stores
ARIA and text attributes. This revision rewrites DebugPrint in terms of ToString
and uses ToString in StringFromNameAndValue to print AccAttributes in AccAttributes.
Differential Revision: https://phabricator.services.mozilla.com/D224558
Introduce a gecko live region changed event and fire it from within content.
This way it gets coalesced in the case of many insertions/deletions.
Also, rely on text insert/delete instead of reorder because there can be cases
where the text in a leaf changes as opposed to a tree mutation.
We get text insert/delete on mutations too, so that should cover it.
Differential Revision: https://phabricator.services.mozilla.com/D224388
This revision implements GetBoundingRectangles by walking the text range line by
line, adding each line rect to an output array, then returning that array to UIA
clients. Since this logic was tied up in TextLeafRange::Bounds, this revision
first creates function WalkLineRects which encapsulates the logic of walking
a TextLeafRange line-by-line. Then, it uses that function to rewrite Bounds and
implement new function LineRects, which stores all non-empty onscreen line rects
in an nsTArray and returns them. The implementation of GetBoundingRectangles has
been filled out; it's mostly straightforward but contains some SAFEARRAY work
since UIA expects rects as doubles, rather than our internal uint32_t
representation. Finally, this revision adds a test for GetBoundingRectangles.
Differential Revision: https://phabricator.services.mozilla.com/D222198
This revision implements RangeFromPoint by hittesting the screen location with
ChildAtPoint. Though the UIA documentation suggests that it may be correct to
find the closest text leaf to the screen coordinate, this revision restricts the
search to nodes under the screen coordinate directly. To accomplish this, it
creates two new functions: TextLeafPointAtScreenPoint, which manages the logic for
hit testing within a TextLeafRange, and FromAccessible, which creates a
TextLeafRange spanning the entire text leaf. Finally, this revision adds Windows
platform tests for the new functionality.
Differential Revision: https://phabricator.services.mozilla.com/D221902
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements
Differential Revision: https://phabricator.services.mozilla.com/D215688
This revision adds code everywhere necessary to request cache domains. These
requests are a response to assistive technology queries. The revision also adds
asserts and other safety mechanisms to ensure that we have the right information
before responding. If an AT requests something that Gecko doesn't have an answer
for, we return a default value and hope they'll ask again once we have the info.
Differential Revision: https://phabricator.services.mozilla.com/D220039
This revision adds code that will make it simple to request new cache domains as
as response to assistive technology queries.
Differential Revision: https://phabricator.services.mozilla.com/D220038
This revision adds the capability of querying and sending information about
individual cache domains. It introduces the concept of active cache domains to
the accessibility service: cache domains that we think clients need. Conversely,
cache domains that clients don't need are inactive, and we avoid doing any work
to push information about those domains. This revision adds an IPC mechanism for
setting cache domains. It adds a way for content process documents to enable,
gather, and send to the parent process information from all of their accessibles
that's newly needed. It adds a way to instantiate new accessibility services
with a predetermined set of cache domains. It adds a mechanism for local accs to
use in BundleFieldsForCache, but doesn't implement it yet (see next revision).
Differential Revision: https://phabricator.services.mozilla.com/D220036
This revision is a step towards ensuring we get the right domains for known
accessibility instantiators. We want to anticipate the needs of known clients
and make sure we have all the cache domains ready, especially for heavy-use
clients like screen readers. The domains we'll need are a bit of a work in
progress, but can be updated easily. For now, err on the side of caution. This
revision also implements better client detection on macOS, so we can handle
multiple clients.
Differential Revision: https://phabricator.services.mozilla.com/D220035
This causes problems when the aria-owns is invalid, for example in a
cyclical link. The reason this was put in in the first place is not
documented or apparent, but maybe a way to reduce churn.
This also fixes an existing test and makes the lineage of a cyclical
aria-owns elements match what chrome does.
(t3_1, t3_2, heading, t3_3).
Differential Revision: https://phabricator.services.mozilla.com/D221276
For example, one of the frames could be in the block's main in-flow line list and the other could be in an overflow list.
When this happens, it's not valid to compare LineIterators, so we must compare the line lists first.
Differential Revision: https://phabricator.services.mozilla.com/D218613
This is now simply a matter of leveraging the work in the previous patches to support the new selection type and map it to the correct attribute.
There isn't an IAccessible2 or ATK attribute for this yet.
We use mark:true, based on <mark> and role="mark" which is used for a semantic highlight.
I've discussed this with Google, NV Access and Vispero and they all seem to be happy with this.
Differential Revision: https://phabricator.services.mozilla.com/D217071
nsISelectionListener isn't sufficient because it only notifies that the selection has changed.
A11y needs to know specifically which ranges were added or removed.
Previously, we handled this specifically for spelling errors in mozInlineSpellChecker.
That code has been removed and replaced with a more general approach.
Since we now have these notifications, rather than using nsISelectionListener just to fire events, we now use these notifications for that as well.
This avoids the need to add additional nsISelectionListeners, which would get messy particularly for custom highlights where there can be an arbitrary number of selections at any given time.
Differential Revision: https://phabricator.services.mozilla.com/D217068