W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2010

Re: Proposal to ammend the composition event spec.

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 16 Jun 2010 14:38:39 -0700
Message-ID: <AANLkTilBE2zI2jLenVDeQRf45M8kBTaY5akYZKB0UnXT@mail.gmail.com>
To: James Su <suzhe@google.com>
Cc: Hironori Bono (Ұ ) <hbono@google.com>, Daniel Danilatos <daniel@danilatos.com>, www-dom@w3.org
On Wed, Jun 16, 2010 at 1:46 AM, James Su <suzhe@google.com> wrote:

> 2010/6/16 Hironori Bono (坊野 博典) <hbono@google.com>
> Greetings,
>> Even though your proposal looks great, I would like to clarify one
>> point: section 6.2.4 (*1) writes "cancelling the default action of a
>> keydown event must prevent its respective textInput event from being
>> generated." If I understand your proposal correctly, your proposal
>> seems cancelling the default action of a textInput event does not
>> affect its respective compositionend event. Therefore, your proposal
>> implies canceling the default action of a keydown event does not
>> affect its respective compositionend event, right? (Do we need to add
>> this sentence to section 6.2.4?)
> It's not correct. Cancelling a keydown event should prevent the
> corresponding composition and textInput events from being generated.

I think Dan's proposed change doesn't affect section 6.2.4 (6.2.5 in the dev
version) since the keydowns in these cases would not generate textInput

This is a separate discussion really, but I'm not sure it's possible to both
implement the keyCode/key properties on the keydown event on Mac and make
it cancelable for IME input. In order to get the keyCode/key, the IME has to
be sent the keydown first and once it's been given the keydown, there's no
way to rollback the IME state. One way to make
keydown cancelable cross-platform is to say that preventDefault on an IME
keydown cancels the composition entirely.

to type "wo" -> 我

user "w"  <-- Canceling keydown should prevent the composition from starting
and the DOM should not be modified.
event compositionstart

user "o"  <-- Not related to textInput since this keydown doesn't generate a
textInput event. One cross-platform solution would be to cancel the

user <space>  <-- Same as above.

user <space> (to commit the composition) <-- Should cancel the textInput and
thus cancel the composition.
event textInput (cancelable)
event compositionend

Received on Wednesday, 16 June 2010 21:39:31 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:16 UTC