From ebcf3d0ac2470d51a8b56298358523f28b8bc650 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 19 Feb 2011 21:43:07 -0800 Subject: [PATCH] Bug 635532 - Don't try to hide the editor anonymous UIs during the cycle collection unlink phase needlessly. r=roc,jst, a=blocker --- editor/libeditor/html/nsHTMLEditor.cpp | 25 +++++++++++++------------ editor/libeditor/html/nsHTMLEditor.h | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index cf06530bf771..f88315f731cc 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -170,13 +170,7 @@ nsHTMLEditor::~nsHTMLEditor() // Clean up after our anonymous content -- we don't want these nodes to // stay around (which they would, since the frames have an owning reference). - - if (mAbsolutelyPositionedObject) - HideGrabber(); - if (mInlineEditedCell) - HideInlineTableEditingUI(); - if (mResizedObject) - HideResizers(); + HideAnonymousEditingUIs(); //the autopointers will clear themselves up. //but we need to also remove the listeners or we have a leak @@ -223,6 +217,17 @@ nsHTMLEditor::~nsHTMLEditor() RemoveEventListeners(); } +void +nsHTMLEditor::HideAnonymousEditingUIs() +{ + if (mAbsolutelyPositionedObject) + HideGrabber(); + if (mInlineEditedCell) + HideInlineTableEditingUI(); + if (mResizedObject) + HideResizers(); +} + /* static */ void nsHTMLEditor::Shutdown() @@ -236,11 +241,7 @@ 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(); + tmp->HideAnonymousEditingUIs(); NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor) diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h index 75242bd80481..06adac7ab07d 100644 --- a/editor/libeditor/html/nsHTMLEditor.h +++ b/editor/libeditor/html/nsHTMLEditor.h @@ -929,6 +929,7 @@ protected: void SetFinalSize(PRInt32 aX, PRInt32 aY); void DeleteRefToAnonymousNode(nsIDOMNode * aNode); void SetResizeIncrements(PRInt32 aX, PRInt32 aY, PRInt32 aW, PRInt32 aH, PRBool aPreserveRatio); + void HideAnonymousEditingUIs(); /* ABSOLUTE POSITIONING */