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 18931 - D3E should define when compositionupdate event is fired
Summary: D3E should define when compositionupdate event is fired
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-20 09:17 UTC by Masayuki Nakano
Modified: 2013-08-26 16:29 UTC (History)
4 users (show)

See Also:


Attachments

Description Masayuki Nakano 2012-09-20 09:17:36 UTC
I forgot to file this issue here.

I mentioned this in the ML but nobody never replied this:
http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0239.html

> I think D3E spec should define the timing of compositionupdate event clearly.
> 
> On IE9, compositionupdate event is fired *after* editor content is modified actually.
> 
> On WebKit and Gecko, it's fired *before* editor content is modified.
> 
> That means there is a difference. That is, whether web app can access modified content by value of <input> or <textarea>, or innerHTML of editing host of a contenteditable element.
> 
> I think that most web application developers expect IE9's behavior because compositionupdate isn't cancelable and they may want to access the modified value.
> 
> For the compatibility between browsers, I'd like to suggest that D3E should define the timing. I recommend the IE9's behavior.
Comment 1 Takayoshi Kochi 2013-07-24 00:26:58 UTC
Here are relevant bugs filed for WebKit and Chromium:
(though they are talking about 'compositionend' event)
https://bugs.webkit.org/show_bug.cgi?id=31902
https://code.google.com/p/chromium/issues/detail?id=41945
Comment 2 Travis Leithead [MSFT] 2013-07-24 00:37:03 UTC
Proposed spec text (replaces existing paragraph after the event definition):

A user agent SHOULD dispatch this event during a composition session when a text composition system updates its active text passage with a new character, which is reflected in the string in CompositionEvent.data. In text composition systems which keep the ongoing composition in sync with the input control, the compositionupdate event SHOULD be dispatched after the control is updated. Some text composition systems might not expose this information to the DOM, in which case this event will not fire during the composition process. If the composition session is canceled, this event will be fired immediately before the compositionend event, and the CompositionEvent.data attribute will be set to the empty string.
Comment 3 Masayuki Nakano 2013-07-24 07:14:43 UTC
If we will define "input" event, we need to define the order with "input" event too (not so important, though).
Comment 4 Takayoshi Kochi 2013-07-25 09:24:34 UTC
Also for compositionend event?

ORIGINAL
==============
A user agent must dispatch this event when a text composition system completes or cancels the current composition session.

This event is dispatched immediately after the text composition system completes the composition session (e.g., the IME is closed, minimized, switched out of focus, or otherwise dismissed, and the focus switched back to the user agent).
==============

NEW
==============
A user agent must dispatch this event when a text composition system completes or cancels the current composition session, and the compositionend event SHOULD be
dispatched after the control is updated.

This event is dispatched immediately after the text composition system completes the composition session (e.g., the IME is closed, minimized, switched out of focus, or otherwise dismissed, and the focus switched back to the user agent). 
==============