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
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
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
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
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
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
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
`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
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
`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
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
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
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
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
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
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
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
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
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
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
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
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
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
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