Closed Bug 1430412 Opened 2 years ago Closed 2 years ago

Only fire 'a11y-init-or-shutdown' when a11y service is actually fully created or destroyed.


(Core :: Disability Access APIs, enhancement)

Not set



Tracking Status
firefox59 --- fixed


(Reporter: yzen, Assigned: yzen)



(Keywords: access)


(1 file)

At the moment we fire the event before all the components are created, destroyed. We need to change that to only fire when everything is completed. 

The reason being is that sometimes (most of the time) when we get an event and check Services.appinfo.accessibilityEnabled it is not in sync (e.g. we might not or still have a reference to an a11y service that is being created or destroyed).
Attached patch 1430412 patchSplinter Review
Attachment #8942449 - Flags: review?(surkov.alexander)
Comment on attachment 8942449 [details] [diff] [review]
1430412 patch

Review of attachment 8942449 [details] [diff] [review]:

::: accessible/base/nsAccessibilityService.cpp
@@ +1457,5 @@
> +
> +  if (observerService) {
> +    static const char16_t kShutdownIndicator[] = { '0', 0 };
> +    observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
> +  }

usually shutdown is fired before the actual shutdown happens, so the listener has a grace period to shutdown the things properly on his end. are you sure about the change?
I think I am, yes. Having Services.appinfo.accessibilityEnabled not in sync really hurts. There is then no reliable way to know when accessibility is truly shut down.
Comment on attachment 8942449 [details] [diff] [review]
1430412 patch

Review of attachment 8942449 [details] [diff] [review]:

r=me then, afaik devtools is only one real consumer of it, and it's safe to change the behavior to whatever you want.
Attachment #8942449 - Flags: review?(surkov.alexander) → review+
Pushed by
fire 'a11y-init-or-shutdown' at the end of a11y service init and shutdown calls. r=surkov
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.