diff --git a/editor/base/nsHTMLEditor.cpp b/editor/base/nsHTMLEditor.cpp
index 0b2ce1d0c0f..bad61d29a14 100644
--- a/editor/base/nsHTMLEditor.cpp
+++ b/editor/base/nsHTMLEditor.cpp
@@ -2340,7 +2340,11 @@ NS_IMETHODIMP nsHTMLEditor::DeleteSelection(nsIEditor::EDirection aAction)
break;
case eToEndOfLine:
result = selCont->IntraLineMove(PR_TRUE, PR_TRUE);
- aAction = eNext;
+ // Bugs 54449/54452: the selection jumps to the wrong place
+ // when deleting past a
and action is eNext or ePrev,
+ // so setting action to eNone makes delete-to-end marginally usable.
+ // aAction should really be set to eNext
+ aAction = eNone;
break;
default: // avoid several compiler warnings
result = NS_OK;
@@ -2477,7 +2481,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr
// Bad things happen if you insert returns (instead of dom newlines, \n)
// into an editor document.
nsAutoString inputString (aInputString); // hope this does copy-on-write
-
+
// Windows linebreaks: Map CRLF to LF:
inputString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"),
NS_ConvertASCIItoUCS2("\n"));
diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
index 0b2ce1d0c0f..bad61d29a14 100644
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -2340,7 +2340,11 @@ NS_IMETHODIMP nsHTMLEditor::DeleteSelection(nsIEditor::EDirection aAction)
break;
case eToEndOfLine:
result = selCont->IntraLineMove(PR_TRUE, PR_TRUE);
- aAction = eNext;
+ // Bugs 54449/54452: the selection jumps to the wrong place
+ // when deleting past a
and action is eNext or ePrev,
+ // so setting action to eNone makes delete-to-end marginally usable.
+ // aAction should really be set to eNext
+ aAction = eNone;
break;
default: // avoid several compiler warnings
result = NS_OK;
@@ -2477,7 +2481,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr
// Bad things happen if you insert returns (instead of dom newlines, \n)
// into an editor document.
nsAutoString inputString (aInputString); // hope this does copy-on-write
-
+
// Windows linebreaks: Map CRLF to LF:
inputString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"),
NS_ConvertASCIItoUCS2("\n"));