- From: David Flanagan <david@oreilly.com>
- Date: Tue, 1 May 2001 10:59:17 -0700
- To: www-dom@w3.org
[Sorry if you see this message twice. My first mailing appears not to
have made it to the list archives...]
Here are some comments on the 4/10/2001 draft of the Level 3 DOM Events
spec.
1) Typo: the description of the checkModifier() method refers twice to
it as "CheckModifier" with a capital C. Also, in the description of
virtKeyVal, change "virtKeyVale" to "virtKeyVal".
2) inputGenerated: I don't understand why this property has the word
"input" in its name when the description refers to "visible
*output*". Would outputGenerated be a better name?
Also: the description of this property needs an example. It says "is
intended to differentiate between key events which may or may not
produce visible output depending on system state". This is really
vague, and I just don't get it, but I think an example would help.
3) keyVal: according to the description, this property doesn't provide
any information that isn't already provided by outputString. Is this
correct, or is there some interaction between inputGenerated, keyVal
and outputString?
What I really think we need to accompany the description of KeyEvent
is some pseudo-code showing how an event listener might examine a
KeyEvent and extract the maximum amount of information from
it. Here's the understanding I've formed based on the current draft:
if (e.outputString != null && e.outputString.length > 1) {
// use outputString
}
else if (e.outputString != null && e.outputString.length == 1) {
// use outputString or keyVal, depending on preference
}
else if (e.outputString == null || e.outputString.length == 0 ||
e.keyVal == 0) {
// use virtKeyVal
}
4) In the specs for other event modules, each event type specifies which
properties of the event interface are valid for that type. It would
be useful to have the same specified here for textEvent, keyup, and
keydown events. For example, id the inputGenerated property ever
valid for keyup and keydown events, or only for textEvent events?
5) I've got to question the event type "textEvent". This is better than
"keypress", since that event name is already in use in existing
browsers. But it is redundant and unprecedented to have the word
"Event" in an event type name. The usual format of event names is
nounVerb or nounverb, so how about "textGenerated" or "textgenerated"
instead?
David Flanagan
Received on Tuesday, 1 May 2001 14:57:56 UTC