diff --git a/toolkit/content/charsetOverlay.js b/toolkit/content/charsetOverlay.js index 7dcbabf362c4..b22d083cf742 100644 --- a/toolkit/content/charsetOverlay.js +++ b/toolkit/content/charsetOverlay.js @@ -255,7 +255,7 @@ function mailCharsetLoadListener (event) } } -var wintype = document.firstChild.getAttribute('windowtype'); +var wintype = document.documentElement.getAttribute('windowtype'); if (window && (wintype == "navigator:browser")) { var contentArea = window.document.getElementById("appcontent"); diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index 7b4e076108f9..e689e9b0a186 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -72,7 +72,7 @@ function openNewTabWith(href, sourceURL, postData, event) // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. - var wintype = document.firstChild.getAttribute('windowtype'); + var wintype = document.documentElement.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") originCharset = window.content.document.characterSet; @@ -94,7 +94,7 @@ function openNewWindowWith(href, sourceURL, postData) // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... var charsetArg = null; - var wintype = document.firstChild.getAttribute('windowtype'); + var wintype = document.documentElement.getAttribute('windowtype'); if (wintype == "navigator:browser") charsetArg = "charset=" + window.content.document.characterSet;