[DOM3 Events] Issues of target of composition events

The event targets of composition events are defined now:

compositionstart: focused element processing the composition
compositionupdate: focused element processing the composition, null if 
not accessible
compositionend: focused element processing the composition

I'm struggling with some composition transaction issues on Gecko. Gecko 
does NOT ensure all composition events are fired on composing text 
editor. And also Gecko's text editor managing its composing state by 
boolean variant internally. By these reasons, Gecko's text editor is 
sometimes confused by unexpected composition state. E.g., composition 
has started with compositionstart or has gone without compositionend.

Though, these issues happen with other bugs, same issue could happen on 
Web application too if we defined the composition event targets as above.

So, I'd like to suggest:

1. When browser forcibly commits or cancels composition at blurring an 
text editor, the blurred text editor must be fired compositionupdate 
event (only when its data value is different from last compositionupdate 
event) and compositionend event.

2. When browser continues composition which was taken over from previous 
focused text editor, compositionstart event and compositionupdate event 
(only when data isn't empty) must be fired on new focused editor.

So, the definition of target of compositionupdate and compositionend 
should be "processing the composition", i.e., "focused element" should 
be removed and these rules should be documented in the spec.

However, there is another issue which I have not found good suggestion for.

If Web application moves focus by compositionstart event handler, I 
think composition can be started by new focused text editor. At that 
time, compositionstart must be fired on the new focused text editor too. 
But if focus were moved again and more, it could cause infinite loop by 
bad web pages.

I'd like to hear the ideas of you. Thanks.

-- 
Masayuki Nakano <masayuki@d-toybox.com>
Manager, Internationalization, Mozilla Japan.

Received on Sunday, 18 March 2012 01:30:30 UTC