Closed
Bug 65158
Opened 24 years ago
Closed 24 years ago
Need to attach accessibility event handler to all windows in one go
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: aaronlev, Assigned: aaronlev)
Details
(Keywords: access)
Attachments
(10 files)
2.43 KB,
patch
|
Details | Diff | Splinter Review | |
3.07 KB,
patch
|
Details | Diff | Splinter Review | |
2.96 KB,
patch
|
Details | Diff | Splinter Review | |
3.09 KB,
patch
|
Details | Diff | Splinter Review | |
3.12 KB,
patch
|
Details | Diff | Splinter Review | |
3.12 KB,
patch
|
Details | Diff | Splinter Review | |
25.51 KB,
application/tar
|
Details | |
26.64 KB,
patch
|
Details | Diff | Splinter Review | |
33.30 KB,
patch
|
Details | Diff | Splinter Review | |
30.62 KB,
patch
|
Details | Diff | Splinter Review |
For accessibility purposes, we need to be able to monitor events that happen in
any content *or* chrome window - keyboard events, focus events, load events etc.
I have done this by adding a function in dom/src/base/nsGlobalWindow.cpp called
AttachAccessibleEventHandlers, which looks for a service called
@mozilla.org/accessproxy;1 with the interface nsIAccessProxy and attaches event
handlers to it for keypress, keyup, click, load and focus events.
Assignee | ||
Comment 1•24 years ago
|
||
Further explanation: this bug allows one to add text-to-speech capability
directly to the Mozilla browser. Eventually we will add a pref so that the user
can use Mozilla with whatever text-to-speech engine they have on their system.
This is intended to be used with the accessibility.browsewithcaret preference
(see bug 49508)
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
This won't affect performance - the accessibility handler is only attached if
the pref accessibility.usetexttospeech or accessibility.usebrailledisplay are
set to a a non-null string. Eventually those string's will correspond to the
name of an engine or speech component.
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
Assignee | ||
Comment 9•24 years ago
|
||
Assignee | ||
Comment 10•24 years ago
|
||
Eventually I need to replace
"@mozilla.org/accessproxy;1" with NS_ACCESSPROXY_CONTRACTID
once everything's in place.
However, I'd like to get these changes checked in first, but I promise to change
it once we have these checkins finalized.
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•24 years ago
|
||
Assignee | ||
Comment 12•24 years ago
|
||
Waiting for jst to ask Vidur about this patch.
We might want to make the component that is used for the handler a pref, so
instead of hardcoding "@mozilla.org/accessproxy;1" we could have
the pref accessibility.globlalhandler="@mozilla.org/accessproxy;1"
jst is the reviewer for this, vidur is probably the super-reviewer.
I'll need 3 reviewers and their signatures to get CVS access - this will be my
first checkin.
Assignee | ||
Comment 13•24 years ago
|
||
Assignee | ||
Comment 14•24 years ago
|
||
Jag, got rid of the kludginess you didn't like, via Vidur & Jst's help.
Jst, ready for r= ?
Comment 15•24 years ago
|
||
I had a look at the last diff in this bug and here's a few things that should be
fixed before this is checked in:
- Since the code is MPL'ed the comment header in nsAccessProxy.cpp,
nsAccessProxy.h, nsIAccessProxy.idl should be the standard MPL comment (the one
you have in there has either #'es on every line, or missing *'s on every line),
grab a copy of the comment block from an existing source file in mozilla.
- nsAccessProxy::GetInstance() is never used, could it be removed or was it left
in for futher callers?
- nsAccessProxy::mInstance should be private, right?
- All those printf's in the nsAccessProxy::OnXXX methods could generate quite
alot of noice, could you wrap them in #ifdef NS_DEBUG?
- in nsIAccessProxy.idl, could all the nsIDOMEvent stuff you have in there be
replaced with one simple "interface nsIDOMEvent;" forward declaration?
- Any good reason for nsIAccessProxy::handleEvent() being [noscript]?
Also, please fix the indentation in the .cpp file, bee consistent, I see 1, 2
and 4 spaces used for indentation, stay with 2 like most of the mozilla code
does, or if you disagree with that atleast make it consistent, that also goes
for indentation of method argument lists that are broken up on multiple lines.
I assume there's more to this than this one patch, right? Will the rest of this
(i.e. the implementation of the event listener) be checked in in a different
checkin?
Please correct those issues and attach a new diff and I'll have one more look.
Comment 16•24 years ago
|
||
Oh, and in nsAccessProxy::Initialize() you don't need the extra docLoader
pointer, just do progress(do_GetServ...) and you needs a null check before
referencing 'progress'.
Assignee | ||
Comment 17•24 years ago
|
||
Comment 18•24 years ago
|
||
I had a look at the last diff and there's still some license comment block
weidness, just formatting differences between the ones used here and other
license comment blocks in the rest of the code in mozilla, so please fix that
when checking in, simply grab a copy of a license comment block, and don't edit
it, leave it as is so that these files don't cause grief when doing automatic
updates of the licenses in the source repository. And now the code is dual
licensed, MPL and GPL, I'm assuming that's intentional.
I noticed that the diffs contain the actual unix Makefile's, make sure you don't
check those in, just check in Makefile.in's.
Also, as part of the lisence comment there's an emacs more line, it should be:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
to match the indentation used in the files (the modelines in the patch say 4 in
stead of 2).
In nsAccessProxy.cpp you probably don't need the #include's "plstr.h", "stdio.h"
(which should be <stdio.h> if it's needed) and "prprf.h".
In nsAccessProxy::OnStateChange() you don't need the rv variable, simply
checking if you got a non-null window pointer is enough since you don't return
the falure code or anything there, and the ending square brackets are not
aligned with the opening ones.
Ok, I'm done here, I'd say that with those changes the code looks nice and
clean, r=jst.
Assignee | ||
Comment 19•24 years ago
|
||
Okay,
I've made jst's changes - the license is fixed, indent comment is fixed for
emacs, OnStateChange is fixed, the extra #include's are removed, and I won't
check in the Makefile 's, just Makefile.in
Vidur, can you sr= ?
Aaron
Comment 20•24 years ago
|
||
Aaron, I'm not sure what the current conventional wisdom is for where to put
contract ids, but I'd recommend putting the AccessProxy one in
nsIAccessProxy.idl, within a %{ C++ %} block. Other than that, sr=vidur.
Assignee | ||
Comment 21•24 years ago
|
||
Vidur, done - I need 2 other superreviews so I can eventually get CVS access
Assignee | ||
Comment 22•24 years ago
|
||
Part 1 checked in.
Next we'll ctually use the data we're getting from these events.
Assignee | ||
Comment 23•24 years ago
|
||
This was checked in a while ago, marking fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•