From 409f5623a2b0eb5c31330e5671fc741803c87a85 Mon Sep 17 00:00:00 2001 From: "bugzilla%arlen.demon.co.uk" Date: Fri, 6 Jan 2006 20:38:21 +0000 Subject: [PATCH] Bug 319659 XPFE code assumes document.firstChild is the root element p=me r=neil.parkwaycc.co.uk sr=jag --- editor/ui/composer/content/ComposerCommands.js | 2 +- editor/ui/composer/content/editorApplicationOverlay.js | 2 +- mailnews/base/resources/content/mailWindowOverlay.js | 2 +- .../extensions/smime/resources/content/msgReadSMIMEOverlay.js | 2 +- xpfe/communicator/resources/content/contentAreaDD.js | 2 +- xpfe/communicator/resources/content/contentAreaUtils.js | 4 ++-- xpfe/components/sidebar/resources/sidebarOverlay.js | 2 +- xpfe/global/resources/content/charsetOverlay.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/editor/ui/composer/content/ComposerCommands.js b/editor/ui/composer/content/ComposerCommands.js index 6e6e3170e08a..ea34fcaf3e00 100644 --- a/editor/ui/composer/content/ComposerCommands.js +++ b/editor/ui/composer/content/ComposerCommands.js @@ -2420,7 +2420,7 @@ var nsSpellingCommand = { window.cancelSendMessage = false; try { - var skipBlockQuotes = (window.document.firstChild.getAttribute("windowtype") == "msgcompose"); + var skipBlockQuotes = (window.document.documentElement.getAttribute("windowtype") == "msgcompose"); window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", "chrome,close,titlebar,modal", false, skipBlockQuotes, true); } diff --git a/editor/ui/composer/content/editorApplicationOverlay.js b/editor/ui/composer/content/editorApplicationOverlay.js index be4cda9ed36a..d69c53e2fe6e 100644 --- a/editor/ui/composer/content/editorApplicationOverlay.js +++ b/editor/ui/composer/content/editorApplicationOverlay.js @@ -103,7 +103,7 @@ function editPage(url, launchWindow, delay) // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... - var wintype = document.firstChild.getAttribute('windowtype'); + var wintype = document.documentElement.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow.content.document) diff --git a/mailnews/base/resources/content/mailWindowOverlay.js b/mailnews/base/resources/content/mailWindowOverlay.js index 85303fa8de7b..110ea9849d05 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.js +++ b/mailnews/base/resources/content/mailWindowOverlay.js @@ -2253,7 +2253,7 @@ function OnMsgLoaded(aUrl) var markReadOnADelay = gPrefBranch.getBoolPref("mailnews.mark_message_read.delay"); if (msgHdr && !msgHdr.isRead) { - var wintype = document.firstChild.getAttribute('windowtype'); + var wintype = document.documentElement.getAttribute('windowtype'); if (markReadOnADelay && wintype == "mail:3pane") // only use the timer if viewing using the 3-pane preview pane and the user has set the pref gMarkViewedMessageAsReadTimer = setTimeout(MarkCurrentMessageAsRead, gPrefBranch.getIntPref("mailnews.mark_message_read.delay.interval") * 1000); else diff --git a/mailnews/extensions/smime/resources/content/msgReadSMIMEOverlay.js b/mailnews/extensions/smime/resources/content/msgReadSMIMEOverlay.js index d9c606325838..4534f248f789 100644 --- a/mailnews/extensions/smime/resources/content/msgReadSMIMEOverlay.js +++ b/mailnews/extensions/smime/resources/content/msgReadSMIMEOverlay.js @@ -119,7 +119,7 @@ var SecurityController = { case "cmd_viewSecurityStatus": { - if (document.firstChild.getAttribute('windowtype') == "mail:messageWindow") + if (document.documentElement.getAttribute('windowtype') == "mail:messageWindow") { return ( gCurrentMessageUri != null); } diff --git a/xpfe/communicator/resources/content/contentAreaDD.js b/xpfe/communicator/resources/content/contentAreaDD.js index 4bd7340ebf15..e1dad4da6716 100644 --- a/xpfe/communicator/resources/content/contentAreaDD.js +++ b/xpfe/communicator/resources/content/contentAreaDD.js @@ -60,7 +60,7 @@ var contentAreaDNDObserver = { /^\s*(javascript|data):/.test(url)) return; - switch (document.firstChild.getAttribute('windowtype')) { + switch (document.documentElement.getAttribute('windowtype')) { case "navigator:browser": // Perform a security check before loading the URI nsDragAndDrop.dragDropSecurityCheck(aEvent, aDragSession, url); diff --git a/xpfe/communicator/resources/content/contentAreaUtils.js b/xpfe/communicator/resources/content/contentAreaUtils.js index 10500b9b6eca..e3fbcbf12fd6 100644 --- a/xpfe/communicator/resources/content/contentAreaUtils.js +++ b/xpfe/communicator/resources/content/contentAreaUtils.js @@ -96,7 +96,7 @@ function openNewWindowWith(url, sendReferrer) // 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; @@ -165,7 +165,7 @@ function openNewTabWith(url, sendReferrer, reverseBackgroundPref) // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. - var wintype = browserDocument.firstChild.getAttribute('windowtype'); + var wintype = browserDocument.documentElement.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; diff --git a/xpfe/components/sidebar/resources/sidebarOverlay.js b/xpfe/components/sidebar/resources/sidebarOverlay.js index 3197b7f3e8bd..70365115bae4 100644 --- a/xpfe/components/sidebar/resources/sidebarOverlay.js +++ b/xpfe/components/sidebar/resources/sidebarOverlay.js @@ -747,7 +747,7 @@ function sidebar_overlay_init() { sidebarObj.master_datasources = get_remote_datasource_url(); sidebarObj.master_datasources += " chrome://communicator/content/sidebar/local-panels.rdf"; sidebarObj.master_resource = 'urn:sidebar:master-panel-list'; - sidebarObj.component = document.firstChild.getAttribute('windowtype'); + sidebarObj.component = document.documentElement.getAttribute('windowtype'); debug("sidebarObj.component is " + sidebarObj.component); // Initialize the display diff --git a/xpfe/global/resources/content/charsetOverlay.js b/xpfe/global/resources/content/charsetOverlay.js index a1936cf4735d..2e6cab89daa4 100644 --- a/xpfe/global/resources/content/charsetOverlay.js +++ b/xpfe/global/resources/content/charsetOverlay.js @@ -278,7 +278,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");