This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22842 - Should keyboard events fire during a composition session?
Summary: Should keyboard events fire during a composition session?
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-31 01:02 UTC by Travis Leithead [MSFT]
Modified: 2013-08-26 16:30 UTC (History)
5 users (show)

See Also:


Attachments

Description Travis Leithead [MSFT] 2013-07-31 01:02:47 UTC
Many folks working with composition events in the web platform (Microsoft East-Asia developers) have expressed problems with dealing with keyboard events and composition events that are coming in at the same time (they have to know to suppress them while a composition is in progress to avoid unwanted state changes).

I'd like to know: a) whether the spec says these (keyboard events) must be fired during IME composition and b) discuss whether they need to be fired.
Comment 1 Olli Pettay 2013-07-31 10:32:05 UTC
Traditionally the key events may have fired during composition
(depending on the IME). And since the behavior has been that for years,
I'd be rather reluctant to change it.

And the spec says in normative part 
"Composition Events provide a means for inputing text in a supplementary or alternate manner than by Keyboard Events"


It doesn't sounds too bad if one needs to suppress key event handling while
dealing with composition events.
Comment 2 Masayuki Nakano 2013-08-01 05:56:09 UTC
First of all, keypress event shouldn't be fired.

The point is, about keydown and keyup.

Most browsers, except Gecko, fire keydown and keyup events even during composition. So, for compatibility, it *might* be better the events fired even during composition. I have no idea for the usage.

Additionally, keydown.preventDefault() during composition *may* not be able to suppress the key event handled by IME because on some platform, key event may be passed to IME first.

On the other hand, if web developers are not familiar with IME, it's possible to create web applications which is IME unaware. For example, IME composition might be committed forcibly by keydown or keyup event handlers. But I don't worry this for now. I believe that most web developers know IME since mobile phone uses IME with any languages. And there are input event and mutation event which are also fired even during composition. So, they have same issue. It might not make sense to worry about only keydown and keyup events.

However, Gecko needs a lot of work internally before dispatching them during composition because our internal key event handlers don't check composition state. So, there must be problems if Gecko dispatch them during composition.

Anyway, I think that the spec should define it clearly.
Comment 3 Olli Pettay 2013-08-01 11:31:23 UTC
I meant http://lists.w3.org/Archives/Public/public-webapi/2008Apr/0034.html
when talking about the long history of dispatching key events around composition.
(Gecko does still some parts wrong,
https://bugzilla.mozilla.org/show_bug.cgi?id=354358)
Comment 4 Gary Kacmarcik 2013-08-26 16:30:19 UTC
Fixed in latest ED. There is now a section discussing key events during composition.