Bug 474389. Fix the 'set up editor after this load' setup, which hasn't really
worked for a while, except for initial loads in the window. r+sr=peterv, a=dveditz git-svn-id: svn://10.0.0.236/trunk@255948 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -5355,21 +5355,24 @@ nsDocShell::ReattachEditorToWindow(nsISHEntry *aSHEntry)
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::DetachEditorFromWindow(nsISHEntry *aSHEntry)
|
||||
nsDocShell::DetachEditorFromWindow()
|
||||
{
|
||||
if (!mEditorData)
|
||||
if (!mEditorData || mEditorData->WaitingForLoad()) {
|
||||
// If there's nothing to detach, or if the editor data is actually set
|
||||
// up for the _new_ page that's coming in, don't detach.
|
||||
return;
|
||||
}
|
||||
|
||||
NS_ASSERTION(!aSHEntry || !aSHEntry->HasDetachedEditor(),
|
||||
NS_ASSERTION(!mOSHE || !mOSHE->HasDetachedEditor(),
|
||||
"Detaching editor when it's already detached.");
|
||||
|
||||
nsresult res = mEditorData->DetachFromWindow();
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Failed to detach editor");
|
||||
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Make aSHEntry hold the owning ref to the editor data.
|
||||
if (aSHEntry)
|
||||
aSHEntry->SetEditorData(mEditorData.forget());
|
||||
// Make mOSHE hold the owning ref to the editor data.
|
||||
if (mOSHE)
|
||||
mOSHE->SetEditorData(mEditorData.forget());
|
||||
else
|
||||
mEditorData = nsnull;
|
||||
}
|
||||
@@ -5382,13 +5385,6 @@ nsDocShell::DetachEditorFromWindow(nsISHEntry *aSHEntry)
|
||||
"Window is still editable after detaching editor.");
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::DetachEditorFromWindow()
|
||||
{
|
||||
DetachEditorFromWindow(mOSHE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
||||
Reference in New Issue
Block a user