phabricator.wikimedia.org

⚓ T86589 After selecting table cell by single clicking, typing with any IME does not work

  • ️Mon Jan 12 2015

After selecting table cell by single clicking, typing with any IME does not work

Closed, ResolvedPublic8 Estimated Story Points

In order to reproduce just select any cell in any table in VisualEditor and start typing within IME. Input should appear inside the cell but instead it does not appear at all.

I investigated it a little bit: normally (not IME) when user starts typing method handleInsertion is called (via keypress handler) and that method change table cell selection to text selection but for IME input it does not happen (because there is no keypress).

Event Timeline

Inez raised the priority of this task from to Needs Triage.

Jdforrester-WMF renamed this task from After selecting table cell by single clicking typing with IME (any IME) does not work to After selecting table cell by single clicking, typing with any IME does not work.Jan 13 2015, 1:52 AM

Comment Actions

Inez, now that we've fixed some timing issues I think this solution may be safe - I'll experiment.

Comment Actions

Hah, contrary to my prediction, with this change I can consistently *segfault* Firefox on Ubuntu by clicking a table cell and typing a backtick (which in the UK extended keyboard layout is produced by pressing a deadkey twice, the second press of which causes a compositionstart event). I'll investigate further but I thought this was too good not to share :-)

Comment Actions

The crashing behaviour seems similar to this minimal test case http://jsfiddle.net/s1ryfmp5/ .

That jsfiddle uses an alert, but something in our code is producing the same effect. It seems IME-sensitive: it's crashing for me on Ubuntu 15.10 but not for @Esanders on Ubuntu 14.04 . Continuing to investigate (and will fire upstream bugs as appropriate when done).

Comment Actions

It seems there's a problem specific to IME listeners in Firefox:

  1. An alert() in a compositionstart listener triggers an immediate compositionend (and then segfaults when the dialog is closed).
  2. An alert() in a compositionend listener unblocks keyboard events (including those caused by subsequent keystrokes).

I still don't know what VE is doing that's analogous to the minimal test case's alert() calls, but I suspect it's to do with changing the selection.

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits