From 847752121a2d4b2c14ddcffa15c09e8a3abdc4dd Mon Sep 17 00:00:00 2001 From: "jst%mozilla.jstenback.com" Date: Tue, 22 Mar 2005 04:33:17 +0000 Subject: [PATCH] Fixing bug 285741. Only ever re-enable scripts n' plugins etc for midas. r=brade@comcast.net, sr=bzbarsky@mit.edu git-svn-id: svn://10.0.0.236/trunk@170969 18797224-902f-48f8-a5cc-f745e15eee43 --- .../editor/composer/src/nsEditingSession.cpp | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/mozilla/editor/composer/src/nsEditingSession.cpp b/mozilla/editor/composer/src/nsEditingSession.cpp index 5214a529a67..856a5463b8c 100644 --- a/mozilla/editor/composer/src/nsEditingSession.cpp +++ b/mozilla/editor/composer/src/nsEditingSession.cpp @@ -507,13 +507,16 @@ nsEditingSession::TearDownEditorOnWindow(nsIDOMWindow *aWindow) aWindow->GetDocument(getter_AddRefs(dom_doc)); nsCOMPtr html_doc(do_QueryInterface(dom_doc)); - nsAutoString designMode; + PRBool isMidas = PR_FALSE; if (html_doc) { + nsAutoString designMode; html_doc->GetDesignMode(designMode); + + isMidas = designMode.EqualsLiteral("on"); } - if (designMode.EqualsLiteral("on")) { + if (isMidas) { // We're tearing down a midas editor, unregister callbacks since // we're all done editing here. @@ -621,18 +624,20 @@ nsEditingSession::TearDownEditorOnWindow(nsIDOMWindow *aWindow) mHTMLCommandControllerId = 0; } - // Make things the way they were before we started editing. - if (mScriptsEnabled) { - docShell->SetAllowJavascript(PR_TRUE); - } + if (isMidas) { + // Make things the way they were before we started editing. + if (mScriptsEnabled) { + docShell->SetAllowJavascript(PR_TRUE); + } - if (mPluginsEnabled) { - docShell->SetAllowPlugins(PR_TRUE); - } + if (mPluginsEnabled) { + docShell->SetAllowPlugins(PR_TRUE); + } - nsCOMPtr utils(do_GetInterface(aWindow)); - if (utils) - utils->SetImageAnimationMode(mImageAnimationMode); + nsCOMPtr utils(do_GetInterface(aWindow)); + if (utils) + utils->SetImageAnimationMode(mImageAnimationMode); + } return rv; }