Bug 635532 - Don't try to hide the editor anonymous UIs during the cycle collection unlink phase needlessly. r=roc,jst, a=blocker
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 19 Feb 2011 21:43:07 -0800
changeset 62878 12056f3beaf22a5ce2b23a171d61c02c7461ab65
parent 62877 4f8d5b10e4ef8046b35275c642ec9c72d5fa4552
child 62879 e77f4eda0bad4081f5387acc1bc321b81ca2f4f4
push id18928
push userjst@mozilla.com
push dateSun, 20 Feb 2011 06:19:51 +0000
treeherdermozilla-central@12056f3beaf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, jst, blocker
bugs635532
milestone2.0b12pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
editor/libeditor/html/nsHTMLEditor.h
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -165,23 +165,17 @@ nsHTMLEditor::~nsHTMLEditor()
   // remove the rules as an action listener.  Else we get a bad
   // ownership loop later on.  it's ok if the rules aren't a listener;
   // we ignore the error.
   nsCOMPtr<nsIEditActionListener> mListener = do_QueryInterface(mRules);
   RemoveEditActionListener(mListener);
   
   // 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
   nsCOMPtr<nsISelection>selection;
   nsresult result = GetSelection(getter_AddRefs(selection));
   // if we don't get the selection, just skip this
   if (NS_SUCCEEDED(result) && selection) 
   {
@@ -218,34 +212,41 @@ nsHTMLEditor::~nsHTMLEditor()
     {
       ps->GetPresContext()->SetLinkHandler(mLinkHandler);
     }
   }
 
   RemoveEventListeners();
 }
 
+void
+nsHTMLEditor::HideAnonymousEditingUIs()
+{
+  if (mAbsolutelyPositionedObject)
+    HideGrabber();
+  if (mInlineEditedCell)
+    HideInlineTableEditingUI();
+  if (mResizedObject)
+    HideResizers();
+}
+
 /* static */
 void
 nsHTMLEditor::Shutdown()
 {
   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();
+  tmp->HideAnonymousEditingUIs();
 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)
--- a/editor/libeditor/html/nsHTMLEditor.h
+++ b/editor/libeditor/html/nsHTMLEditor.h
@@ -924,16 +924,17 @@ protected:
   PRInt32  GetNewResizingX(PRInt32 aX, PRInt32 aY);
   PRInt32  GetNewResizingY(PRInt32 aX, PRInt32 aY);
   PRInt32  GetNewResizingWidth(PRInt32 aX, PRInt32 aY);
   PRInt32  GetNewResizingHeight(PRInt32 aX, PRInt32 aY);
   void     HideShadowAndInfo();
   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 */
 
   PRInt32 mPositionedObjectX;
   PRInt32 mPositionedObjectY;
   PRInt32 mPositionedObjectWidth;
   PRInt32 mPositionedObjectHeight;