Bug 418470 Go to line in View Source broken (NS_ERROR_UNEXPECTED at nsISelectionController.scrollSelectionIntoView) (retry) r+sr=roc, a1.9b4=beltzner

git-svn-id: svn://10.0.0.236/trunk@246727 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
masayuki%d-toybox.com
2008-02-28 15:28:40 +00:00
parent a0962f9ccd
commit 1b098bf39a
17 changed files with 100 additions and 7 deletions

View File

@@ -1439,6 +1439,9 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable
}
// Try to scroll the selection into view if the paste/drop succeeded
// After ScrollSelectionIntoView(), the pending notifications might be
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
if (NS_SUCCEEDED(rv))
ScrollSelectionIntoView(PR_FALSE);
@@ -1667,6 +1670,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
if (!nsEditorHookUtils::DoInsertionHook(domdoc, aDropEvent, trans))
return NS_OK;
// Beware! This may flush notifications via synchronous
// ScrollSelectionIntoView.
rv = InsertFromTransferable(trans, srcdomdoc, contextStr, infoStr,
newSelectionParent,
newSelectionOffset, deleteSelection);
@@ -1887,6 +1892,8 @@ NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType)
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, trans))
return NS_OK;
// Beware! This may flush notifications via synchronous
// ScrollSelectionIntoView.
rv = InsertFromTransferable(trans, nsnull, contextStr, infoStr,
nsnull, 0, PR_TRUE);
}
@@ -1918,6 +1925,8 @@ NS_IMETHODIMP nsHTMLEditor::PasteNoFormatting(PRInt32 aSelectionType)
if (NS_SUCCEEDED(clipboard->GetData(trans, aSelectionType)) && IsModifiable())
{
const nsAFlatString& empty = EmptyString();
// Beware! This may flush notifications via synchronous
// ScrollSelectionIntoView.
rv = InsertFromTransferable(trans, nsnull, empty, empty, nsnull, 0,
PR_TRUE);
}