Page MenuHomePhabricator

VisualEditor: cursor places itself after the first character when inserting a group of Japanese characters
Closed, ResolvedPublic

Description

When you edit captions and input Japanese text with Japanese input method (of ことえり, the default Japanese method of Mac OS X), for example 生醤油 (kijouyu), the cursor will place itself after the first character, but it should place itself after the last (3rd) character. Tested on Firefox and OSX, but may happen in other browsers and operating systems. Thanks to Takashi Ota and Josh Lim for testing and reporting.


Version: unspecified
Severity: major

Details

Reference
bz52716

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:05 AM
bzimport set Reference to bz52716.

Now I tested it myself on Fedora 18 with Firefox. It happens there too. To reproduce:

  1. Enabled the "Japanese (Anthy)" keyboard in GNOME input sources.
  2. In a VisualEditor window type "mitsubishi". It appears as four Kana characters: "みつびし".
  3. Press the space bar. The four characters change to two Kanji characters: "三菱".
  4. Press Enter. This accepts the Kanji representation.

Observed: The cursor is placed between 三 and 菱.
Expected: The cursor should be placed after 三菱. That is what happens in other text editors on my system.

This seems to be caused by a call to surfaceObserver.stop() in Surface's onDocumentKeyDown method, which is wrongly asynchronous. The same problem was affecting Malayalam and probably other scripts/IMEs too.

I *think* it should be fixed by https://gerrit.wikimedia.org/r/#/c/79451 (just merged).

Doesn't seem to be happening any more.

Patch has been reverted due to other issues, sadly.

Change 80080 had a related patch set uploaded by Jforrester:
WIP:Don't emit Surface changes back to the Surface

https://gerrit.wikimedia.org/r/80080

Change 80080 merged by jenkins-bot:
Don't emit Surface changes back to the Surface

https://gerrit.wikimedia.org/r/80080

Given that this is now merged, I'm going to mark this as fixed. However, this is provisional - please re-open if you think that this has not worked!