Граф коммитов

9463 Коммитов

Автор SHA1 Сообщение Дата
Eitan Isaacson 37107fdf4c Bug 1733263 - P5: Rely on DOMMenuItem events for ACTIVE state changes in select elements. r=Jamie
1. Use dom events in RootAccessible to fire ACTIVE state changes.
2. Add DOMMenuItemInactive events to nsListControlFrame and fire it on
   the previously active option.
3. Don't fire those DOM events on collapsed combo boxes.
4. Add ACTIVE state change events for collapsed combo box options.

Differential Revision: https://phabricator.services.mozilla.com/D130298
2021-11-11 17:05:58 +00:00
Eitan Isaacson bdc3cd4279 Bug 1733263 - P4: Promisify the select focus change test. r=Jamie
This will make it easier to work with in a later change.

Differential Revision: https://phabricator.services.mozilla.com/D130297
2021-11-11 17:05:58 +00:00
Eitan Isaacson 9116ad2a43 Bug 1733263 - P3: Fire ACTIVE state change when aria-activedescendant changes. r=Jamie
Have ARIAActiveDescendantIDMaybeMoved call ARIAActiveDescendantChanged regardless of
widget focus state. The latter already checks if the widget is focused. This gives us
a chance to fire and ACTIVE state change regardless of focus state.

If an id or aria-activedescendant attribute is about to change, fire an
ACTIVE state change on the previously active accessible.

Differential Revision: https://phabricator.services.mozilla.com/D130296
2021-11-11 17:05:58 +00:00
Eitan Isaacson 48ccdd1553 Bug 1733263 - P2: Flush events and notifications when waiting for unexpected events. r=Jamie
By allowing async DOM events to be dispatched, and advancing the refresh
driver we can force some calls to NotificationController::WillRefresh
and flush out any pending notifications or events.

This lets us more reliably catch unexpected events without the need for
a sentinel event at the end.

Differential Revision: https://phabricator.services.mozilla.com/D130295
2021-11-11 17:05:57 +00:00
Eitan Isaacson ad6731236c Bug 1733263 - P1: Refactor state change event promises. r=Jamie
We do this in a bunch of places, so I moved it into promisified-events.

Differential Revision: https://phabricator.services.mozilla.com/D130294
2021-11-11 17:05:57 +00:00
Butkovits Atila b1ead9992f Backed out 5 changesets (bug 1733263) for causing leakes. CLOSED TREE
Backed out changeset 06263018f1f7 (bug 1733263)
Backed out changeset c8f226476a30 (bug 1733263)
Backed out changeset 2b1755721a8e (bug 1733263)
Backed out changeset 0b3d68cb6e68 (bug 1733263)
Backed out changeset 439e821c9640 (bug 1733263)
2021-11-10 02:22:56 +02:00
Eitan Isaacson 379e516511 Bug 1733263 - P5: Rely on DOMMenuItem events for ACTIVE state changes in select elements. r=Jamie
1. Use dom events in RootAccessible to fire ACTIVE state changes.
2. Add DOMMenuItemInactive events to nsListControlFrame and fire it on
   the previously active option.
3. Don't fire those DOM events on collapsed combo boxes.
4. Add ACTIVE state change events for collapsed combo box options.

Differential Revision: https://phabricator.services.mozilla.com/D130298
2021-11-09 23:17:17 +00:00
Eitan Isaacson c96fcc25b5 Bug 1733263 - P4: Promisify the select focus change test. r=Jamie
This will make it easier to work with in a later change.

Differential Revision: https://phabricator.services.mozilla.com/D130297
2021-11-09 23:17:17 +00:00
Eitan Isaacson c24895a970 Bug 1733263 - P3: Fire ACTIVE state change when aria-activedescendant changes. r=Jamie
Have ARIAActiveDescendantIDMaybeMoved call ARIAActiveDescendantChanged regardless of
widget focus state. The latter already checks if the widget is focused. This gives us
a chance to fire and ACTIVE state change regardless of focus state.

If an id or aria-activedescendant attribute is about to change, fire an
ACTIVE state change on the previously active accessible.

