Bug 1297414 - Send eTypedBR in plaintext mode too; r=masayuki
This is what test_htmleditor_keyevent_handling.html expects. It
historically made no difference in the case tested there, because we
inserted a <br> either way, but now it will make a difference. I don't
know what an HTML editor in plaintext mode even means, so I don't know
if this change is actually the intended behavior.
MozReview-Commit-ID: 64w6bb9Q1pD
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -672,17 +672,17 @@ HTMLEditor::HandleKeyPressEvent(WidgetKe
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
}
case NS_VK_RETURN:
if (aKeyboardEvent->IsControl() || aKeyboardEvent->IsAlt() ||
aKeyboardEvent->IsMeta() || aKeyboardEvent->IsOS()) {
return NS_OK;
}
aKeyboardEvent->PreventDefault(); // consumed
- if (aKeyboardEvent->IsShift() && !IsPlaintextEditor()) {
+ if (aKeyboardEvent->IsShift()) {
// only inserts a br node
return TypedText(EmptyString(), eTypedBR);
}
// uses rules to figure out what to insert
return TypedText(EmptyString(), eTypedBreak);
}
// NOTE: On some keyboard layout, some characters are inputted with Control