The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla13

Status

()

Core
Widget: Win32
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({inputmethod})

Trunk
mozilla13
x86_64
Windows 7
inputmethod
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
> 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)

Updated

5 years ago
Blocks: 12253
(Assignee)

Updated

5 years ago
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
(Assignee)

Comment 2

5 years ago
Created attachment 594714 [details] [diff] [review]
Patch
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+
(Assignee)

Comment 4

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.