Differential Revision: https://phabricator.services.mozilla.com/D130296
2021-11-09 23:17:17 +00:00
Eitan Isaacson cece555e00 Bug 1733263 - P2: Flush events and notifications when waiting for unexpected events. r=Jamie
By allowing async DOM events to be dispatched, and advancing the refresh
driver we can force some calls to NotificationController::WillRefresh
and flush out any pending notifications or events.

This lets us more reliably catch unexpected events without the need for
a sentinel event at the end.

Differential Revision: https://phabricator.services.mozilla.com/D130295
2021-11-09 23:17:16 +00:00
Eitan Isaacson 594d200c93 Bug 1733263 - P1: Refactor state change event promises. r=Jamie
We do this in a bunch of places, so I moved it into promisified-events.

Differential Revision: https://phabricator.services.mozilla.com/D130294
2021-11-09 23:17:16 +00:00
Nils 3c79233da8 Bug 1740294: Fix typo "then then" -> "then" r=mhentges
Instances of the typo that have been imported from other repositories have been left unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D130561
2021-11-09 17:36:40 +00:00
Ting-Yu Lin f32eaad379 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-09 01:14:15 +00:00
Gerald Squelart 5399574d8b Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Iulian Moraru 36283a9a3b Backed out 2 changesets (bug 1722484) for causing multiple build bustages. CLOSED TREE
Backed out changeset bef547b588ff (bug 1722484)
Backed out changeset e676fa1a0cb7 (bug 1722484)
2021-11-09 01:42:20 +02:00
Ting-Yu Lin 7310c93473 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-08 22:24:19 +00:00
Cristian Tuns 1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
James Teh 5d76f559b9 Bug 1736742 part 3: When running in an MSIX container, register AccessibleHandler in HKCU at startup if it isn't already registered. r=nalexander,jmathies
Differential Revision: https://phabricator.services.mozilla.com/D129951
2021-11-05 06:25:45 +00:00
Gerald Squelart 7fa084ae7c Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00
James Teh eb568eccaf Bug 1735969: Unify Accessible::TakeFocus, thus allowing it to be used for RemoteAccessibles when the cache is enabled on Windows. r=morgan
1. Add TakeFocus in Windows PDocAccessible.
2. Move RecvTakeFocus into DocAccessibleChildBase so it is used for all platforms.
3. Move TakeFocus into the Accessible base class.
4. Move the IPDL version of TakeFocus into RemoteAccessibleBase so it is used for all plaforms.
5. Make the Windows RemoteAccessible::TakeFocus use the base (IPDL) implementation if the cache is enabled or COM otherwise.
6. Use Accessible::TakeFocus for ATK, Mac, Windows and XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D130327
2021-11-05 00:52:15 +00:00
ssummar c7c477296e Bug 1738840 - Replaces mozilla::Tuple with std::tuple in accessible/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130152
2021-11-04 13:39:19 +00:00
Magnus Melin 28f70eb371 Bug 1738565 - fix Crash in [@ -[MOXWebAreaAccessible handleAccessibleEvent:]]. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D129979
2021-11-03 08:44:02 +00:00
James Teh ca81384a66 Bug 1738051: Use a11y focus events to support the focused state when the cache is enabled. r=eeejay
This will also serve as the groundwork for unifying FocusedChild, but that isn't implemented here.

Differential Revision: https://phabricator.services.mozilla.com/D129669
2021-11-02 23:56:37 +00:00
James Teh eca2f19b0d Bug 1738032 part 6: browser_caching_states.js: Ignore state changes for states we aren't interested in. r=eeejay
For example, when disabling an HTML input, we get an event for SUPPORTS_AUTOCOMPLETION among others.
If we continue with the test after that state change and there hasn't been an ENABLED/UNAVAILABLE state change, the cache won't be up to date.
Unfortunately, we can't use untilCacheOk here because we don't do a cache push for state changes.

Differential Revision: https://phabricator.services.mozilla.com/D129643
2021-11-02 23:56:36 +00:00
James Teh 6deb1a13cb Bug 1738032 part 5: Use the unified Accessible::State on Windows to support cached RemoteAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D129642
2021-11-02 23:56:36 +00:00
James Teh f20971182b Bug 1738032 part 4: Use the cache for RemoteAccessible state. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D129641
2021-11-02 23:56:36 +00:00
James Teh 461332528f Bug 1738032 part 3: Move LocalAccessible::State to Accessible. r=eeejay
This patch includes XPCOM support.
Unfortunately, LocalAccessible::State isn't const, so the base method can't be const for now either.

Differential Revision: https://phabricator.services.mozilla.com/D129640
2021-11-02 23:56:35 +00:00
James Teh 1d1d118200 Bug 1738032 part 2: Push a11y state in the initial cache push. r=eeejay
Rather than cache updates thereafter, state will be kept up to date using state change events.

Differential Revision: https://phabricator.services.mozilla.com/D129639
2021-11-02 23:56:35 +00:00
James Teh 9123e3a0ce Bug 1738032 part 1: Support uint64_t as a value type for AccAttributes. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D129638
2021-11-02 23:56:34 +00:00
James Teh 9e4079f57f Bug 1738070: Don't fire state change a11y events for NS_EVENT_STATE_DEFAULT changes on things other than buttons. r=morgan
We only expose this state on HTMLButtonAccessible, but we sometimes get these notifications for other controls; e.g. checkbox inputs.
We shouldn't fire a state change event for a state we never expose.

Differential Revision: https://phabricator.services.mozilla.com/D129673
2021-11-02 23:51:12 +00:00
Masayuki Nakano 4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve `nsINode` or its concrete classes from `EventTarget` r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Emilio Cobos Álvarez f3f1e06187 Bug 1738586 - Fix a11y test_general on dark mode. r=Jamie
Since this is a chrome page we start honoring dark mode colors by
default, and after bug 1525107 that affects default background and text
colors, which these tests were hardcoding to black/white.

Differential Revision: https://phabricator.services.mozilla.com/D129983
2021-11-02 10:36:17 +00:00
James Teh 570683a696 Bug 1730096 part 9: Add tests for cached text attributes. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D129475
2021-11-01 23:27:40 +00:00
James Teh 1563d99b94 Bug 1730096 part 8: Move DefaultTextAttributes to HyperTextAccessibleBase and implement it for RemoteAccessible. r=eeejay
This patch includes ATK and XPCOM support.

Differential Revision: https://phabricator.services.mozilla.com/D129474
2021-11-01 23:27:39 +00:00
James Teh 6bd5ccff7d Bug 1730096 part 7: Support cached remote text attributes in TextLeafPoint. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D129473
2021-11-01 23:27:39 +00:00
James Teh 7f79cc0400 Bug 1730096 part 6: Add AccAttributes::CopyTo to copy an AccAttributes. r=eeejay
This is necessary for two reasons:

1. Leaf text attributes and default text attributes are cached separately, since the caller can choose whether to include defaults or not. This means merging them together.
2. Methods for retrieving attributes currently return a non-const AccAttributes. We might be able to change this in future for some of them, but I didn't want to deal with that in this work.

Differential Revision: https://phabricator.services.mozilla.com/D129472
2021-11-01 23:27:39 +00:00
James Teh e2a75ff2ce Bug 1730096 part 5: Push text attributes to the cache. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D129471
2021-11-01 23:27:38 +00:00
James Teh 5cb3312f64 Bug 1730096 part 4: Support AccAttributes as a value inside an AccAttributes. r=eeejay
This will be used to include text attributes as part of the cache for an Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D129470
2021-11-01 23:27:38 +00:00
James Teh f24390b6a8 Bug 1730096 part 3: Add HyperTextAccessibleBase::TextAttributes. r=eeejay
This uses TextLeafPoint.
This patch includes support for ATK, IA2 and XPCOM.
As with TextAtOffset, HyperTextAccessible calls the base implementation if the cache is enabled, but otherwise uses the old implementation for now.

Differential Revision: https://phabricator.services.mozilla.com/D129469
2021-11-01 23:27:37 +00:00
James Teh 754058c557 Bug 1730096 part 2: Implement support for text attributes in TextLeafPoint. r=eeejay
This supports both fetching text attributes and finding the start of attribute runs, but only for LocalAccessible.
Support for RemoteAccessible will be added in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D129468
2021-11-01 23:27:37 +00:00
James Teh 39c9ee45b8 Bug 1730096 part 1: Add AccAttributes::Equal to compare attributes in two instances. r=eeejay
This will be used later to check whether text attributes are different between two Accessibles.
I added this as a method instead of operator== because callers always hold a pointer to AccAttributes, and *a1 == *a2 is weird and will probably lead to mistakes.
This required adding operator== for our value structs.

Differential Revision: https://phabricator.services.mozilla.com/D129467
2021-11-01 23:27:37 +00:00
Emilio Cobos Álvarez 43632d10fb Bug 1738084 - Make popups on Linux have shadows. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D129699
2021-10-28 00:51:58 +00:00
Markus Stange b0068bfe22 Bug 1737869 - Fix build with the macOS 12 SDK, by using AXTextMarker(Range)Ref instead of id and by ifdefing the declarations that are now public in the new SDK. r=eeejay
I think this patch is functionally neutral.
I'm not completely sure about the best way to do these casts - the __bridge may not be
necessary since we don't use ARC yet. But it's probably fine to add it anyway.
Also, returning autoreleased CFTypeRef objects seems a bit weird, but it's what we've
already been doing and it's probably fine.
And some of these nils should maybe be nullptrs, but the compiler doesn't seem to care.

Differential Revision: https://phabricator.services.mozilla.com/D129559
2021-10-27 20:38:07 +00:00
James Teh 20bdf607b8 Bug 1735706: Check the cache pref instead of mCachedFields in non-Windows RemoteAccessible methods. r=eeejay
mCachedFields might be null because all fields are default; i.e. mCachedFields being null doesn't mean the cache is invalid/disabled.
We should check the pref instead when determining whether to call base class methods to query the cache.

Differential Revision: https://phabricator.services.mozilla.com/D128445
2021-10-26 22:26:45 +00:00
James Teh c0e93222ee Bug 1735464: PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails. r=eeejay
IsStartOfGroup wants to peek at the previous character.
It calls PrevChar, but it doesn't check for failure.
It then unconditionally increments mOffset to "undo" PrevChar.
If PrevChar failed, that means we're now 1 character after where we started.
This wasn't causing any test failures and I can't think of a test case that shows breakage here.
Nevertheless, it definitely doesn't make sense and could cause difficult-to-diagnose bugs.

This in turn exposed a bug in PrevChar whereby it didn't handle being called again after it had already failed.
That also had to be fixed here.

Differential Revision: https://phabricator.services.mozilla.com/D128332
2021-10-26 22:25:29 +00:00
James Teh ce7bb0bc8c Bug 1734583: When retrieving text stuff from the cache, null check mCachedFields and also verify the cache. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D128334
2021-10-26 22:24:17 +00:00
Ting-Yu Lin c2f6ef7a09 Bug 1736938 Part 3 - Make all WordBreaker's methods static, and adapt the callers. r=jfkthame
The motivation is the same as the previous part.

Differential Revision: https://phabricator.services.mozilla.com/D129109
2021-10-25 19:00:22 +00:00
Ting-Yu Lin 11ec3b3de9 Bug 1737332 - Remove unused WordBreaker argument for IsAcceptableWordStart(). r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D129108
2021-10-22 18:41:45 +00:00
Eitan Isaacson 254970745b Bug 1733248 - Fire state change events for autocomplete changes. r=morgan
Trickier than just listening for attributes on inputs since a form
can toggle autocomplete too.

Also fixed To32States to work on the 32nd bit.

Differential Revision: https://phabricator.services.mozilla.com/D128913
2021-10-21 22:47:43 +00:00
Eitan Isaacson 9ea8dc7379 Bug 1736115 - Remove HTMLTextFieldAccessible::BindingOrWidgetParent. r=Jamie
Also fix search-textbox's use of aria-autocomplete and a test.

Differential Revision: https://phabricator.services.mozilla.com/D128655
2021-10-21 22:47:43 +00:00