From db7ef51c94fb11d9b4cedc24e47d601b23ec69bd Mon Sep 17 00:00:00 2001 From: Wolfgang Germund Date: Fri, 24 Jun 2011 13:55:43 -0400 Subject: [PATCH] Bug 664095 - Remove the override stylesheets when the editor is detached from the document as opposed to when it's destroyed for compatibility with the expected behavior from Composer; r=ehsan --- editor/libeditor/html/nsHTMLEditor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index 0a16671b164..3f36166e9df 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -168,11 +168,6 @@ nsHTMLEditor::~nsHTMLEditor() // free any default style propItems RemoveAllDefaultProperties(); - while (mStyleSheetURLs.Length()) - { - RemoveOverrideStyleSheet(mStyleSheetURLs[0]); - } - if (mLinkHandler && mDocWeak) { nsCOMPtr ps = GetPresShell(); @@ -359,6 +354,11 @@ nsHTMLEditor::PreDestroy(PRBool aDestroyingFrames) document->RemoveMutationObserver(this); } + while (mStyleSheetURLs.Length()) + { + RemoveOverrideStyleSheet(mStyleSheetURLs[0]); + } + return nsPlaintextEditor::PreDestroy(aDestroyingFrames); }