зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
536c4678f1
Коммит
c4aeb00d0d
|
@ -375,6 +375,15 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULElement,
|
||||||
nsStyledElement)
|
nsStyledElement)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mPrototype,
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mPrototype,
|
||||||
nsXULPrototypeElement)
|
nsXULPrototypeElement)
|
||||||
|
{
|
||||||
|
nsXULSlots* slots = static_cast<nsXULSlots*>(tmp->GetExistingSlots());
|
||||||
|
if (slots) {
|
||||||
|
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameLoader");
|
||||||
|
nsISupports *frameLoader =
|
||||||
|
static_cast<nsIFrameLoader*>(slots->mFrameLoader);
|
||||||
|
cb.NoteXPCOMChild(frameLoader);
|
||||||
|
}
|
||||||
|
}
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(nsXULElement, nsStyledElement)
|
NS_IMPL_ADDREF_INHERITED(nsXULElement, nsStyledElement)
|
||||||
|
|
|
@ -7081,6 +7081,11 @@ nsDocShell::RestoreFromHistory()
|
||||||
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
|
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
|
||||||
viewer->SetPreviousViewer(mContentViewer);
|
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.
|
// Order the mContentViewer setup just like Embed does.
|
||||||
mContentViewer = nsnull;
|
mContentViewer = nsnull;
|
||||||
|
@ -7698,9 +7703,14 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
|
||||||
|
|
||||||
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
|
mContentViewer->Close(mSavingOldViewer ? mOSHE.get() : nsnull);
|
||||||
aNewViewer->SetPreviousViewer(mContentViewer);
|
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.
|
// Now that we're about to switch documents, forget all of our children.
|
||||||
// Note that we cached them as needed up in CaptureState above.
|
// Note that we cached them as needed up in CaptureState above.
|
||||||
|
|
|
@ -763,6 +763,7 @@ nsSHEntry::DropPresentationState()
|
||||||
mViewerBounds.SetRect(0, 0, 0, 0);
|
mViewerBounds.SetRect(0, 0, 0, 0);
|
||||||
mChildShells.Clear();
|
mChildShells.Clear();
|
||||||
mRefreshURIList = nsnull;
|
mRefreshURIList = nsnull;
|
||||||
|
mEditorData = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -44,7 +44,13 @@
|
||||||
* XPCOM cruft
|
* XPCOM cruft
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(TypeInState, nsISelectionListener)
|
NS_IMPL_CYCLE_COLLECTION_1(TypeInState, mLastSelectionContainer)
|
||||||
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(TypeInState)
|
||||||
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(TypeInState)
|
||||||
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TypeInState)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsISelectionListener)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||||
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
* public methods
|
* public methods
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "nsEditProperty.h"
|
#include "nsEditProperty.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
|
#include "nsCycleCollectionParticipant.h"
|
||||||
|
|
||||||
struct PropItem
|
struct PropItem
|
||||||
{
|
{
|
||||||
|
@ -61,7 +62,8 @@ class TypeInState : public nsISelectionListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||||
|
NS_DECL_CYCLE_COLLECTION_CLASS(TypeInState)
|
||||||
|
|
||||||
TypeInState();
|
TypeInState();
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
|
@ -230,10 +230,57 @@ nsHTMLEditor::Shutdown()
|
||||||
NS_IF_RELEASE(sRangeHelper);
|
NS_IF_RELEASE(sRangeHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLEditor)
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTypeInState)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTextServices)
|
||||||
|
|
||||||
|
tmp->HideResizers();
|
||||||
|
|
||||||
|
tmp->HideGrabber();
|
||||||
|
|
||||||
|
tmp->HideInlineTableEditingUI();
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTypeInState)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTextServices)
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopLeftHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopRightHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLeftHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRightHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomLeftHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomRightHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mActivatedHandle)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizingShadow)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizingInfo)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizedObject)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mMouseMotionListenerP)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSelectionListenerP)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizeEventListenerP)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(objectResizeEventListeners)
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAbsolutelyPositionedObject)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mGrabber)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPositioningShadow)
|
||||||
|
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInlineEditedCell)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAddColumnBeforeButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRemoveColumnButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAddColumnAfterButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAddRowBeforeButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRemoveRowButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAddRowAfterButton)
|
||||||
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(nsHTMLEditor, nsEditor)
|
NS_IMPL_ADDREF_INHERITED(nsHTMLEditor, nsEditor)
|
||||||
NS_IMPL_RELEASE_INHERITED(nsHTMLEditor, nsEditor)
|
NS_IMPL_RELEASE_INHERITED(nsHTMLEditor, nsEditor)
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(nsHTMLEditor)
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsHTMLEditor)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor)
|
NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor_MOZILLA_2_0_BRANCH)
|
NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor_MOZILLA_2_0_BRANCH)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIHTMLObjectResizer)
|
NS_INTERFACE_MAP_ENTRY(nsIHTMLObjectResizer)
|
||||||
|
|
|
@ -141,6 +141,7 @@ public:
|
||||||
//NOTE macro used is for classes that inherit from
|
//NOTE macro used is for classes that inherit from
|
||||||
// another class. Only the base class should use NS_DECL_ISUPPORTS
|
// another class. Only the base class should use NS_DECL_ISUPPORTS
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLEditor, nsPlaintextEditor)
|
||||||
|
|
||||||
|
|
||||||
nsHTMLEditor();
|
nsHTMLEditor();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче