Stop null-checking the pres shell so that we get to the UnbindFromTree call in nsHTMLEditor::DeleteRefToAnonymousNode. (Bug 563980) r=ehsan
authorL. David Baron <dbaron@dbaron.org>
Wed, 05 May 2010 18:20:43 -0700
changeset 41949 41ffa62580c41454df662d6b72cc96973ace9a6b
parent 41948 bf3601e527a4b6a2937ed973627b1a4840aaee81
child 41950 c7cb1779aad553d522fb2e6b3faefae2012b46dc
push id13154
push userdbaron@mozilla.com
push dateThu, 06 May 2010 01:20:59 +0000
treeherdermozilla-central@41ffa62580c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs563980
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Stop null-checking the pres shell so that we get to the UnbindFromTree call in nsHTMLEditor::DeleteRefToAnonymousNode. (Bug 563980) r=ehsan
editor/libeditor/html/nsHTMLAbsPosition.cpp
editor/libeditor/html/nsHTMLInlineTableEditor.cpp
editor/libeditor/html/nsHTMLObjectResizer.cpp
--- a/editor/libeditor/html/nsHTMLAbsPosition.cpp
+++ b/editor/libeditor/html/nsHTMLAbsPosition.cpp
@@ -308,17 +308,19 @@ nsHTMLEditor::HideGrabber()
     mAbsolutelyPositionedObject->RemoveAttribute(NS_LITERAL_STRING("_moz_abspos"));
   if (NS_FAILED(res)) return res;
 
   mAbsolutelyPositionedObject = nsnull;
   NS_ENSURE_TRUE(mGrabber, NS_ERROR_NULL_POINTER);
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  // We allow the pres shell to be null; when it is, we presume there
+  // are no document observers to notify, but we still want to
+  // UnbindFromTree.
 
   nsCOMPtr<nsIDOMNode> parentNode;
   res = mGrabber->GetParentNode(getter_AddRefs(parentNode));
   NS_ENSURE_SUCCESS(res, res);
 
   nsCOMPtr<nsIContent> parentContent = do_QueryInterface(parentNode);
   if (!parentContent) return NS_ERROR_NULL_POINTER;
 
--- a/editor/libeditor/html/nsHTMLInlineTableEditor.cpp
+++ b/editor/libeditor/html/nsHTMLInlineTableEditor.cpp
@@ -120,17 +120,19 @@ nsHTMLEditor::HideInlineTableEditingUI()
   RemoveMouseClickListener(mRemoveColumnButton);
   RemoveMouseClickListener(mAddColumnAfterButton);
   RemoveMouseClickListener(mAddRowBeforeButton);
   RemoveMouseClickListener(mRemoveRowButton);
   RemoveMouseClickListener(mAddRowAfterButton);
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  // We allow the pres shell to be null; when it is, we presume there
+  // are no document observers to notify, but we still want to
+  // UnbindFromTree.
 
   // get the root content node.
 
   nsIDOMElement *bodyElement = GetRoot();
 
   nsCOMPtr<nsIContent> bodyContent( do_QueryInterface(bodyElement) );
   if (!bodyContent) return NS_ERROR_FAILURE;
 
--- a/editor/libeditor/html/nsHTMLObjectResizer.cpp
+++ b/editor/libeditor/html/nsHTMLObjectResizer.cpp
@@ -434,17 +434,19 @@ nsHTMLEditor::ShowResizersInner(nsIDOMEl
 NS_IMETHODIMP 
 nsHTMLEditor::HideResizers(void)
 {
   if (!mResizedObject)
     return NS_OK;
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  // We allow the pres shell to be null; when it is, we presume there
+  // are no document observers to notify, but we still want to
+  // UnbindFromTree.
 
   nsresult res;
   nsCOMPtr<nsIDOMNode> parentNode;
   nsCOMPtr<nsIContent> parentContent;
 
   if (mTopLeftHandle) {
     res = mTopLeftHandle->GetParentNode(getter_AddRefs(parentNode));
     NS_ENSURE_SUCCESS(res, res);