Commit Graph

1797 Commits

Author SHA1 Message Date
Morgan Rae Reschenberg
624b0c885c Bug 1899658: Cache visual viewport offset and consider it in bounds calculation. r=nlapre,botond,Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228266
2024-11-23 08:55:19 +00:00
Norisz Fay
89bd3a4b86 Backed out changeset 17c06ee2f513 (bug 1899658) for causing bustages on RootAccessible.cpp CLOSED TREE 2024-11-23 06:58:50 +02:00
Morgan Rae Reschenberg
abad32541c Bug 1899658: Cache visual viewport offset and consider it in bounds calculation. r=nlapre,botond,Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228266
2024-11-23 02:03:11 +00:00
Alexandru Marc
dfc0c9e301 Backed out 4 changesets (bug 1769586) for causing wpt failures @ property-reflection.html. CLOSED TREE
Backed out changeset dc6aa76ec6c5 (bug 1769586)
Backed out changeset d9ff02e6c435 (bug 1769586)
Backed out changeset 446faf4cccab (bug 1769586)
Backed out changeset 49f68df69db0 (bug 1769586)
2024-11-21 10:50:49 +02:00
Peter Van der Beken
f810b391ac Bug 1769586 - Small build bustage fix: replace ArrayLength with std::size. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D229484
2024-11-21 04:39:14 +00:00
Eitan Isaacson
70ccf14203 Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
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
2024-11-21 04:39:14 +00:00
Eitan Isaacson
05adcbf27e Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-21 04:39:13 +00:00
Alexandru Marc
791097f054 Backed out 4 changesets (bug 1769586) for causing multiple failures.
Backed out changeset 1125ec697fdd (bug 1769586)
Backed out changeset ced88b84eef3 (bug 1769586)
Backed out changeset 486c9854c11d (bug 1769586)
Backed out changeset f543f54d90a0 (bug 1769586)
2024-11-19 19:10:30 +02:00
Peter Van der Beken
f6fad04782 Bug 1769586 - Small build bustage fix: replace ArrayLength with std::size. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D229484
2024-11-19 15:02:18 +00:00
Eitan Isaacson
f6e98e9b91 Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
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
2024-11-19 15:02:18 +00:00
Eitan Isaacson
79884b85d1 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-19 15:02:18 +00:00
Nathan LaPre
93b93018cd Bug 1927001: Implement UIA's TextUnit_Format, r=Jamie
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
2024-10-31 22:46:12 +00:00
James Teh
c7b4ee99fb Bug 1927979: Remove offset calculation from a11y TextAttrsMgr. r=nlapre
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
2024-10-30 23:37:27 +00:00
Eitan Isaacson
2f852e6279 Bug 1907247 - Update non-doc body element bounds when they change. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D226971
2024-10-30 19:43:50 +00:00
serge-sans-paille
8a0a0f7524 Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
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
2024-10-30 11:05:24 +00:00
James Teh
ff7475fdea Bug 1926198: Use GetAccessibleOrContainer in nsAccessibilityService::NotifyOfAnchorJumpTo. r=morgan
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
2024-10-29 01:54:00 +00:00
serge-sans-paille
e54774d573 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Adi
015c2e805d Backed out 2 changesets (bug 1926214, bug 1926198) for causing ba failures. CLOSED TREE
Backed out changeset ada40589ff0c (bug 1926214)
Backed out changeset fbb2bce6d562 (bug 1926198)
2024-10-28 09:34:01 +02:00
James Teh
103194150c Bug 1926198: Use GetAccessibleOrContainer in nsAccessibilityService::NotifyOfAnchorJumpTo. r=morgan
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
2024-10-28 06:42:30 +00:00
Alexandru Marc
191ccbe7fe Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
53068cdf31 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Emilio Cobos Álvarez
227e943b78 Bug 1926031 - Make Selection::ScrollIntoView take ScrollFlags. r=jjaschke,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D226389
2024-10-22 09:58:02 +00:00
Ryan VanderMeulen
f6e7f621c2 Backed out 3 changesets (bug 1769586) for causing Bug 1920082.
Backed out changeset d684010261d6 (bug 1769586)
Backed out changeset b3264bc533e2 (bug 1769586)
Backed out changeset 049fd286ce0f (bug 1769586)
2024-10-17 16:44:16 -04:00
Eitan Isaacson
4ea553fb6c Bug 1919087 - Defer PushNameOrDescriptionChange to WillRefresh tick. r=Jamie
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
2024-10-17 04:46:20 +00:00
Nathan LaPre
91c9ad7516 Bug 1922696: Opt AccAttributes into ToString via operator<<, r=eeejay
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
2024-10-16 01:07:59 +00:00
Stanca Serban
79c7562770 Backed out changeset cbbe203e630b (bug 1919087) for causing build bustages in EventQueue.cpp. CLOSED TREE 2024-10-16 00:51:51 +03:00
Eitan Isaacson
1c72aec179 Bug 1919087 - Defer PushNameOrDescriptionChange to WillRefresh tick. r=Jamie
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
2024-10-15 20:21:06 +00:00
Olli Pettay
7e528b126f Bug 1911736 - Enable dom.popup.experimental on Nightly, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D225518
2024-10-15 19:06:51 +00:00
Eitan Isaacson
949bd3acfe Bug 1915262 - Fire queued live region event from content in MacOS. r=morgan
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
2024-10-10 17:36:26 +00:00
Butkovits Atila
40d6013a5d Backed out changeset e05604fb874e (bug 1922696) for causing bustages at AccAttributes.cpp. CLOSED TREE 2024-10-10 00:07:25 +03:00
Nathan LaPre
28881b1a75 Bug 1921917: Create startup pref to enable all cache domains, r=eeejay
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
2024-10-09 19:27:32 +00:00
Nathan LaPre
fe6f936431 Bug 1922696: Opt AccAttributes into ToString via operator<<, r=eeejay
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
2024-10-09 19:25:40 +00:00
Cosmin Sabou
b2778dfb92 Backed out changeset 3cefab965a7c (bug 1915262) for causing accessible related assertion failures on macOS. 2024-10-09 10:43:37 +03:00
Eitan Isaacson
4d81a9a27a Bug 1915262 - Fire queued live region event from content in MacOS. r=morgan
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
2024-10-09 05:36:21 +00:00
Nathan LaPre
48bc589112 Bug 1901462: Implement UIA ITextRangeProvider::GetBoundingRectangles, r=Jamie
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
2024-09-17 21:38:26 +00:00
Nathan LaPre
82e1685960 Bug 1901463: Implement UIA ITextProvider::RangeFromPoint, r=Jamie
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
2024-09-17 21:38:26 +00:00
Eitan Isaacson
cd4a3691f1 Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
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
2024-09-15 22:39:53 +00:00
Eitan Isaacson
5a1e8aa269 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-09-15 22:39:53 +00:00
Nathan LaPre
9d832bd02b Bug 1794974: Part 5: Add code that requests new cache domains to remote accessibles, r=Jamie
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
2024-09-09 23:02:20 +00:00
Nathan LaPre
8cf50fce46 Bug 1794974: Part 4: Add ability to easily query, request new cache domains,r=Jamie
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
2024-09-09 23:02:20 +00:00
Nathan LaPre
08aae2056f Bug 1794974: Part 2: Add ability to query and send individual cache domains, r=Jamie
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
2024-09-09 23:02:19 +00:00
Nathan LaPre
b32ecd1bf9 Bug 1794974: Part 1: Add improved client detection, automatic domain setting, r=Jamie
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
2024-09-09 23:02:19 +00:00
Eitan Isaacson
0386e3e475 Bug 1696309 - Don't skip aria-owned children early in TreeWalker. r=Jamie
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
2024-09-08 04:04:17 +00:00
James Teh
0c667fd10a Bug 1910803: When checking if frames are on different lines in a11y, check if the frames are in different line lists before comparing their LineIterators. r=morgan
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
2024-08-07 22:51:58 +00:00
Otto Länd
d148733a9d Bug 1905211: apply code formatting via Lando
# ignore-this-changeset
2024-08-05 02:58:07 +00:00
James Teh
b453f2a8d5 Bug 1905211 part 10: Expose target text as an a11y text attribute. r=morgan
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
2024-08-05 02:54:38 +00:00
James Teh
38e692da86 Bug 1905211 part 7: Notify accessibility about ranges that are added or removed from selections. r=smaug,morgan
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
2024-08-05 02:54:37 +00:00
James Teh
f3241d83cf Bug 1905211 part 6: Adjust names and comments to reflect that this code can now be used for more than spelling errors. r=morgan
There should be no functional change here.

Differential Revision: https://phabricator.services.mozilla.com/D217067
2024-08-05 02:54:37 +00:00