Closed Bug 331120 Opened 18 years ago Closed 1 month ago

log whether or not accessibility features are enabled

Categories

(Toolkit Graveyard :: Data Collection/Metrics, defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: marria, Unassigned)

References

Details

It might be useful to know whether or not someone has accessibility features enabled on their browser, since large leaks have been reported with that enabled:
http://groups.google.com/group/mozilla.dev.planning/browse_frm/thread/bf3da7b3494a7855/3e6dc11e51ad7f15#3e6dc11e51ad7f15
Blocks: 328064
From nsIServiceManager
 boolean isServiceInstantiated(in nsCIDRef aClass, in nsIIDRef aIID);
 boolean isServiceInstantiatedByContractID(in string aContractID, in nsIIDRef aIID);

We could see if nsIAccessibilityService has been instantiated.
BTW, I never found out if these large leaks occur on OS X. On that platform we never instantiate accessibility.
The code:

Components.manager.QueryInterface(Components.interfaces.nsIServiceManager).isServiceInstantiatedByContractID("@mozilla.org/accessibilityService;1",Components.interfaces.nsIAccessibilityService)

does pretty much do what's needed, although the implementations of those two methods have undocumented behavior that's a little annoying:
 * they return true if the service has been instatiated and the object supports the IID given
 * they throw an exception otherwise (NS_ERROR_SERVICE_NOT_AVAILABLE if it hasn't been instantiated, and NS_NOINTERFACE if it doesn't support the IID given)

I tested that this does detect accessibility being enabled by toggling the GTK accessibility pref (System -> Preferences -> Accessibility -> Assistive Technology Support -> Enable Assistive Technologies) and then loading about:config (to get chrome privs for javascript URLs in the URL bar) and pasting in the URL:
javascript:void(alert(Components.manager.QueryInterface(Components.interfaces.nsIServiceManager).isServiceInstantiatedByContractID("@mozilla.org/accessibilityService;1",Components.interfaces.nsIAccessibilityService)))

It yielded an exception on the JS console when GTK's accessibility pref was not enabled and an alert "true" when it was.
I filed bug 334458 on the wacky nsIServiceManager implementation mentioned in the previous comment.
The only place in the constructor chain for nsRootAccessible that we pass |this| around is here:
http://lxr.mozilla.org/seamonkey/source/accessible/src/atk/nsRootAccessibleWrap.cpp#49

Ginn, I think we need to move that into nsRootAccessibleWrap::Init()

While we're at it the code in the destructor needs to be moved to the Shutdown() method. Most things should happen in Shutdown() not in the destructor because we're guaranteed that Shutdown() will be called when a DOM Node is no longer needed. Unfortunately the refcount might not be 0 because a poorly behaving accessibility user might not release when we want them to.

Looks like we'll have to go through the mozilla/accessible/atk and ensure proper use of Init() and Shutdown() instead of constructor and destructor code.
(In reply to comment #8)
> aaronl, was that comment meant for bug 334556?

Yes, that's why I usually don't work late at night anymore :)
Priority: -- → P1
No longer blocks: 328064
Depends on: 338219
Priority: P1 → P2
Product: Toolkit → Toolkit Graveyard
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.