W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

Re: DOM3 Events Keyflow

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Wed, 02 Apr 2008 18:31:26 +0300
Message-ID: <47F3A6CE.5060509@helsinki.fi>
To: Doug Schepers <schepers@w3.org>
CC: Web API public <public-webapi@w3.org>
Hi all,

I did some key event testing, mainly on Windows.
Tested FF3, Safari3.1, Opera9.5 (not IE, because of its non-DOM-events).
When just pressing one character key all the browsers dispatch
'keydown', 'keypress', 'input', 'keyup', but Safari dispaches also
'textInput' right before 'input'.

So the key event dispatching in non-IME cases is quite similar in all
those browsers - at least when the testcase is simple enough :)

But when enabling IME things change quite a bit.
The testcase was simply to press 'k' and 'a' and enter
to get one Hiragana symbol. MS IME Standard 2002 ver 8.1 was
used for the testing.

Opera seems to dispatch only the first 'keydown' and when
the composition is ready one 'input'. Subsequent IME compositions
don't trigger keydown, only 'input' events.

Safari does something like:
'keydown', 'input', 'keyup', 'keydown', 'input', 'input', 'keyup',
'keydown', 'input', 'textInput', 'input', 'keyup'.
That is quite many 'input' events.

Gecko has for a long time had few events for
IME, so the event flow in the testcase goes like this:
'keydown', 'keypress', 'compositionstart', 'text', 'text', 'text', 
'input', 'compositionend', 'keyup'
I don't like the event name 'text' (which is dispatched for each
component in the composition, or how to say) but it has been there
since 1999. The names 'compositionstart' and 'compositionend' are ok.
If those gecko-only-events are removed from the flow, it looks just like
the normal key event handling: 'keydown', 'keypress', 'input', 'keyup'
Pretty nice, IMHO.

My testing may miss some events, especially if non-gecko-engines
have some their own events.

I attached also one quick version of gecko-key-event-flow.
It may contain bugs and doesn't cover all the cases.


Doug Schepers wrote:
> Hi, WebAPI fans-
> This past week in the DOM3 Events telcon, we discussed the order of key
> events for the DOM3 Events specification, with attention paid to IME. We
> are hoping to model the most platform-independent event order, and are
> seeking active feedback from Apple, Microsoft, Mozilla, Opera, and
> anyone else with experience in implementing keyboard events (especially
> with regards to internationalization).
> I've made a trial schematic to get us started [1]. I've also modeled it
> in Graphviz, and I've included the Dot format file here (attached).
> Graphviz is free open source software [2], and the Dot format is really
> simple to edit.
> We are hoping to discuss this again at next week's teleconference.
> [1]
> http://dev.w3.org/2006/webapi/DOM-Level-3-Events/proposals/d3e-keyflow.svg
> [2] http://www.graphviz.org/
> Regards-
> -Doug Schepers
> W3C Team Contact, SVG, CDF, and WebAPI

(image/svg+xml attachment: gecko-keyflow.svg)

Received on Wednesday, 2 April 2008 15:32:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:10:00 UTC