Bug 570455 Editor shouldn't do anything when ESC key is pressed because bug 471322 was marked as WONTFIX r=ehsan

This commit is contained in:
Masayuki Nakano 2010-06-17 14:25:20 +09:00
Родитель 2d93973c4f
Коммит 3e1338dc82
4 изменённых файлов: 5 добавлений и 20 удалений

Просмотреть файл

@ -554,12 +554,6 @@ nsHTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
// These keys are handled on nsEditor, so, we can bypass
// nsPlaintextEditor.
return nsEditor::HandleKeyPressEvent(aKeyEvent);
case nsIDOMKeyEvent::DOM_VK_ESCAPE:
// XXX nsPlaintextEditor doesn't consume the event by bug 569988,
// but nsHTMLEditor should eat the processed keypress event.
aKeyEvent->PreventDefault();
// This key is handled on nsPlaintextEditor.
return nsPlaintextEditor::HandleKeyPressEvent(aKeyEvent);
case nsIDOMKeyEvent::DOM_VK_TAB: {
if (IsPlaintextEditor()) {
// If this works as plain text editor, e.g., mail editor for plain

Просмотреть файл

@ -566,23 +566,23 @@ function runTests()
// In all cases, esc key events are not consumed
reset("abc");
synthesizeKey("VK_ESCAPE", { });
check(aDescription + "Esc", true, false, true, !aIsReadonly);
check(aDescription + "Esc", true, false, true, false);
reset("abc");
synthesizeKey("VK_ESCAPE", { shiftKey: true });
check(aDescription + "Shift+Esc", true, false, true, !aIsReadonly);
check(aDescription + "Shift+Esc", true, false, true, false);
reset("abc");
synthesizeKey("VK_ESCAPE", { ctrlKey: true });
check(aDescription + "Ctrl+Esc", true, false, true, !aIsReadonly);
check(aDescription + "Ctrl+Esc", true, false, true, false);
reset("abc");
synthesizeKey("VK_ESCAPE", { altKey: true });
check(aDescription + "Alt+Esc", true, false, true, !aIsReadonly);
check(aDescription + "Alt+Esc", true, false, true, false);
reset("abc");
synthesizeKey("VK_ESCAPE", { metaKey: true });
check(aDescription + "Meta+Esc", true, false, true, !aIsReadonly);
check(aDescription + "Meta+Esc", true, false, true, false);
// typical typing tests:
reset("");

Просмотреть файл

@ -405,13 +405,6 @@ nsPlaintextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
}
aKeyEvent->PreventDefault();
return TypedText(EmptyString(), eTypedBreak);
case nsIDOMKeyEvent::DOM_VK_ESCAPE:
// pass escape keypresses through as empty strings: needed for IME support
// XXX This might be broken, we should check the behavior, see bug 471322.
// XXX Even if this keypress event is handled, this doesn't consume the
// event. This is wrong behavior but we have serious problem,
// see bug 569988 and 570455.
return TypedText(EmptyString(), eTypedText);
}
// NOTE: On some keyboard layout, some characters are inputted with Control

Просмотреть файл

@ -318,8 +318,6 @@ function runTests()
// Esc key:
// In all cases, esc key events are not consumed
// XXX ESC key events should be consumed when it's handled,
// however, there is a serious problem, see bug 569988.
reset("abc");
synthesizeKey("VK_ESCAPE", { });
check(aDescription + "Esc", true, false, true, false);