diff --git a/mozilla/editor/base/nsHTMLEditRules.cpp b/mozilla/editor/base/nsHTMLEditRules.cpp index ecab0c425a5..c8b90f6fe71 100644 --- a/mozilla/editor/base/nsHTMLEditRules.cpp +++ b/mozilla/editor/base/nsHTMLEditRules.cpp @@ -1839,10 +1839,6 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection, if (endNode.get() != startNode.get()) { // block parents the same? use default deletion - if (mHTMLEditor->HasSameBlockNodeParent(startNode, endNode)) return NS_OK; - - // deleting across blocks - // are the blocks of same type? nsCOMPtr leftParent; nsCOMPtr rightParent; if (IsBlockNode(startNode)) @@ -1853,6 +1849,10 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection, rightParent = endNode; else rightParent = mHTMLEditor->GetBlockNodeParent(endNode); + if (leftParent == rightParent) return NS_OK; + + // deleting across blocks + // are the blocks of same type? // are the blocks siblings? nsCOMPtr leftBlockParent; diff --git a/mozilla/editor/base/nsPlaintextEditor.cpp b/mozilla/editor/base/nsPlaintextEditor.cpp index 81c50141055..e78e0b34868 100644 --- a/mozilla/editor/base/nsPlaintextEditor.cpp +++ b/mozilla/editor/base/nsPlaintextEditor.cpp @@ -903,11 +903,7 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteSelection(nsIEditor::EDirection aAction) break; case eToEndOfLine: result = selCont->IntraLineMove(PR_TRUE, PR_TRUE); - // 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; + aAction = eNext; break; default: // avoid several compiler warnings result = NS_OK; diff --git a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp index ecab0c425a5..c8b90f6fe71 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp @@ -1839,10 +1839,6 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection, if (endNode.get() != startNode.get()) { // block parents the same? use default deletion - if (mHTMLEditor->HasSameBlockNodeParent(startNode, endNode)) return NS_OK; - - // deleting across blocks - // are the blocks of same type? nsCOMPtr leftParent; nsCOMPtr rightParent; if (IsBlockNode(startNode)) @@ -1853,6 +1849,10 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection, rightParent = endNode; else rightParent = mHTMLEditor->GetBlockNodeParent(endNode); + if (leftParent == rightParent) return NS_OK; + + // deleting across blocks + // are the blocks of same type? // are the blocks siblings? nsCOMPtr leftBlockParent; diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index 81c50141055..e78e0b34868 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -903,11 +903,7 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteSelection(nsIEditor::EDirection aAction) break; case eToEndOfLine: result = selCont->IntraLineMove(PR_TRUE, PR_TRUE); - // 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; + aAction = eNext; break; default: // avoid several compiler warnings result = NS_OK;