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
This commit is contained in:
jst%mozilla.jstenback.com
2005-03-22 04:33:17 +00:00
parent 72af904fb2
commit 847752121a

View File

@@ -507,13 +507,16 @@ nsEditingSession::TearDownEditorOnWindow(nsIDOMWindow *aWindow)
aWindow->GetDocument(getter_AddRefs(dom_doc));
nsCOMPtr<nsIDOMNSHTMLDocument> 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<nsIDOMWindowUtils> utils(do_GetInterface(aWindow));
if (utils)
utils->SetImageAnimationMode(mImageAnimationMode);
nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(aWindow));
if (utils)
utils->SetImageAnimationMode(mImageAnimationMode);
}
return rv;
}