Page MenuHomePhabricator

VisualEditor: Pressing Escape or Tab in an empty line inserts pawn symbol (♙) in Opera 12
Closed, ResolvedPublic

Description

Author: richlv

Description:
visual editor from git f8d56e6804a12248b485c2d3b49d4ff0ffa7220c

edit a page with opera 12.16 on linux, place cursor on an empty line, hit 'esc' -
symbol ♙ is inserted.

bug #51140 was about this symbol being inserted in a different situation and is supposed to be fixed.

reproducible at https://www.zabbix.org/wiki/Docs/visual_editor_test (if you would like to create a test account, "real name" is mandatory)


Version: unspecified
Severity: normal

Details

Reference
bz63630

Event Timeline

richlv wrote:

(1) another way to get that symbol with opera - hit 'tab' on an empty line.

both of these also "work" in an empty table cell

MatmaRex, you still interested in taking on Opera 12 bugs?

Yes. I don't have time right now, but I'll try to get around to this sooner or later.

So, Opera 12 sends the events for the keypresses of Esc and Tab. These events reach ve.ce.Surface.prototype.onDocumentKeyPress and eventually ve.ce.Surface.prototype.handleInsertion, which decides to insert the pawn, which will not be overwritten because neither Esc not Tab produce any text.

onDocumentKeyPress attempts to filter out non-character keypresses by discarding ones where the charCode is 0; Opera's event for Esc has charCode == 27,
for Tab charCode == 9. I guess other browsers use 0 here for some weird reason and you depend on this behavior.

This is probably a regression from 4e377629e39a4af9405a5ea8972bdeb1af37ddf6
(fix for bug 48335).

Seems like it wouldn't be a problem if you just filtered out those keycodes.

Change 143322 had a related patch set uploaded by Bartosz Dziewoński:
ve.ce.Surface: Prevent incorrect pawning in Opera 12

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

Change 143322 merged by jenkins-bot:
ve.ce.Surface: Prevent incorrect pawning in Opera 12

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