fix for 67847: forward delete can make caret go to start of doc. r=kin; sr=sfraser; a=asa

git-svn-id: svn://10.0.0.236/trunk@96972 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jfrancis%netscape.com
2001-06-12 22:21:12 +00:00
parent 389a7b7bee
commit 0ed7094afa
4 changed files with 10 additions and 18 deletions

View File

@@ -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<nsIDOMNode> leftParent;
nsCOMPtr<nsIDOMNode> 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<nsIDOMNode> leftBlockParent;