From 3516f0d8134825c40fe05560e908b1840aef6b80 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Tue, 30 Jan 2007 05:45:25 +0000 Subject: [PATCH] Bug #343933 --> images aren't getting loaded in the compose window after a save operation happens because nsMsgWindow::SetDOMWindow changes the app type to MAIL. Make callers explicitly set the app type instead of doing it in SetDOMWindow. sr=bienvenu --- mail/base/content/FilterListDialog.js | 3 ++- mail/base/content/mailWindow.js | 1 + mail/base/content/subscribe.js | 1 + mailnews/base/resources/content/mailWindow.js | 3 ++- mailnews/base/resources/content/msgSynchronize.js | 1 + mailnews/base/resources/content/subscribe.js | 1 + mailnews/base/search/resources/content/FilterEditor.js | 3 ++- .../base/search/resources/content/FilterListDialog.js | 3 ++- mailnews/base/search/resources/content/SearchDialog.js | 3 ++- mailnews/base/src/nsMsgWindow.cpp | 8 +------- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mail/base/content/FilterListDialog.js b/mail/base/content/FilterListDialog.js index 03559c89cee..8474e49ef8e 100644 --- a/mail/base/content/FilterListDialog.js +++ b/mail/base/content/FilterListDialog.js @@ -109,7 +109,8 @@ const nsMsgFilterMotion = Components.interfaces.nsMsgFilterMotion; function onLoad() { gFilterListMsgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"].createInstance(Components.interfaces.nsIMsgWindow); - gFilterListMsgWindow.domWindow = window; + gFilterListMsgWindow.domWindow = window; + gFilterListMsgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; gFilterListMsgWindow.statusFeedback = gStatusFeedback; gFilterBundle = document.getElementById("bundle_filter"); diff --git a/mail/base/content/mailWindow.js b/mail/base/content/mailWindow.js index 6c9a56bf2f0..567bab68f9a 100644 --- a/mail/base/content/mailWindow.js +++ b/mail/base/content/mailWindow.js @@ -189,6 +189,7 @@ function InitMsgWindow() mailSession.AddMsgWindow(msgWindow); getBrowser().docShell.allowAuth = false; msgWindow.rootDocShell.allowAuth = true; + msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; } function AddDataSources() diff --git a/mail/base/content/subscribe.js b/mail/base/content/subscribe.js index c55102d44c9..dd2bc4f9547 100644 --- a/mail/base/content/subscribe.js +++ b/mail/base/content/subscribe.js @@ -186,6 +186,7 @@ function SubscribeOnLoad() msgWindow.domWindow = window; msgWindow.statusFeedback = gStatusFeedback; msgWindow.rootDocShell.allowAuth = true; + msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { diff --git a/mailnews/base/resources/content/mailWindow.js b/mailnews/base/resources/content/mailWindow.js index 512c6ed37e0..c1c42d9fb0d 100644 --- a/mailnews/base/resources/content/mailWindow.js +++ b/mailnews/base/resources/content/mailWindow.js @@ -214,7 +214,8 @@ function InitMsgWindow() var messagepane = document.getElementById("messagepane"); messagepane.docShell.allowAuth = false; - msgWindow.rootDocShell.allowAuth = true; + msgWindow.rootDocShell.allowAuth = true; + msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; } function messagePaneOnClick(event) diff --git a/mailnews/base/resources/content/msgSynchronize.js b/mailnews/base/resources/content/msgSynchronize.js index 909c8e28078..ca86ae9090b 100644 --- a/mailnews/base/resources/content/msgSynchronize.js +++ b/mailnews/base/resources/content/msgSynchronize.js @@ -126,6 +126,7 @@ function selectOnLoad() { gMsgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); gMsgWindow.domWindow = window; + gMsgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; gAccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager); gSynchronizeTree = document.getElementById('synchronizeTree'); diff --git a/mailnews/base/resources/content/subscribe.js b/mailnews/base/resources/content/subscribe.js index 0e15dbb15a5..da20e6fc20c 100644 --- a/mailnews/base/resources/content/subscribe.js +++ b/mailnews/base/resources/content/subscribe.js @@ -188,6 +188,7 @@ function SubscribeOnLoad() msgWindow.domWindow = window; msgWindow.statusFeedback = gStatusFeedback; msgWindow.rootDocShell.allowAuth = true; + msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { diff --git a/mailnews/base/search/resources/content/FilterEditor.js b/mailnews/base/search/resources/content/FilterEditor.js index d7152bcffa2..811d8e7b060 100644 --- a/mailnews/base/search/resources/content/FilterEditor.js +++ b/mailnews/base/search/resources/content/FilterEditor.js @@ -408,7 +408,8 @@ function GetFilterEditorMsgWindow() var msgWindowContractID = "@mozilla.org/messenger/msgwindow;1"; var nsIMsgWindow = Components.interfaces.nsIMsgWindow; gFilterEditorMsgWindow = Components.classes[msgWindowContractID].createInstance(nsIMsgWindow); - gFilterEditorMsgWindow.domWindow = window; + gFilterEditorMsgWindow.domWindow = window; + gFilterEditorMsgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; } return gFilterEditorMsgWindow; } diff --git a/mailnews/base/search/resources/content/FilterListDialog.js b/mailnews/base/search/resources/content/FilterListDialog.js index cea84eece47..05d05693eae 100644 --- a/mailnews/base/search/resources/content/FilterListDialog.js +++ b/mailnews/base/search/resources/content/FilterListDialog.js @@ -94,7 +94,8 @@ const nsMsgFilterMotion = Components.interfaces.nsMsgFilterMotion; function onLoad() { gFilterListMsgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"].createInstance(Components.interfaces.nsIMsgWindow); - gFilterListMsgWindow.domWindow = window; + gFilterListMsgWindow.domWindow = window; + gFilterListMsgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; gFilterListMsgWindow.statusFeedback = gStatusFeedback; gFilterBundle = document.getElementById("bundle_filter"); diff --git a/mailnews/base/search/resources/content/SearchDialog.js b/mailnews/base/search/resources/content/SearchDialog.js index 2a11bdcb74b..fef26b14041 100644 --- a/mailnews/base/search/resources/content/SearchDialog.js +++ b/mailnews/base/search/resources/content/SearchDialog.js @@ -317,7 +317,8 @@ function initializeSearchWindowWidgets() hideMatchAllItem(); msgWindow = Components.classes[msgWindowContractID].createInstance(nsIMsgWindow); - msgWindow.domWindow = window; + msgWindow.domWindow = window; + msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; msgWindow.statusFeedback = gStatusFeedback; // functionality to enable/disable buttons using nsSearchResultsController diff --git a/mailnews/base/src/nsMsgWindow.cpp b/mailnews/base/src/nsMsgWindow.cpp index c23d1febf60..7a40752cb40 100644 --- a/mailnews/base/src/nsMsgWindow.cpp +++ b/mailnews/base/src/nsMsgWindow.cpp @@ -179,8 +179,6 @@ NS_IMETHODIMP nsMsgWindow::SetStatusFeedback(nsIMsgStatusFeedback * aStatusFeedb nsCOMPtr messageWindowDocShell; GetMessageWindowDocShell(getter_AddRefs(messageWindowDocShell)); - NS_ASSERTION(messageWindowDocShell, "No messagepane docshell found! setStatusFeedback called before setDOMWindow"); - // register our status feedback object as a web progress listener nsCOMPtr webProgress(do_GetInterface(messageWindowDocShell)); if (webProgress && mStatusFeedback && messageWindowDocShell) @@ -266,12 +264,8 @@ NS_IMETHODIMP nsMsgWindow::SetRootDocShell(nsIDocShell * aDocShell) { mRootDocShellWeak = do_GetWeakReference(aDocShell); nsCOMPtr listener(do_GetInterface(aDocShell)); - if (listener) { + if (listener) listener->SetParentContentListener(this); - } - // be sure to set the application flag on the root docshell - // so it knows we are a mail application. - aDocShell->SetAppType(nsIDocShell::APP_TYPE_MAIL); } return NS_OK; }