Commit Graph

11323 Commits

Author SHA1 Message Date
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
Andrew McCreight
67817a936e Bug 1931877, part 2 - Replace 2 arg MOZ_DIAGNOSTIC_ASSERT(false) with MOZ_DIAGNOSTIC_CRASH. r=necko-reviewers,win-reviewers,glandium,rkraesig,valentin
Differential Revision: https://phabricator.services.mozilla.com/D229361
2024-11-20 16:37:50 +00:00
James Teh
816d5e833d Bug 1930322 part 4: Use LocalAccessible::RelativeBounds to calculate the coordinates in LocalAccessible::DispatchClickEvent. r=morgan
Previously, we used the primary frame.
This was problematic for image map areas because they don't have a frame, so we were always using the top left of the entire image.
RelativeBounds has been overridden for image map areas to correctly calculate coordinates.
Therefore, rather than special casing image map areas again, use RelativeBounds in DispatchClickEvent.

Differential Revision: https://phabricator.services.mozilla.com/D229300
2024-11-20 04:13:49 +00:00
James Teh
9f2225aa67 Bug 1930322 part 3: Fixes to browser_caching_actions.js test. r=morgan
As part of these tests, we need to wait for all specified DOM events to fire on a node.
We do this by setting up a Promise for each event, wrapping these in a single Promise which resolves when all events fire, storing this wrapping Promise on the Window object, and later (in a separate task) waiting on this wrapping Promise.
Previously, after any event fired, we set the Window object variable holding the wrapping Promise to null in order to clean it up.
This resulted in a race condition where if the first event fired before the second task ran to wait on the wrapping Promise, the second task would simply await null, meaning that it didn't wait at all.
The practical upshot is that we could potentially pass the tests even if the required DOM events never fired and remain blissfully unaware.
To fix this, we instead clear the wrapping Promise variable in the second task after waiting on it.
Without this fix, the test I add in the next patch would pass even without the bug being fixed.
In addition, to make debugging timeouts easier, we now log the id of the element being tested.

Differential Revision: https://phabricator.services.mozilla.com/D229299
2024-11-20 04:13:49 +00:00
James Teh
3ba01f4aa1 Bug 1930322 part 2: cleanup: Use NS_NewRunnableFunction instead of an inline Runnable subclass. r=morgan
This just improves readability.
There should be no functional change except that I gave this Runnable a proper name while I was at it.

Differential Revision: https://phabricator.services.mozilla.com/D229298
2024-11-20 04:13:48 +00:00
James Teh
75767f504f Bug 1930322 part 1: cleanup: Remove aContent argument to LocalAccessible::DoCommand/DispatchClickEvent. r=morgan
We never set this argument to anything other than the default, which meant it always used the LocalAccessible's mContent.
This makes the argument unnecessary and potentially confusing in an area which is already a bit difficult to follow, so just remove it.
There should be no functional change.

Differential Revision: https://phabricator.services.mozilla.com/D229297
2024-11-20 04:13:48 +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
8a253fd1ef Bug 1901461: Implement UIA_StyleIdAttributeId, r=Jamie
This revision implements supportable styles covered by
UIA_StyleIdAttributeId. Namely, this includes the heading levels,
quotes, and emphasis. These are implemented with Accessible role checks.
To get the levels, this revision makes GetLevel a public function. It
also adds constant definitions for MinGW builds. Finally, this revision
adds tests to the existing GetAttributeValue tests.

Differential Revision: https://phabricator.services.mozilla.com/D229082
2024-11-15 19:36:43 +00:00
Eitan Isaacson
2740d16d26 Bug 1929953 - Prune children of container with content property. r=Jamie
A container can recieve a content CSS property after its initial
construction. At that stage it should be considered a leaf. Its
children, who should be frameless at this point, should be pruned.

