diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 09:08:27 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 09:08:27 +0000 |
commit | 36ea7c1641a31a9fd63e5fd9cefbee01ba6e3d49 (patch) | |
tree | ac5a0e3b30ec07c4dd9503667927255e161f3ffd | |
parent | 61723e227e64ea66b52912c4cf4b72c867ed1b7f (diff) | |
download | chromium_src-36ea7c1641a31a9fd63e5fd9cefbee01ba6e3d49.zip chromium_src-36ea7c1641a31a9fd63e5fd9cefbee01ba6e3d49.tar.gz chromium_src-36ea7c1641a31a9fd63e5fd9cefbee01ba6e3d49.tar.bz2 |
A dirty workaround for facebook.
Facebook deletes whitespace characters, including U+3000 (Ideographic Space) used by Traditional-Chinese IMEs as a place-holder, at the beginning of a comment box before WebKit replaces the place-holder with a Traditional-Chinese character. This prevents us from inputing characters with Tranditional-Chinese IMEs. As a workaround, this change just replaces U+3000 at the beginning of composition text with U+FF3F (Fullwidth Low Line), a place-holder character used by Japanese IMEs. (Fortunately, facebook does not delete it.)
BUG=45396
TEST=Open www.facebook.com, type text with Traditional Chinese IMEs in its comment box.
Review URL: http://codereview.chromium.org/2771008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ime_input.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/ime_input.cc b/chrome/browser/ime_input.cc index 3f60670..7897a66 100644 --- a/chrome/browser/ime_input.cc +++ b/chrome/browser/ime_input.cc @@ -275,6 +275,19 @@ bool ImeInput::GetComposition(HWND window_handle, LPARAM lparam, // Copy the composition string to the ImeComposition object. result = GetString(imm_context, lparam, GCS_COMPSTR, composition); + // This is a dirty workaround for facebook. Facebook deletes the placeholder + // character (U+3000) used by Traditional-Chinese IMEs at the beginning of + // composition text. This prevents WebKit from replacing this placeholder + // character with a Traditional-Chinese character, i.e. we cannot input any + // characters in a comment box of facebook with Traditional-Chinese IMEs. + // As a workaround, we replace U+3000 at the beginning of composition text + // with U+FF3F, a placeholder character used by Japanese IMEs. + if (input_language_id_ == MAKELANGID(LANG_CHINESE, + SUBLANG_CHINESE_TRADITIONAL) && + composition->ime_string[0] == 0x3000) { + composition->ime_string[0] = 0xFF3F; + } + // Retrieve the cursor position in the IME composition. int cursor_position = ::ImmGetCompositionString(imm_context, GCS_CURSORPOS, NULL, 0); |