Bug 1297414 - Send eTypedBR in plaintext mode too; r=masayuki draft
authorAryeh Gregor <ayg@aryeh.name>
Thu, 25 Aug 2016 17:43:17 +0300
changeset 555022 7f4645dccf36a75675ce2e3175bcaa58927b7250
parent 555021 13d995869a2339c7be035e6e42d77cbff0620068
child 555023 5cbe45605913930ee01e7e98e9aab4e8b591f927
push id52128
push userbmo:ayg@aryeh.name
push dateMon, 03 Apr 2017 14:30:23 +0000
reviewersmasayuki
bugs1297414
milestone55.0a1
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
editor/libeditor/HTMLEditor.cpp
--- 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