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

This commit is contained in:
Wolfgang Germund 2011-06-24 13:55:43 -04:00
parent d8ff7b62b9
commit db7ef51c94

View File

@ -168,11 +168,6 @@ nsHTMLEditor::~nsHTMLEditor()
// free any default style propItems
RemoveAllDefaultProperties();
while (mStyleSheetURLs.Length())
{
RemoveOverrideStyleSheet(mStyleSheetURLs[0]);
}
if (mLinkHandler && mDocWeak)
{
nsCOMPtr<nsIPresShell> ps = GetPresShell();
@ -359,6 +354,11 @@ nsHTMLEditor::PreDestroy(PRBool aDestroyingFrames)
document->RemoveMutationObserver(this);
}
while (mStyleSheetURLs.Length())
{
RemoveOverrideStyleSheet(mStyleSheetURLs[0]);
}
return nsPlaintextEditor::PreDestroy(aDestroyingFrames);
}