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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user