Bug 609877 Don't access DOM elements before the document has loaded (prerequisite for lightweight theme support) r=Mnyromyr

This commit is contained in:
Neil Rashbrook 2010-11-08 23:35:42 +00:00
Родитель 1e1fe30746
Коммит 5f89bfd186
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -59,8 +59,8 @@ const mozISpellCheckingEngine = Components.interfaces.mozISpellCheckingEngine;
* static globals, need to be initialized only once
*/
var sMsgComposeService = Components.classes["@mozilla.org/messengercompose;1"].getService(Components.interfaces.nsIMsgComposeService);
var sComposeMsgsBundle = document.getElementById("bundle_composeMsgs");
var sBrandBundle = document.getElementById("brandBundle");
var sComposeMsgsBundle;
var sBrandBundle;
var sPrefs = null;
var sPrefBranchInternal = null;
@ -1458,6 +1458,9 @@ function WizCallback(state)
function ComposeLoad()
{
sComposeMsgsBundle = document.getElementById("bundle_composeMsgs");
sBrandBundle = document.getElementById("brandBundle");
// First get the preferences service
try {
var prefService = Components.classes["@mozilla.org/preferences-service;1"]

Просмотреть файл

@ -40,7 +40,6 @@
* ***** END LICENSE BLOCK ***** */
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var gMessengerBundle = document.getElementById("bundle_messenger");
// Controller object for folder pane
var FolderPaneController =

Просмотреть файл

@ -2639,8 +2639,6 @@ var gMessageNotificationBar =
8 // 1 << (kMsgNotificationMDN - 1)
],
mMsgNotificationBar: document.getElementById('msgNotificationBar'),
setJunkMsg: function(aMsgHdr)
{
var isJunk = false;
@ -2687,8 +2685,9 @@ var gMessageNotificationBar =
clearMsgNotifications: function()
{
this.mBarStatus = 0;
this.mMsgNotificationBar.selectedIndex = 0;
this.mMsgNotificationBar.collapsed = true;
var msgNotificationBar = document.getElementById('msgNotificationBar');
msgNotificationBar.selectedIndex = 0;
msgNotificationBar.collapsed = true;
},
// private method used to set our message notification deck to the correct value...
@ -2700,9 +2699,10 @@ var gMessageNotificationBar =
// the phishing message takes precedence over the junk message
// which takes precedence over the remote content message
this.mMsgNotificationBar.selectedIndex = this.mBarFlagValues.indexOf(status & -status);
var msgNotificationBar = document.getElementById('msgNotificationBar');
msgNotificationBar.selectedIndex = this.mBarFlagValues.indexOf(status & -status);
this.mMsgNotificationBar.collapsed = !status;
msgNotificationBar.collapsed = !status;
},
/**