Differential Revision: https://phabricator.services.mozilla.com/D228484
2024-11-12 15:52:47 +00:00
Nathan LaPre
c7ba4a9640 Bug 1929755: Add supplemental UIA attribute definitions for MinGW builds,r=Jamie
Some UIA attributes are not yet defined on the version of MinGW that we are
using to build and test Gecko. Eventually, an upgrade to MinGW will make these
definitions redundant. In the meantime, this shim allows us to keep implementing
UIA features without breaking builds. The attributes defined in the new header
come directly from the UIAutomationClient.h file, and match the UIA docs.

Differential Revision: https://phabricator.services.mozilla.com/D228366
2024-11-07 23:56:23 +00:00
Eitan Isaacson
7d97cea358 Bug 1440950 - Remove unslotted subtree even when its root has no accessible. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D228101
2024-11-06 22:31:09 +00:00
Nathan LaPre
7b9ea40356 Bug 1901461 - Part 2: Implement UIA_AnnotationTypesAttributeId, r=Jamie
This revision implements the annotation types attribute and a few of its
associated annotation types. Namely, implemented here are SpellingError,
GrammarError, DataValidationError, and Highlighted. This revision also
implements tests for this new functionality.

Differential Revision: https://phabricator.services.mozilla.com/D227893
2024-11-06 19:26:59 +00:00
Nathan LaPre
6f38de1ce9 Bug 1901461 - Part 1: Implement ITextRangeProvider::GetAttributeValue, r=Jamie
This revision implements GetAttributeValue on UiaTextRange. It does not add
support for every UIA text attribute, but does implement eight and lays the
groundwork to implement the rest. To keep GetAttributeValue straightforward, it
mainly contains a switch statement that dispatches a templated GetAttribute
function which makes use of an templated AttributeTraits struct to determine
whether the text attribute is uniform throughout the text range. Finally, this
revision adds a bunch of tests for this new functionality.

Differential Revision: https://phabricator.services.mozilla.com/D227765
2024-11-06 19:26:58 +00:00
James Teh
366a509665 Bug 1928730: Don't expose the protected a11y state for <textarea type="password">. r=eeejay
<textarea type="password"> isn't a thing.
However, we use HTMLTextFieldAccessible for both text <kinput> and <textarea>, and NativeState() wasn't restricting the password check.
Now, we restrict the password check to <input>.

Differential Revision: https://phabricator.services.mozilla.com/D227794
2024-11-05 01:27:46 +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
4bd4cd3b5b Bug 1926214 part 2: Fire a11y scrolling start events on a text leaf node when navigating to text fragments. r=jjaschke,morgan
Previously, scrolling start events always fired on an Accessible for an element, never a text leaf.
However, a text fragment starts in a text leaf node and there may be many other children of the parent element prior to the start of the text fragment.
We want to get a11y clients as close as possible to the fragment, so fire the event on the text leaf node instead.

Unfortunately, we can't fire the Windows event on text leaf nodes, so we have to override this to use the parent in Windows specific code.
Fortunately, we can expose the highlight on Windows via text attributes, so clients can find out exactly what is highlighted, albeit with a bit more work.
This text leaf change is of most benefit on Android, where we can't expose the highlight, but we can move accessibility focus to a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D226587
2024-10-30 04:46:41 +00:00
James Teh
4cdf0b15c1 Bug 1926214 part 1: Call CoInitialize for new threads in a11y Python test runner. r=nlapre
Each browser test file is run with a separate instance of shared-head.js and thus a distinct WebSocket connection to the a11y Python runner.
pywebsocket3 is multi-threaded and may thus choose different threads to handle different WebSocket requests.
Python comtypes implicitly initialises COM when it is imported, but COM initialisation is thread specific and Python modules are cached, so this only applies to the thread on which comtypes was imported.
These factors were causing problems such as event timeouts when running multiple IA2 test files because IA2 relies on COM being initialised.
To fix this, add a setup() function to a11y_setup.py which is called when a request is handled.
For Windows, this calls CoInitialize once in each thread in which it is run.

