Closed Bug 724471 Opened 8 years ago Closed 8 years ago

[IMM] two sets of composition events are fired for a composition of Korean IME

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Attachments

(1 file)

When I commit composition string of Korean IME on Win7, by space key, it causes strange DOM composition events.

First, the composition is committed by empty string. Next, composition restarts and is committed with the latest composition string. So, web applications see two composition for an actual composition.

The cause is, nsIMM32Handler has a hack for Korean IME which was implemented by an ancient bug (forgot the bug #). Korean IME sends WM_IME_ENDCOMPOSITION first, after that, sends WM_IME_COMPOSITION. It caused doubling the composition string at committing. For preventing that, current our code dispatches an empty text event and compositionend event at WM_IME_ENDCOMPOSITION.

This strange behavior can be confirmed on Win7 too. I think that WM_IME_ENDCOMPOSITION should check the message queue if there is WM_IME_COMPOSITION. If there is, we should ignore the WM_IME_ENDCOMPOSITION.
> The cause is, nsIMM32Handler has a hack for Korean IME which was implemented by an ancient bug (forgot the bug #).

Maybe, it's bug 12253. The original code was landed for the bug and bug 17710 and bug 18286.
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsWindow.cpp&branch=&root=/cvsroot&subdir=mozilla/widget/src/windows&command=DIFF_FRAMESET&rev1=3.218&rev2=3.219
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Attached patch PatchSplinter Review
Attachment #594714 - Flags: review?(VYV03354)
Comment on attachment 594714 [details] [diff] [review]
Patch

> +  if (::PeekMessageW(&compositionMsg, aWindow->GetWindowHandle(),
> +                     WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION,
> +                     PM_NOREMOVE) &&
> +      compositionMsg.message == WM_IME_COMPOSITION) {
Please also test |IS_COMMITTING_LPARAM(compositionMsg.lParam)|.
r=me with this.
Attachment #594714 - Flags: review?(VYV03354) → review+
Thank you!

https://hg.mozilla.org/integration/mozilla-inbound/rev/27e074645887
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/27e074645887
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.