Bug 635420 - Clicking on content within Normal tab of Composer and stops switching to other tabs; r=ehsan a=bsmedberg
authorNeil Rashbrook <neil@httl.net>
Mon, 28 Feb 2011 13:04:05 -0800
changeset 63178 7fbcd2458b9ee583fc13c07ca847e2a44ca0239c
parent 63177 621e26f425427b029755ad03cc139373d743bc4d
child 63179 f787a45488268c0392e8e71b7c32b275115c96f9
push id19059
push usereakhgari@mozilla.com
push dateMon, 28 Feb 2011 21:16:17 +0000
treeherdermozilla-central@f787a4548826 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, bsmedberg
bugs635420
milestone2.0b13pre
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 635420 - Clicking on content within Normal tab of Composer and stops switching to other tabs; r=ehsan a=bsmedberg
editor/composer/src/nsEditingSession.cpp
editor/libeditor/base/nsEditor.cpp
--- a/editor/composer/src/nsEditingSession.cpp
+++ b/editor/composer/src/nsEditingSession.cpp
@@ -448,17 +448,19 @@ nsEditingSession::SetupEditorOnWindow(ns
   }
 
   // create and set editor
   nsCOMPtr<nsIEditorDocShell> editorDocShell = do_QueryInterface(docShell, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Try to reuse an existing editor
   nsCOMPtr<nsIEditor> editor = do_QueryReferent(mExistingEditor);
-  if (!editor) {
+  if (editor) {
+    editor->PreDestroy(PR_FALSE);
+  } else {
     editor = do_CreateInstance(classString, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     mExistingEditor = do_GetWeakReference(editor);
   }
   // set the editor on the docShell. The docShell now owns it.
   rv = editorDocShell->SetEditor(editor);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -435,16 +435,17 @@ nsEditor::PreDestroy(PRBool aDestroyingF
   NotifyDocumentListeners(eDocumentToBeDestroyed);
 
   // Unregister event listeners
   RemoveEventListeners();
   mActionListeners.Clear();
   mEditorObservers.Clear();
   mDocStateListeners.Clear();
   mInlineSpellChecker = nsnull;
+  mRootElement = nsnull;
 
   mDidPreDestroy = PR_TRUE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsEditor::GetFlags(PRUint32 *aFlags)
 {