Differential Revision: https://phabricator.services.mozilla.com/D227143
2024-10-30 04:46:41 +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
5c25abc060 Bug 1926214: Fire a11y scrolling start events on a text leaf node when navigating to text fragments. r=jjaschke,morgan
Previously, scrolling start events always fired on an Accessible for an element, never a text leaf.
However, a text fragment starts in a text leaf node and there may be many other children of the parent element prior to the start of the text fragment.
We want to get a11y clients as close as possible to the fragment, so fire the event on the text leaf node instead.

Unfortunately, we can't fire the Windows event on text leaf nodes, so we have to override this to use the parent in Windows specific code.
Fortunately, we can expose the highlight on Windows via text attributes, so clients can find out exactly what is highlighted, albeit with a bit more work.
This text leaf change is of most benefit on Android, where we can't expose the highlight, but we can move accessibility focus to a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D226587
2024-10-28 06:42:30 +00: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
Emilio Cobos Álvarez
0ec8679a90 Bug 1927138 - Remove popover prefs. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D226956
2024-10-27 08:47:00 +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
Vincent Hilla
d3c8be80cd Bug 1694789 - Map accessible value for input type color and password. r=dom-core,sefeng,Jamie,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D216042
2024-10-22 13:23:18 +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
Emilio Cobos Álvarez
b5d2263c26 Bug 1925866 - NS_NewLocalFile's aFollowSymlinks arg is unused. r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,win-reviewers,karlt,nika,rkraesig
Remove it and related functions, and update the callers.

Differential Revision: https://phabricator.services.mozilla.com/D226261
2024-10-22 09:38:16 +00:00
Emilio Cobos Álvarez
2272866855 Bug 1926031 - Remove unused SCROLL_FOR_CARET_MOVE. r=jjaschke,masayuki
No point in keeping the code around.

Differential Revision: https://phabricator.services.mozilla.com/D226387
2024-10-22 09:34:28 +00:00
James Teh
d648744f28 Bug 1837126: Don't set the selection range when HyperTextAccessibleBase::PasteText is called with TEXT_OFFSET_CARET. r=eeejay
If no text is selected, this is the same as passing the caret offset, since the selection range is already where we want it.
However, if text is selected, this allows the caller to replace it, just as it would be when pasting using the keyboard or GUI.
Note that this doesn't break any existing expectations because TEXT_OFFSET_CARET was never supported for this method previously.

This allows us to remove the DeleteText call from Android SessionAccessibility::Paste.
This separate DeleteText call was causing problems because it could result in the deletion and the insertion happening in two separate ticks, resulting in incorrect events.
Now, this should always happen in a single tick.

Differential Revision: https://phabricator.services.mozilla.com/D226108
2024-10-20 22:35:34 +00:00
Dale Harvey
0974234a5b Bug 1923212 - Skip tests that fail with ScotchBonnet enabled. r=mak,settings-reviewers,sessionstore-reviewers,urlbar-reviewers,dao,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D224633
2024-10-20 08:35:05 +00:00
Norisz Fay
d0b8be820a Backed out changeset 4ef6f0f9300d (bug 1923212) for causing bc failures on browser_searchModeSwitcher_basic.js CLOSED TREE 2024-10-18 20:41:04 +03:00
Ryan VanderMeulen
99ca3a577a Backed out changeset 2488ab222143 (bug 1919155) because it depends on bug 1769586 which was backed out.
CLOSED TREE
2024-10-18 11:07:36 -04:00
Dale Harvey
94124a5dad Bug 1923212 - Skip tests that fail with ScotchBonnet enabled. r=mak,settings-reviewers,sessionstore-reviewers,urlbar-reviewers,dao,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D224633
2024-10-18 13:25:17 +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
Collin Richards
d4fecde3c9 Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
2024-10-17 11:56:34 +00: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
Cosmin Sabou
fe50ea1fee Backed out changeset c3560df7c73f (bug 1086524) for causing bc failures on browser_searchModeSwitcher_basic. 2024-10-17 00:49:27 +03:00
Florian Quèze
30480aefff Bug 1923028 - Migrate scalars to use Glean APIs for a11.*, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D225366
2024-10-16 20:46:06 +00:00