Fix for bug 633738 (quora.com bloats out of control (part 3)) - make nsHTMLEditor participate in CC, clear editor from SHistory if we're not storing anything else. r=jst, a=jst.

This commit is contained in:
Peter Van der Beken
2011-02-16 13:07:47 +01:00
parent 57a72909c5
commit a60d82ce27
7 changed files with 81 additions and 5 deletions

View File

@@ -7081,6 +7081,11 @@ nsDocShell::RestoreFromHistory()
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
viewer->SetPreviousViewer(mContentViewer);
}
if (mOSHE && (!mContentViewer || !mSavingOldViewer)) {
// We don't plan to save a viewer in mOSHE; tell it to drop
// any other state it's holding.
mOSHE->SyncPresentationState();
}
// Order the mContentViewer setup just like Embed does.
mContentViewer = nsnull;
@@ -7698,9 +7703,14 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
aNewViewer->SetPreviousViewer(mContentViewer);
mContentViewer = nsnull;
}
if (mOSHE && (!mContentViewer || !mSavingOldViewer)) {
// We don't plan to save a viewer in mOSHE; tell it to drop
// any other state it's holding.
mOSHE->SyncPresentationState();
}
mContentViewer = nsnull;
// Now that we're about to switch documents, forget all of our children.
// Note that we cached them as needed up in CaptureState above.