Bug 580868 charsetOverlay should not cause XBL bindings to attach when it's not safe r+a=gavin

This commit is contained in:
Neil Rashbrook 2010-08-01 23:59:26 +01:00
Родитель 57905eb5c0
Коммит 5e941052ed
1 изменённых файлов: 24 добавлений и 18 удалений

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

@ -245,28 +245,34 @@ function mailCharsetLoadListener (event)
} }
} }
var wintype = document.documentElement.getAttribute('windowtype'); function InitCharsetMenu()
if (window && (wintype == "navigator:browser"))
{ {
var contentArea = window.document.getElementById("appcontent"); removeEventListener("load", InitCharsetMenu, true);
if (contentArea)
contentArea.addEventListener("pageshow", charsetLoadListener, true); var wintype = document.documentElement.getAttribute('windowtype');
} if (window && (wintype == "navigator:browser"))
else
{
var arrayOfStrings = wintype.split(":");
if (window && arrayOfStrings[0] == "mail")
{ {
var messageContent = window.document.getElementById("messagepane"); var contentArea = window.document.getElementById("appcontent");
if (messageContent) if (contentArea)
messageContent.addEventListener("pageshow", mailCharsetLoadListener, true); contentArea.addEventListener("pageshow", charsetLoadListener, true);
} }
else else
if (window && arrayOfStrings[0] == "composer")
{ {
contentArea = window.document.getElementById("appcontent"); var arrayOfStrings = wintype.split(":");
if (contentArea) if (window && arrayOfStrings[0] == "mail")
contentArea.addEventListener("pageshow", composercharsetLoadListener, true); {
var messageContent = window.document.getElementById("messagepane");
if (messageContent)
messageContent.addEventListener("pageshow", mailCharsetLoadListener, true);
}
else
if (window && arrayOfStrings[0] == "composer")
{
contentArea = window.document.getElementById("appcontent");
if (contentArea)
contentArea.addEventListener("pageshow", composercharsetLoadListener, true);
}
} }
} }
addEventListener("load", InitCharsetMenu, true);