Bug 1584341 - migrate xul:wizard consumers to xul:window[role=dialog] with the wizard as the only child. r=mkmelin,pmorris
authorKhushil Mistry <khushil324@gmail.com>
Thu, 14 Nov 2019 12:20:00 +0100
changeset 37509 78cef389a611168e3b3e0343cf4e14681e6b1c99
parent 37508 bd0fd75f44381a6db63a95fce6ba61159b791228
child 37510 f42ebae6cd6d06b3ae629d8bbc405d397d466013
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersmkmelin, pmorris
bugs1584341
Bug 1584341 - migrate xul:wizard consumers to xul:window[role=dialog] with the wizard as the only child. r=mkmelin,pmorris
calendar/base/content/dialogs/calendar-migration-dialog.js
calendar/base/content/dialogs/calendar-migration-dialog.xul
calendar/resources/content/calendarCreation.js
calendar/resources/content/calendarCreation.xul
calendar/test/browser/browser_calendarList.js
calendar/test/modules/CalendarUtils.jsm
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imAccountWizard.xul
mail/components/migration/content/migration.js
mail/components/migration/content/migration.xul
mailnews/base/prefs/content/AccountWizard.js
mailnews/base/prefs/content/AccountWizard.xul
mailnews/base/prefs/content/accountUtils.js
mailnews/base/prefs/content/aw-accname.js
mailnews/base/prefs/content/aw-identity.js
mailnews/base/prefs/content/aw-incoming.js
mailnews/base/prefs/content/aw-outgoing.js
mailnews/extensions/newsblog/content/feedAccountWizard.js
mailnews/extensions/newsblog/content/feedAccountWizard.xul
--- a/calendar/base/content/dialogs/calendar-migration-dialog.js
+++ b/calendar/base/content/dialogs/calendar-migration-dialog.js
@@ -23,17 +23,17 @@ var gMigrateWizard = {
     let wizardPage2 = document.getElementById("wizardPage2");
     wizardPage2.addEventListener("pageshow", gMigrateWizard.migrateChecked);
 
     let listbox = document.getElementById("datasource-list");
 
     // XXX Once we have branding for lightning, this hack can go away
     let props = Services.strings.createBundle("chrome://calendar/locale/migration.properties");
 
-    let wizard = document.getElementById("migration-wizard");
+    let wizard = document.querySelector("wizard");
     let desc = document.getElementById("wizard-desc");
     // Since we don't translate "Lightning"...
     wizard.title = props.formatStringFromName("migrationTitle", ["Lightning"]);
     desc.textContent = props.formatStringFromName("migrationDescription", ["Lightning"]);
 
     migLOG("migrators: " + window.arguments.length);
     for (let migrator of window.arguments[0]) {
       let checkbox = document.createXULElement("checkbox");
@@ -63,17 +63,17 @@ var gMigrateWizard = {
     // If no migrators were checked, then we're done
     if (migrators.length == 0) {
       window.close();
     }
 
     // Don't let the user get away while we're migrating
     // XXX may want to wire this into the 'cancel' function once that's
     //    written
-    let wizard = document.getElementById("migration-wizard");
+    let wizard = document.querySelector("wizard");
     wizard.canAdvance = false;
     wizard.canRewind = false;
 
     // We're going to need this for the progress meter's description
     let props = Services.strings.createBundle("chrome://calendar/locale/migration.properties");
     let label = document.getElementById("progress-label");
     let meter = document.getElementById("migrate-progressmeter");
 
@@ -110,17 +110,17 @@ var gMigrateWizard = {
     // And get the first migrator
     getNextMigrator();
   },
 
   /**
    * Makes sure the wizard "back" button can not be pressed.
    */
   setCanRewindFalse: function() {
-    document.getElementById("migration-wizard").canRewind = false;
+    document.querySelector("wizard").canRewind = false;
   },
 };
 
 //
 // The more back-end data detection bits
 //
 
 /**
--- a/calendar/base/content/dialogs/calendar-migration-dialog.xul
+++ b/calendar/base/content/dialogs/calendar-migration-dialog.xul
@@ -1,46 +1,47 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- Style sheets -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
-<!DOCTYPE dialog
+<!DOCTYPE window
 [
-    <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-    %brandDTD;
-    <!ENTITY % migrationDtd SYSTEM "chrome://calendar/locale/migration.dtd">
-    %migrationDtd;
+  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+  %brandDTD;
+  <!ENTITY % migrationDtd SYSTEM "chrome://calendar/locale/migration.dtd">
+  %migrationDtd;
 ]>
 
-<wizard id="migration-wizard"
+<window id="migration-wizard"
         title="&migration.title;"
         windowtype="Calendar:MigrationWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         onload="gMigrateWizard.loadMigrators()"
         branded="true"
         persist="screenX screenY">
+  <script src="chrome://calendar/content/calendar-migration-dialog.js"/>
+  <script src="chrome://calendar/content/import-export.js"/>
 
-    <script src="chrome://calendar/content/calendar-migration-dialog.js"/>
-    <script src="chrome://calendar/content/import-export.js"/>
-
+  <wizard>
     <wizardpage id="wizardPage1"
                 pageid="initialPage"
                 next="progressPage"
                 label="&migration.welcome;">
-        <label id="wizard-desc" control="datasource-list">&migration.list.description;</label>
-        <vbox id="datasource-list" flex="1"/>
+      <label id="wizard-desc" control="datasource-list">&migration.list.description;</label>
+      <vbox id="datasource-list" flex="1"/>
     </wizardpage>
 
     <wizardpage id="wizardPage2"
                 pageid="progressPage"
                 label="&migration.importing;">
-        <label control="migrate-progressmeter">&migration.progress.description;</label>
-        <vbox flex="1">
-            <html:progress id="migrate-progressmeter" value="0" max="100"/>
-            <label value="" flex="1" id="progress-label"/>
-        </vbox>
+      <label control="migrate-progressmeter">&migration.progress.description;</label>
+      <vbox flex="1">
+        <html:progress id="migrate-progressmeter" value="0" max="100"/>
+        <label value="" flex="1" id="progress-label"/>
+      </vbox>
     </wizardpage>
-</wizard>
+  </wizard>
+</window>
--- a/calendar/resources/content/calendarCreation.js
+++ b/calendar/resources/content/calendarCreation.js
@@ -145,17 +145,17 @@ function onSelectProvider(type) {
 }
 
 /**
  * Checks if the required information is set so that the wizard can advance. On
  * an error, notifications are shown and the wizard can not be advanced.
  */
 function checkRequired() {
   let canAdvance = true;
-  let curPage = document.getElementById("calendar-wizard").currentPage;
+  let curPage = document.querySelector("wizard").currentPage;
   if (curPage) {
     let eList = curPage.getElementsByAttribute("required", "required");
     for (let i = 0; i < eList.length && canAdvance; ++i) {
       canAdvance = eList[i].value != "";
     }
 
     if (
       canAdvance &&
@@ -164,17 +164,17 @@ function checkRequired() {
     ) {
       // eslint-disable-next-line array-bracket-spacing
       let [reason] = parseUri(document.getElementById("calendar-uri").value);
       canAdvance = reason == errorConstants.SUCCESS;
       setNotification(reason);
     } else {
       gNotification.notificationbox.removeAllNotifications();
     }
-    document.getElementById("calendar-wizard").canAdvance = canAdvance;
+    document.querySelector("wizard").canAdvance = canAdvance;
   }
 }
 
 /**
  * Handler function called when the advance button is pressed on the initial
  * wizard page
  */
 function onInitialAdvance() {
@@ -296,10 +296,10 @@ function parseUri(aUri) {
   return [errorConstants.SUCCESS, uri];
 }
 
 /**
  * Disables the back button, in case we are far enough that its not possible to
  * undo.
  */
 function setCanRewindFalse() {
-  document.getElementById("calendar-wizard").canRewind = false;
+  document.querySelector("wizard").canRewind = false;
 }
--- a/calendar/resources/content/calendarCreation.xul
+++ b/calendar/resources/content/calendarCreation.xul
@@ -3,186 +3,186 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/content/notification.css" type="text/css"?>
 <?xml-stylesheet href="chrome://calendar-common/skin/calendar-creation-wizard.css" type="text/css"?>
 <?xml-stylesheet type="text/css" href="chrome://messenger/skin/input-fields.css"?>
 
-<!DOCTYPE dialog [
+<!DOCTYPE window [
   <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/calendarCreation.dtd" > %dtd1;
   <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
   <!ENTITY % dtd3 SYSTEM "chrome://lightning/locale/lightning.dtd"> %dtd3;
 ]>
 
-<wizard id="calendar-wizard"
+<window id="calendar-wizard-window"
         title="&wizard.title;"
         windowtype="Calendar:NewCalendarWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         onload="onLoad()"
         persist="screenX screenY">
-
   <script src="chrome://global/content/globalOverlay.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
   <script src="chrome://calendar/content/calendarCreation.js"/>
   <script src="chrome://calendar/content/calendar-ui-utils.js"/>
   <script src="chrome://lightning/content/lightning-utils.js"/>
   <script src="chrome://lightning/content/lightning-calendar-creation.js"/>
   <script src="chrome://lightning/content/caldav-lightning-utils.js"/>
   <script src="chrome://lightning/content/caldav-lightning-calendar-creation.js"/>
 
-  <wizardpage id="initialPage"
-              pageid="initialPage"
-              next="locationPage"
-              label="&wizard.label;"
-              description="&wizard.description;">
-    <description>&initialpage.description;</description>
-    <radiogroup id="calendar-type">
-      <radio value="local" label="&initialpage.computer.label;" selected="true"/>
-      <radio value="remote" label="&initialpage.network.label;"/>
-    </radiogroup>
-  </wizardpage>
+  <wizard id="calendar-wizard">
+    <wizardpage id="initialPage"
+                pageid="initialPage"
+                next="locationPage"
+                label="&wizard.label;"
+                description="&wizard.description;">
+      <description>&initialpage.description;</description>
+      <radiogroup id="calendar-type">
+        <radio value="local" label="&initialpage.computer.label;" selected="true"/>
+        <radio value="remote" label="&initialpage.network.label;"/>
+      </radiogroup>
+    </wizardpage>
 
-  <wizardpage id="locationPage"
-              pageid="locationPage"
-              next="customizePage"
-              label="&wizard.label;"
-              description="&wizard.description;">
-    <description>&locationpage.description;</description>
-    <html:table>
-      <html:tr>
-        <html:th valign="top">
-          <label value="&calendarproperties.format.label;" control="calendar-format"/>
-        </html:th>
-        <html:td>
-          <radiogroup id="calendar-format" onselect="onSelectProvider(this.value)">
-            <radio value="ics" label="&calendarproperties.webdav.label;" selected="true" />
-            <radio value="caldav" label="&calendarproperties.caldav.label;"/>
-            <radio id="wcap-radio" value="wcap" label="&calendarproperties.wcap.label;"/>
-          </radiogroup>
-        </html:td>
-      </html:tr>
-      <html:tr id="calendar-username-row">
-        <html:th>
-          <label id="calendar-username-label"
-                 value="&locationpage.username.label;"
-                 control="calendar-username"/>
-        </html:th>
-        <html:td>
-          <hbox flex="1" class="input-container">
-            <html:input id="calendar-username" type="text" class="input-inline"
-                        aria-labelledby="calendar-username-label"/>
-          </hbox>
-        </html:td>
-      </html:tr>
-      <html:tr id="calendar-location-row">
-        <html:th>
-          <label id="calendar-uri-label" value="&calendarproperties.location.label;" control="calendar-uri"/>
-        </html:th>
-        <html:td id="calendar-uri-td">
-          <hbox flex="1" class="input-container">
-            <html:input id="calendar-uri" type="url" class="input-inline"
-                        required="required"
-                        aria-labelledby="calendar-uri-label"
-                        oninput="checkRequired();"/>
-          </hbox>
-        </html:td>
-      </html:tr>
-      <html:tr>
-        <html:th></html:th>
-        <html:td>
-          <checkbox id="cache"
-                    checked="true"
-                    label="&calendarproperties.cache3.label;"/>
-        </html:td>
-      </html:tr>
-    </html:table>
-    <hbox id="calendar-notification-location"
-          class="notification-inline"
-          flex="1">
-      <!-- notificationbox will be added here lazily. -->
-    </hbox>
-  </wizardpage>
+    <wizardpage id="locationPage"
+                pageid="locationPage"
+                next="customizePage"
+                label="&wizard.label;"
+                description="&wizard.description;">
+      <description>&locationpage.description;</description>
+      <html:table>
+        <html:tr>
+          <html:th valign="top">
+            <label value="&calendarproperties.format.label;" control="calendar-format"/>
+          </html:th>
+          <html:td>
+            <radiogroup id="calendar-format" onselect="onSelectProvider(this.value)">
+              <radio value="ics" label="&calendarproperties.webdav.label;" selected="true" />
+              <radio value="caldav" label="&calendarproperties.caldav.label;"/>
+              <radio id="wcap-radio" value="wcap" label="&calendarproperties.wcap.label;"/>
+            </radiogroup>
+          </html:td>
+        </html:tr>
+        <html:tr id="calendar-username-row">
+          <html:th>
+            <label id="calendar-username-label"
+                   value="&locationpage.username.label;"
+                   control="calendar-username"/>
+          </html:th>
+          <html:td>
+            <hbox flex="1" class="input-container">
+              <html:input id="calendar-username" type="text" class="input-inline"
+                          aria-labelledby="calendar-username-label"/>
+            </hbox>
+          </html:td>
+        </html:tr>
+        <html:tr id="calendar-location-row">
+          <html:th>
+            <label id="calendar-uri-label" value="&calendarproperties.location.label;" control="calendar-uri"/>
+          </html:th>
+          <html:td id="calendar-uri-td">
+            <hbox flex="1" class="input-container">
+              <html:input id="calendar-uri" type="url" class="input-inline"
+                          required="required"
+                          aria-labelledby="calendar-uri-label"
+                          oninput="checkRequired();"/>
+            </hbox>
+          </html:td>
+        </html:tr>
+        <html:tr>
+          <html:th></html:th>
+          <html:td>
+            <checkbox id="cache"
+                      checked="true"
+                      label="&calendarproperties.cache3.label;"/>
+          </html:td>
+        </html:tr>
+      </html:table>
+      <hbox id="calendar-notification-location"
+            class="notification-inline"
+            flex="1">
+        <!-- notificationbox will be added here lazily. -->
+      </hbox>
+    </wizardpage>
 
-  <wizardpage id="customizePage"
-              pageid="customizePage"
-              description="&custompage.shortdescription;"
-              label="&wizard.label;"
-              next="finishPage">
-    <vbox id="no-identity-notification" class="notification-inline">
-      <!-- notificationbox will be added here lazily. -->
-    </vbox>
-    <description>&custompage.longdescription;</description>
-    <html:table id="customize-table">
-      <html:tr id="customize-name-row">
-        <html:th>
-          <label id="calendar-name-label" value="&calendarproperties.name.label;" control="calendar-name"/>
-        </html:th>
-        <html:td>
-          <hbox flex="1" class="input-container">
-            <html:input id="calendar-name"
-                        type="text"
-                        required="required"
-                        class="input-inline"
-                        aria-labelledby="calendar-name-label"
-                        oninput="checkRequired();"/>
-          </hbox>
-        </html:td>
-      </html:tr>
-      <html:tr id="customize-color-row">
-        <html:th>
-          <label value="&calendarproperties.color.label;" control="calendar-color"/>
-        </html:th>
-        <html:td>
-          <hbox align="center">
-            <html:input id="calendar-color"
-                        type="color"
-                        palettename="standard"/>
-          </hbox>
-        </html:td>
-      </html:tr>
-      <html:tr id="customize-suppressAlarms-row">
-        <html:th>
-          <label value="&calendarproperties.firealarms.label;:" control="fire-alarms"/>
-        </html:th>
-        <html:td>
-          <checkbox id="fire-alarms" checked="true" class="checkbox-no-label"/>
-        </html:td>
-      </html:tr>
-      <html:tr id="calendar-email-identity-row">
-        <html:th>
-          <label value="&lightning.calendarproperties.email.label;"
-                 control="email-identity-menulist"/>
-        </html:th>
-        <html:td>
-          <menulist id="email-identity-menulist"
-                    oncommand="onChangeIdentity(event)">
-            <menupopup id="email-identity-menupopup"/>
-          </menulist>
-        </html:td>
-      </html:tr>
-      <html:tr id="calendar-force-email-scheduling-row">
-        <html:th>
-        </html:th>
-        <html:td>
-          <!-- The capability to enforce email scheduling wouldn't be enabled in the calendar wizard
-               atm because we would have to check the server capabilities with an OPTIONS request to
-               find out whether this server advertises server-side scheduling. We would need to rework
-               the wizard for that - fixing bug 306495 would probably prepare this. So for now, we just
-               let the user that he can enable this subsequently if applicable -->
-          <checkbox id="force-email-scheduling"
-                    label="&lightning.calendarproperties.forceEmailScheduling.label;"
-                    disable-with-calendar="true"
-                    tooltiptext="&lightning.calendarproperties.forceEmailScheduling.tooltiptext1;"/>
-        </html:td>
-      </html:tr>
-    </html:table>
-  </wizardpage>
+    <wizardpage id="customizePage"
+                pageid="customizePage"
+                description="&custompage.shortdescription;"
+                label="&wizard.label;"
+                next="finishPage">
+      <vbox id="no-identity-notification" class="notification-inline">
+        <!-- notificationbox will be added here lazily. -->
+      </vbox>
+      <description>&custompage.longdescription;</description>
+      <html:table id="customize-table">
+        <html:tr id="customize-name-row">
+          <html:th>
+            <label id="calendar-name-label" value="&calendarproperties.name.label;" control="calendar-name"/>
+          </html:th>
+          <html:td>
+            <hbox flex="1" class="input-container">
+              <html:input id="calendar-name"
+                          type="text"
+                          required="required"
+                          class="input-inline"
+                          aria-labelledby="calendar-name-label"
+                          oninput="checkRequired();"/>
+            </hbox>
+          </html:td>
+        </html:tr>
+        <html:tr id="customize-color-row">
+          <html:th>
+            <label value="&calendarproperties.color.label;" control="calendar-color"/>
+          </html:th>
+          <html:td>
+            <hbox align="center">
+              <html:input id="calendar-color"
+                          type="color"
+                          palettename="standard"/>
+            </hbox>
+          </html:td>
+        </html:tr>
+        <html:tr id="customize-suppressAlarms-row">
+          <html:th>
+            <label value="&calendarproperties.firealarms.label;:" control="fire-alarms"/>
+          </html:th>
+          <html:td>
+            <checkbox id="fire-alarms" checked="true" class="checkbox-no-label"/>
+          </html:td>
+        </html:tr>
+        <html:tr id="calendar-email-identity-row">
+          <html:th>
+            <label value="&lightning.calendarproperties.email.label;"
+                   control="email-identity-menulist"/>
+          </html:th>
+          <html:td>
+            <menulist id="email-identity-menulist"
+                      oncommand="onChangeIdentity(event)">
+              <menupopup id="email-identity-menupopup"/>
+            </menulist>
+          </html:td>
+        </html:tr>
+        <html:tr id="calendar-force-email-scheduling-row">
+          <html:th></html:th>
+          <html:td>
+            <!-- The capability to enforce email scheduling wouldn't be enabled in the calendar wizard
+                 atm because we would have to check the server capabilities with an OPTIONS request to
+                 find out whether this server advertises server-side scheduling. We would need to rework
+                 the wizard for that - fixing bug 306495 would probably prepare this. So for now, we just
+                 let the user that he can enable this subsequently if applicable -->
+            <checkbox id="force-email-scheduling"
+                      label="&lightning.calendarproperties.forceEmailScheduling.label;"
+                      disable-with-calendar="true"
+                      tooltiptext="&lightning.calendarproperties.forceEmailScheduling.tooltiptext1;"/>
+          </html:td>
+        </html:tr>
+      </html:table>
+    </wizardpage>
 
-  <wizardpage id="finishPage"
-              pageid="finishPage"
-              description="&finishpage.shortdescription;"
-              label="&wizard.label;">
-    <description>&finishpage.longdescription;</description>
-  </wizardpage>
-</wizard>
+    <wizardpage id="finishPage"
+                pageid="finishPage"
+                description="&finishpage.shortdescription;"
+                label="&wizard.label;">
+      <description>&finishpage.longdescription;</description>
+    </wizardpage>
+  </wizard>
+</window>
--- a/calendar/test/browser/browser_calendarList.js
+++ b/calendar/test/browser/browser_calendarList.js
@@ -22,17 +22,20 @@ async function withModalDialog(trigger, 
           await BrowserTestUtils.waitForEvent(win, "load");
           await new Promise(res => win.setTimeout(res));
 
           info(`New window opened: ${win.location.href}`);
           if (callback) {
             await callback(win);
           }
 
-          let button = win.document.documentElement.getButton(whichButton);
+          let button =
+            win.document.documentElement.localName == "dialog"
+              ? win.document.documentElement.getButton(whichButton)
+              : win.document.querySelector("wizard").getButton(whichButton);
           EventUtils.synthesizeMouseAtCenter(button, {}, win);
           resolve();
         },
       },
       "toplevel-window-ready"
     );
   });
   let triggerPromise = trigger();
--- a/calendar/test/modules/CalendarUtils.jsm
+++ b/calendar/test/modules/CalendarUtils.jsm
@@ -524,51 +524,51 @@ function createCalendar(controller, name
  *                              showReminders - False to disable reminders.
  *                              eMail - id of eMail account
  *                              network.format - ics/caldav/wcap
  *                              network.location - URI (undefined for local ICS)
  *                              network.offline - False to disable cache.
  */
 function handleNewCalendarWizard(wizard, name, data = undefined) {
   let { lookup: wizardlookup, eid: wizardId } = helpersForController(wizard);
-  let dlgButton = btn => wizard.window.document.documentElement.getButton(btn);
+  let dlgButton = btn => wizard.window.document.querySelector("wizard").getButton(btn);
   if (data == undefined) {
     data = {};
   }
 
   // Choose network calendar if any network data is set.
   if (data.network) {
     let remoteOption = wizardlookup(`
-            /id("calendar-wizard")/{"pageid":"initialPage"}/id("calendar-type")/{"value":"remote"}
+            /id("calendar-wizard-window")/id("calendar-wizard")/{"id":"initialPage"}/id("calendar-type")/{"value":"remote"}
         `);
     wizard.waitForElement(remoteOption);
     wizard.radio(remoteOption);
     dlgButton("next").doCommand();
 
     // Choose format.
     if (data.network.format == undefined) {
       data.network.format = "ics";
     }
     let formatOption = wizardlookup(`
-            /id("calendar-wizard")/{"pageid":"locationPage"}/[1]/[0]/[1]/
+            /id("calendar-wizard-window")/id("calendar-wizard")/{"id":"locationPage"}/[1]/[0]/[1]/
             id("calendar-format")/{"value":"${data.network.format}"}
         `);
     wizard.waitForElement(formatOption);
     wizard.radio(formatOption);
 
     // Enter location.
     if (data.network.location == undefined) {
       let calendarFile = Services.dirsvc.get("TmpD", Ci.nsIFile);
       calendarFile.append(name + ".ics");
       let fileURI = Services.io.newFileURI(calendarFile);
       data.network.location = fileURI.prePath + fileURI.pathQueryRef;
     }
     wizard.type(
       wizardlookup(`
-            /id("calendar-wizard")/{"pageid":"locationPage"}/[1]/id("calendar-location-row")/
+            /id("calendar-wizard-window")/id("calendar-wizard")/{"id":"locationPage"}/[1]/id("calendar-location-row")/
             id("calendar-uri-td")/{"class":"input-container"}/id("calendar-uri")
         `),
       data.network.location
     );
 
     // Choose offline support.
     if (data.network.offline == undefined) {
       data.network.offline = true;
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -9,20 +9,19 @@ var { Services } = ChromeUtils.import("r
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var PREF_EXTENSIONS_GETMOREPROTOCOLSURL = "extensions.getMoreProtocolsURL";
 
 var accountWizard = {
   onload() {
-    document.documentElement.addEventListener(
-      "wizardfinish",
-      this.createAccount.bind(this)
-    );
+    document
+      .querySelector("wizard")
+      .addEventListener("wizardfinish", this.createAccount.bind(this));
     let accountProtocolPage = document.getElementById("accountprotocol");
     accountProtocolPage.addEventListener(
       "pageadvanced",
       this.selectProtocol.bind(this)
     );
     let accountUsernamePage = document.getElementById("accountusername");
     accountUsernamePage.addEventListener(
       "pageshow",
@@ -98,17 +97,17 @@ var accountWizard = {
     if (!this.userNameBoxes[0].value) {
       return "";
     }
 
     return this.userNameBoxes.reduce((prev, elt) => prev + elt.value, "");
   },
 
   checkUsername() {
-    var wizard = document.getElementById("accountWizard");
+    var wizard = document.querySelector("wizard");
     var name = accountWizard.getUsername();
     var duplicateWarning = document.getElementById("duplicateAccount");
     if (!name) {
       wizard.canAdvance = false;
       duplicateWarning.hidden = true;
       return;
     }
 
@@ -201,17 +200,17 @@ var accountWizard = {
       );
     }
     this.userNameBoxes[0].focus();
     this.userNameProto = proto;
     this.checkUsername();
   },
 
   hideUsernamePage() {
-    document.getElementById("accountWizard").canAdvance = true;
+    document.querySelector("wizard").canAdvance = true;
     var next = "account" + (this.proto.noPassword ? "advanced" : "password");
     document.getElementById("accountusername").next = next;
   },
 
   showAdvanced() {
     // ensure we don't destroy user data if it's not necessary
     var id = this.proto.id;
     if ("protoSpecOptId" in this && this.protoSpecOptId == id) {
--- a/mail/components/im/content/imAccountWizard.xul
+++ b/mail/components/im/content/imAccountWizard.xul
@@ -4,106 +4,106 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/imAccountWizard.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/input-fields.css" type="text/css"?>
 
-<!DOCTYPE wizard [
+<!DOCTYPE window [
   <!ENTITY % accountWizardDTD SYSTEM "chrome://messenger/locale/imAccountWizard.dtd">
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
   %accountWizardDTD;
   %brandDTD;
 ]>
 
-<wizard id="accountWizard"
+<window id="accountWizard"
         title="&windowTitle.label;"
         windowtype="Messenger:accountWizard"
         onload="accountWizard.onload();"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
-
   <script src="chrome://global/content/globalOverlay.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
   <script src="chrome://chat/content/imAccountOptionsHelper.js"/>
   <script src="chrome://messenger/content/chat/imAccountWizard.js"/>
 
   <stringbundle id="accountsBundle" src="chrome://messenger/locale/imAccounts.properties"/>
 
-  <wizardpage id="accountprotocol" pageid="accountprotocol" next="accountusername"
-              label="&accountProtocolTitle.label;">
-    <description>&accountProtocolInfo.label;</description>
-    <separator/>
-    <label value="&accountProtocolField.label;" control="protolist"
-           id="protoLabel" hidden="true"/>
-    <richlistbox flex="1" id="protolist" class="theme-listbox"
-                 ondblclick="document.getElementById('accountWizard').advance();"/>
-    <hbox pack="end">
-      <label id="getMoreProtocols" class="text-link" value="&accountProtocolGetMore.label;"
-             onclick="if (event.button == 0) { accountWizard.openURL(this.getAttribute('getMoreURL')); }"/>
-    </hbox>
-  </wizardpage>
+  <wizard>
+    <wizardpage id="accountprotocol" pageid="accountprotocol" next="accountusername"
+                label="&accountProtocolTitle.label;">
+      <description>&accountProtocolInfo.label;</description>
+      <separator/>
+      <label value="&accountProtocolField.label;" control="protolist"
+             id="protoLabel" hidden="true"/>
+      <richlistbox flex="1" id="protolist" class="theme-listbox"
+                   ondblclick="document.getElementById('accountWizard').advance();"/>
+      <hbox pack="end">
+        <label id="getMoreProtocols" class="text-link" value="&accountProtocolGetMore.label;"
+               onclick="if (event.button == 0) { accountWizard.openURL(this.getAttribute('getMoreURL')); }"/>
+      </hbox>
+    </wizardpage>
 
-  <wizardpage id="accountusername" pageid="accountusername" next="accountpassword"
-              label="&accountUsernameTitle.label;">
-    <description id="usernameInfo"/>
-    <separator/>
-    <vbox id="userNameBox"/>
-    <separator/>
-    <description id="duplicateAccount" hidden="true">&accountUsernameDuplicate.label;</description>
-  </wizardpage>
+    <wizardpage id="accountusername" pageid="accountusername" next="accountpassword"
+                label="&accountUsernameTitle.label;">
+      <description id="usernameInfo"/>
+      <separator/>
+      <vbox id="userNameBox"/>
+      <separator/>
+      <description id="duplicateAccount" hidden="true">&accountUsernameDuplicate.label;</description>
+    </wizardpage>
 
-  <wizardpage id="accountpassword" pageid="accountpassword" next="accountadvanced"
-              label="&accountPasswordTitle.label;">
-    <description>&accountPasswordInfo.label;</description>
-    <separator/>
-    <hbox id="passwordBox" align="baseline" class="input-container">
-      <label id="passwordLabel"
-             value="&accountPasswordField.label;"
-             class="label-inline"
-             control="password"/>
-      <html:input id="password" type="password" class="input-inline"/>
-    </hbox>
-    <separator/>
-    <description id="passwordManagerDescription">&accountPasswordManager.label;</description>
-  </wizardpage>
+    <wizardpage id="accountpassword" pageid="accountpassword" next="accountadvanced"
+                label="&accountPasswordTitle.label;">
+      <description>&accountPasswordInfo.label;</description>
+      <separator/>
+      <hbox id="passwordBox" align="baseline" class="input-container">
+        <label id="passwordLabel"
+               value="&accountPasswordField.label;"
+               class="label-inline"
+               control="password"/>
+        <html:input id="password" type="password" class="input-inline"/>
+      </hbox>
+      <separator/>
+      <description id="passwordManagerDescription">&accountPasswordManager.label;</description>
+    </wizardpage>
 
-  <wizardpage id="accountadvanced" pageid="accountadvanced" next="accountsummary"
-              label="&accountAdvancedTitle.label;">
-    <description>&accountAdvancedInfo.label;</description>
-    <separator class="thin"/>
-    <groupbox id="aliasGroupbox">
-      <hbox class="groupbox-title">
-        <label id="aliasGroupboxCaption" class="header">&accountAliasGroupbox.caption;</label>
-      </hbox>
-      <hbox id="aliasBox" align="baseline" class="input-container">
-        <label id="aliasLabel"
-               value="&accountAliasField.label;"
-               class="label-inline"
-               control="alias" />
-        <html:input id="alias" type="text" class="input-inline"/>
-      </hbox>
-      <description>&accountAliasInfo.label;</description>
-    </groupbox>
+    <wizardpage id="accountadvanced" pageid="accountadvanced" next="accountsummary"
+                label="&accountAdvancedTitle.label;">
+      <description>&accountAdvancedInfo.label;</description>
+      <separator class="thin"/>
+      <groupbox id="aliasGroupbox">
+        <hbox class="groupbox-title">
+          <label id="aliasGroupboxCaption" class="header">&accountAliasGroupbox.caption;</label>
+        </hbox>
+        <hbox id="aliasBox" align="baseline" class="input-container">
+          <label id="aliasLabel"
+                 value="&accountAliasField.label;"
+                 class="label-inline"
+                 control="alias" />
+          <html:input id="alias" type="text" class="input-inline"/>
+        </hbox>
+        <description>&accountAliasInfo.label;</description>
+      </groupbox>
 
-    <checkbox id="newMailNotification"
-              label="&accountAdvanced.newMailNotification.label;" hidden="true"/>
+      <checkbox id="newMailNotification"
+                label="&accountAdvanced.newMailNotification.label;" hidden="true"/>
 
-    <groupbox id="protoSpecificGroupbox">
-      <hbox class="groupbox-title">
-        <label id="protoSpecificCaption" class="header"/>
-      </hbox>
-      <vbox id="protoSpecific" flex="1"/>
-    </groupbox>
-  </wizardpage>
+      <groupbox id="protoSpecificGroupbox">
+        <hbox class="groupbox-title">
+          <label id="protoSpecificCaption" class="header"/>
+        </hbox>
+        <vbox id="protoSpecific" flex="1"/>
+      </groupbox>
+    </wizardpage>
 
-  <wizardpage id="accountsummary" pageid="accountsummary"
-              label="&accountSummaryTitle.label;">
-    <description>&accountSummaryInfo.label;</description>
-    <separator/>
-    <vbox id="summaryRows"/>
-    <separator/>
-    <checkbox id="connectNow" label= "&accountSummary.connectNow.label;" checked="true"/>
-  </wizardpage>
-
-</wizard>
+    <wizardpage id="accountsummary" pageid="accountsummary"
+                label="&accountSummaryTitle.label;">
+      <description>&accountSummaryInfo.label;</description>
+      <separator/>
+      <vbox id="summaryRows"/>
+      <separator/>
+      <checkbox id="connectNow" label= "&accountSummary.connectNow.label;" checked="true"/>
+    </wizardpage>
+  </wizard>
+</window>
--- a/mail/components/migration/content/migration.js
+++ b/mail/components/migration/content/migration.js
@@ -14,24 +14,22 @@ var MigrationWizard = {
   _source: "", // Source Profile Migrator ContractID suffix
   _itemsFlags: kIMig.ALL, // Selected Import Data Sources (16-bit bitfield)
   _selectedProfile: null, // Selected Profile name to import from
   _wiz: null,
   _migrator: null,
   _autoMigrate: null,
 
   init() {
-    document.documentElement.addEventListener(
-      "wizardback",
-      this.onBack.bind(this)
-    );
-    document.documentElement.addEventListener(
-      "wizardcancel",
-      this.onCancel.bind(this)
-    );
+    document
+      .querySelector("wizard")
+      .addEventListener("wizardback", this.onBack.bind(this));
+    document
+      .querySelector("wizard")
+      .addEventListener("wizardcancel", this.onCancel.bind(this));
 
     let importSourcePage = document.getElementById("importSource");
     importSourcePage.addEventListener(
       "pageadvanced",
       this.onImportSourcePageAdvanced.bind(this)
     );
 
     let selectProfilePage = document.getElementById("selectProfile");
@@ -72,17 +70,17 @@ var MigrationWizard = {
     donePage.addEventListener("pageshow", this.onDonePageShow.bind(this));
 
     Services.obs.addObserver(this, "Migration:Started");
     Services.obs.addObserver(this, "Migration:ItemBeforeMigrate");
     Services.obs.addObserver(this, "Migration:ItemAfterMigrate");
     Services.obs.addObserver(this, "Migration:Ended");
     Services.obs.addObserver(this, "Migration:Progress");
 
-    this._wiz = document.documentElement;
+    this._wiz = document.querySelector("wizard");
 
     if ("arguments" in window && !window.arguments[3]) {
       this._source = window.arguments[0];
       this._migrator = window.arguments[1]
         ? window.arguments[1].QueryInterface(kIMig)
         : null;
       this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup);
 
@@ -162,17 +160,17 @@ var MigrationWizard = {
     }
   },
 
   onImportSourcePageAdvanced() {
     var newSource = document.getElementById("importSourceGroup").selectedItem
       .id;
 
     if (newSource == "nothing") {
-      document.documentElement.cancel();
+      document.querySelector("wizard").cancel();
       return;
     }
 
     if (!this._migrator || newSource != this._source) {
       // Create the migrator for the selected source.
       var contractID = kProfileMigratorContractIDPrefix + newSource;
       this._migrator = Cc[contractID].createInstance(kIMig);
 
@@ -199,17 +197,17 @@ var MigrationWizard = {
     }
   },
 
   // 2 - [Profile Selection]
   onSelectProfilePageShow() {
     // Disabling this for now, since we ask about import sources in automigration
     // too and don't want to disable the back button
     // if (this._autoMigrate)
-    //   document.documentElement.getButton("back").disabled = true;
+    //   document.querySelector("wizard").getButton("back").disabled = true;
 
     var profiles = document.getElementById("profiles");
     while (profiles.hasChildNodes()) {
       profiles.lastChild.remove();
     }
 
     if (!this._migrator) {
       return;
--- a/mail/components/migration/content/migration.xul
+++ b/mail/components/migration/content/migration.xul
@@ -1,85 +1,78 @@
 <?xml version="1.0"?>
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
-<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/migration/migration.dtd" >
+<!DOCTYPE window SYSTEM "chrome://messenger/locale/migration/migration.dtd" >
 
-<wizard id="migrationWizard"
+<window id="migrationWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         title="&migrationWizard.title;"
         onload="MigrationWizard.init()"
         onunload="MigrationWizard.uninit()"
         style="width: 40em;"
         branded="true"
         buttons="accept,cancel">
 
   <script src="chrome://messenger/content/migration/migration.js"/>
 
   <stringbundle id="bundle" src="chrome://messenger/locale/migration/migration.properties"/>
 
-  <wizardpage id="importSource" pageid="importSource" next="selectProfile"
-              label="&importSource.title;">
-    <deck id="importSourceFound" selectedIndex="0">
-    <vbox>
+  <wizard>
+    <wizardpage id="importSource" pageid="importSource" next="selectProfile"
+                label="&importSource.title;">
+      <deck id="importSourceFound" selectedIndex="0">
+        <vbox>
 #ifdef XP_WIN
-    <label control="importSourceGroup">&importFromWin.label;</label>
+          <label control="importSourceGroup">&importFromWin.label;</label>
 #else
-    <label control="importSourceGroup">&importFromNonWin.label;</label>
+          <label control="importSourceGroup">&importFromNonWin.label;</label>
 #endif
-
-    <radiogroup id="importSourceGroup">
-
-      <radio id="seamonkey" label="&importFromSeamonkey3.label;"
-             accesskey="&importFromSeamonkey3.accesskey;"/>
-
+          <radiogroup id="importSourceGroup">
+            <radio id="seamonkey" label="&importFromSeamonkey3.label;"
+                   accesskey="&importFromSeamonkey3.accesskey;"/>
 #ifdef XP_WIN
-      <radio id="outlook"   label="&importFromOutlook.label;"   accesskey="&importFromOutlook.accesskey;"/>
+            <radio id="outlook"   label="&importFromOutlook.label;"   accesskey="&importFromOutlook.accesskey;"/>
 #endif
-
-      <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
-    </radiogroup>
-    </vbox>
-    <label>&importSourceNotFound.label;</label>
-    </deck>
-  </wizardpage>
+            <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
+          </radiogroup>
+        </vbox>
+        <label>&importSourceNotFound.label;</label>
+      </deck>
+    </wizardpage>
 
-  <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
-              next="importItems">
-    <label control="profiles">&selectProfile.label;</label>
-    <radiogroup id="profiles" align="start"/>
-  </wizardpage>
+    <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
+                next="importItems">
+      <label control="profiles">&selectProfile.label;</label>
+      <radiogroup id="profiles" align="start"/>
+    </wizardpage>
 
-  <wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
-              next="migrating"
-              oncommand="MigrationWizard.onImportItemCommand();">
-    <description>&importItems.label;</description>
-
-    <vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="start" flex="1"/>
-  </wizardpage>
-
-  <wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
-              next="done">
+    <wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
+                next="migrating"
+                oncommand="MigrationWizard.onImportItemCommand();">
+      <description>&importItems.label;</description>
+      <vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="start" flex="1"/>
+    </wizardpage>
 
-    <description>&migrating.label;</description>
-    <separator class="thin"/>
-    <vbox id="migratingItems" class="indent" style="overflow: auto;" flex="1" align="start"/>
-    <separator class="thin"/>
-
-    <hbox>
-      <html:progress class="progressmeter-statusbar" id="progressBar" flex="1" value="0" max="100"/>
-    </hbox>
+    <wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
+                next="done">
+      <description>&migrating.label;</description>
+      <separator class="thin"/>
+      <vbox id="migratingItems" class="indent" style="overflow: auto;" flex="1" align="start"/>
+      <separator class="thin"/>
+      <hbox>
+        <html:progress class="progressmeter-statusbar" id="progressBar" flex="1" value="0" max="100"/>
+      </hbox>
+    </wizardpage>
 
-  </wizardpage>
-
-  <wizardpage id="done" pageid="done" label="&done.title;">
-    <description>&done.label;</description>
+    <wizardpage id="done" pageid="done" label="&done.title;">
+      <description>&done.label;</description>
+      <separator class="thin"/>
+      <vbox id="doneItems" class="indent" style="overflow: auto;" align="start"/>
+    </wizardpage>
+  </wizard>
+</window>
 
-    <separator class="thin"/>
-    <vbox id="doneItems" class="indent" style="overflow: auto;" align="start"/>
-  </wizardpage>
-</wizard>
-
--- a/mailnews/base/prefs/content/AccountWizard.js
+++ b/mailnews/base/prefs/content/AccountWizard.js
@@ -74,21 +74,23 @@ var gDefaultAccount;
 // will eventually be dumped into the account
 var gCurrentAccountData = null;
 
 // default picker mode for copies and folders
 var gDefaultSpecialFolderPickerMode = "0";
 
 // event handlers
 function onAccountWizardLoad() {
-  document.documentElement.addEventListener("wizardcancel", onCancel);
-  document.documentElement.addEventListener("wizardfinish", FinishAccount);
+  document.querySelector("wizard").addEventListener("wizardcancel", onCancel);
+  document
+    .querySelector("wizard")
+    .addEventListener("wizardfinish", FinishAccount);
   let accounttypePage = document.getElementById("accounttype");
   accounttypePage.addEventListener("pageshow", () => {
-    document.documentElement.canAdvance = true;
+    document.querySelector("wizard").canAdvance = true;
   });
   accounttypePage.addEventListener("pageadvanced", acctTypePageUnload);
   let identityPage = document.getElementById("identitypage");
   identityPage.addEventListener("pageshow", identityPageInit);
   identityPage.addEventListener("pageadvanced", identityPageUnload);
   let incomingPage = document.getElementById("incomingpage");
   incomingPage.addEventListener("pageshow", incomingPageInit);
   incomingPage.addEventListener("pageadvanced", incomingPageUnload);
@@ -798,17 +800,17 @@ function checkForInvalidAccounts() {
     );
     accountData.smtp = MailServices.smtp.defaultServer;
     AccountDataToPageData(accountData, pageData);
 
     gCurrentAccountData = accountData;
 
     setupWizardPanels();
     // Set the page index to identity page.
-    document.documentElement.pageIndex = 1;
+    document.querySelector("wizard").pageIndex = 1;
   }
 }
 
 // sets the page data, automatically creating the arrays as necessary
 function setPageData(pageData, tag, slot, value) {
   if (!pageData[tag]) {
     pageData[tag] = [];
   }
--- a/mailnews/base/prefs/content/AccountWizard.xul
+++ b/mailnews/base/prefs/content/AccountWizard.xul
@@ -1,139 +1,139 @@
 <?xml version="1.0"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://messenger/skin/accountWizard.css" type="text/css"?>
 <?xml-stylesheet type="text/css" href="chrome://messenger/skin/input-fields.css"?>
 
-<!DOCTYPE wizard [
+<!DOCTYPE window [
 <!ENTITY % AccountWizardDTD SYSTEM "chrome://messenger/locale/AccountWizard.dtd">
 %AccountWizardDTD;
 <!ENTITY % newsblogDTD SYSTEM "chrome://messenger-newsblog/locale/am-newsblog.dtd">
 %newsblogDTD;
 ]>
 
-<wizard id="AccountWizard" title="&windowTitle.label;"
+<window id="AccountWizard" title="&windowTitle.label;"
 #ifdef MOZ_THUNDERBIRD
         onload="onAccountWizardLoad(); initAccountWizardTB(window.arguments);"
 #else
         onload="onAccountWizardLoad();"
 #endif
         style="&accountWizard.size;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
-
   <stringbundle id="bundle_prefs" src="chrome://messenger/locale/prefs.properties"/>
   <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
 
   <script src="chrome://global/content/globalOverlay.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
   <script src="chrome://messenger/content/accountUtils.js"/>
   <script src="chrome://messenger/content/amUtils.js"/>
   <script src="chrome://messenger/content/AccountWizard.js"/>
   <script src="chrome://messenger/content/aw-accounttype.js"/>
   <script src="chrome://messenger/content/aw-identity.js"/>
   <script src="chrome://messenger/content/aw-incoming.js"/>
   <script src="chrome://messenger/content/aw-outgoing.js"/>
   <script src="chrome://messenger/content/aw-accname.js"/>
   <script src="chrome://messenger/content/aw-done.js"/>
 
-  <!-- Account Type page : Displays choices of mail and news accounts that user can create -->
-  <wizardpage id="accounttype" pageid="accounttype"
-              label="&accountTypeTitle.label;">
-    <vbox flex="1">
-      <description>&accountSetupInfo2.label;</description>
-      <description>&accountTypeDesc2.label;</description>
-      <label control="acctyperadio">&accountTypeDirections.label;</label>
-      <separator/>
-      <radiogroup id="acctyperadio">
+  <wizard>
+    <!-- Account Type page : Displays choices of mail and news accounts that user can create -->
+    <wizardpage id="accounttype" pageid="accounttype"
+                label="&accountTypeTitle.label;">
+      <vbox flex="1">
+        <description>&accountSetupInfo2.label;</description>
+        <description>&accountTypeDesc2.label;</description>
+        <label control="acctyperadio">&accountTypeDirections.label;</label>
+        <separator/>
+        <radiogroup id="acctyperadio">
 #ifndef MOZ_THUNDERBIRD
-        <radio id="mailaccount" value="mailaccount"
-               label="&accountTypeMail.label;" accesskey="&accountTypeMail.accesskey;"
-               selected="true"/>
+          <radio id="mailaccount" value="mailaccount"
+                 label="&accountTypeMail.label;" accesskey="&accountTypeMail.accesskey;"
+                 selected="true"/>
 #endif
 #ifdef MOZ_MOVEMAIL
-        <radio id="movemailaccount" label="&accountTypeMovemail.label;"
-               accesskey="&accountTypeMovemail.accesskey;"
-               value="movemail"/>
+          <radio id="movemailaccount" label="&accountTypeMovemail.label;"
+                 accesskey="&accountTypeMovemail.accesskey;"
+                 value="movemail"/>
 #endif
 #ifndef MOZ_THUNDERBIRD
-        <radio id="rssaccount" value="rss" label="&feeds.wizardLongName;"
-               accesskey="&feeds.wizardLongName.accesskey;"/>
+          <radio id="rssaccount" value="rss" label="&feeds.wizardLongName;"
+                 accesskey="&feeds.wizardLongName.accesskey;"/>
 #endif
-        <radio id="newsaccount" value="newsaccount"
-               label="&accountTypeNews.label;" accesskey="&accountTypeNews.accesskey;"/>
-      </radiogroup>
-    </vbox>
-  </wizardpage>
+          <radio id="newsaccount" value="newsaccount"
+                 label="&accountTypeNews.label;" accesskey="&accountTypeNews.accesskey;"/>
+        </radiogroup>
+      </vbox>
+    </wizardpage>
 
-  <!-- Identity page : Collects user's full name and email address -->
-  <wizardpage id="identitypage" pageid="identitypage"
-              label="&identityTitle.label;">
-    <vbox>
-      <description flex="1">&identityDesc.label;</description>
-      <separator/>
-      <description flex="1">&fullnameDesc.label; &fullnameExample.label;</description>
-      <separator class="thin"/>
-      <hbox align="center" class="input-container">
-        <label id="fullnameLabel" class="awIdentityLabel" value="&fullnameLabel.label;"
-               accesskey="&fullnameLabel.accesskey;" control="fullName"/>
-        <html:input id="fullName"
-                    type="text"
-                    wsm_persist="true"
-                    name="fullName"
-                    class="input-inline"
-                    aria-labelledby="fullnameLabel"
-                    oninput="identityPageValidate();"/>
-      </hbox>
-      <separator/>
+    <!-- Identity page : Collects user's full name and email address -->
+    <wizardpage id="identitypage" pageid="identitypage"
+                label="&identityTitle.label;">
       <vbox>
-        <hbox>
-          <description id="emailDescText" flex="1"/>
+        <description flex="1">&identityDesc.label;</description>
+        <separator/>
+        <description flex="1">&fullnameDesc.label; &fullnameExample.label;</description>
+        <separator class="thin"/>
+        <hbox align="center" class="input-container">
+          <label id="fullnameLabel" class="awIdentityLabel" value="&fullnameLabel.label;"
+                 accesskey="&fullnameLabel.accesskey;" control="fullName"/>
+          <html:input id="fullName"
+                      type="text"
+                      wsm_persist="true"
+                      name="fullName"
+                      class="input-inline"
+                      aria-labelledby="fullnameLabel"
+                      oninput="identityPageValidate();"/>
         </hbox>
-        <hbox align="center">
-          <label id="emailFieldLabel"
-                 class="awIdentityLabel"
-                 value="&emailLabel.label;"
-                 accesskey="&emailLabel.accesskey;"
-                 control="email"/>
-          <hbox class="uri-element input-container" align="center" flex="1">
-            <html:input id="email"
-                        type="email"
-                        wsm_persist="true"
-                        name="email"
-                        aria-labelledby="emailFieldLabel"
-                        oninput="identityPageValidate();"
-                        class="uri-element input-inline"/>
-            <label id="postEmailText"/>
+        <separator/>
+        <vbox>
+          <hbox>
+            <description id="emailDescText" flex="1"/>
           </hbox>
-        </hbox>
+          <hbox align="center">
+            <label id="emailFieldLabel"
+                   class="awIdentityLabel"
+                   value="&emailLabel.label;"
+                   accesskey="&emailLabel.accesskey;"
+                   control="email"/>
+            <hbox class="uri-element input-container" align="center" flex="1">
+              <html:input id="email"
+                          type="email"
+                          wsm_persist="true"
+                          name="email"
+                          aria-labelledby="emailFieldLabel"
+                          oninput="identityPageValidate();"
+                          class="uri-element input-inline"/>
+              <label id="postEmailText"/>
+            </hbox>
+          </hbox>
+        </vbox>
       </vbox>
-    </vbox>
-  </wizardpage>
+    </wizardpage>
 
-  <!-- Incoming page : User can choose to create mail account of his choice, POP3 or IMAP -->
-  <!-- Collects incoming server name and login name. -->
-  <!-- Login name is prefilled with user id from the email address provided in identity page -->
-  <!-- User can enter a login name here if it is different from the user id of his/her email address -->
-  <wizardpage id="incomingpage" pageid="incomingpage"
-              label="&incomingTitle.label;">
-    <vbox flex="1">
+    <!-- Incoming page : User can choose to create mail account of his choice, POP3 or IMAP -->
+    <!-- Collects incoming server name and login name. -->
+    <!-- Login name is prefilled with user id from the email address provided in identity page -->
+    <!-- User can enter a login name here if it is different from the user id of his/her email address -->
+    <wizardpage id="incomingpage" pageid="incomingpage"
+                label="&incomingTitle.label;">
+      <vbox flex="1">
         <vbox id="serverTypeBox">
-        <label control="servertype">&incomingServerTypeDesc.label;</label>
+          <label control="servertype">&incomingServerTypeDesc.label;</label>
           <separator class="thin"/>
           <hbox align="center" class="serverDataBox">
             <!-- The initial value for the servertype radiogroup is set in onInit() -->
             <radiogroup id="servertype" wsm_persist="true" orient="horizontal">
-                <radio id="pop3" group="servertype" value="pop3" label="&popType.label;"
-                       wsm_persist="true" oncommand="setServerType();" accesskey="&popType.accesskey;"/>
-                <radio id="imap" group="servertype" value="imap" label="&imapType.label;"
-                       wsm_persist="true" oncommand="setServerType();" accesskey="&imapType.accesskey;"/>
+              <radio id="pop3" group="servertype" value="pop3" label="&popType.label;"
+                     wsm_persist="true" oncommand="setServerType();" accesskey="&popType.accesskey;"/>
+              <radio id="imap" group="servertype" value="imap" label="&imapType.label;"
+                     wsm_persist="true" oncommand="setServerType();" accesskey="&imapType.accesskey;"/>
             </radiogroup>
             <label id="serverPortLabel" control="serverPort"
                    accesskey="&portNum.accesskey;"
                    value="&portNum.label;"/>
             <html:input id="serverPort" type="number" class="size3 input-inline" max="65535"/>
             <label id="defaultPortLabel" value="&defaultPortLabel.label;"/>
             <label id="defaultPortValue" value="&defaultPortValue.label;"/>
           </hbox>
@@ -175,188 +175,189 @@
           <html:input id="username"
                       type="text"
                       class="input-inline"
                       wsm_persist="true"
                       aria-labelledby="usernameLabel"
                       oninput="incomingPageValidate();"/>
         </hbox>
         <vbox id="deferStorageBox">
-            <separator class="groove"/>
-            <description> &deferStorageDesc.label;</description>
-            <hbox>
-              <checkbox id="deferStorage"
-                        label="&deferStorage.label;"
-                        accesskey="&deferStorage.accesskey;"
-                        checked="true"
+          <separator class="groove"/>
+          <description> &deferStorageDesc.label;</description>
+          <hbox>
+            <checkbox id="deferStorage"
+                      label="&deferStorage.label;"
+                      accesskey="&deferStorage.accesskey;"
+                      checked="true"
+                      wsm_persist="true"
+                      oncommand="setServerPrefs(this);"/>
+          </hbox>
+        </vbox>
+      </vbox>
+    </wizardpage>
+
+    <!-- Outgoing page : Collects outgoing server name and login name. -->
+    <!-- Outgoing server name is collected if there isn't one already -->
+    <!-- Login name is prefilled with user id from the email address provided in identity page -->
+    <!-- User can enter a login name here if it is different from the user id of his/her email address -->
+    <wizardpage id="outgoingpage" pageid="outgoingpage"
+                label="&outgoingTitle.label;">
+      <vbox flex="1">
+        <vbox id="noSmtp">
+          <description>&outgoingServer.description;</description>
+          <hbox align="center" class="serverDataBox input-container">
+            <label id="smtphostnameLabel" class="label serverLabel"
+                   value="&outgoingServer.label;"
+                   accesskey="&outgoingServer.accesskey;"
+                   control="smtphostname"/>
+            <html:input id="smtphostname"
+                        type="text"
                         wsm_persist="true"
-                        oncommand="setServerPrefs(this);"/>
-            </hbox>
+                        class="uri-element input-inline"
+                        aria-labelledby="smtphostnameLabel"
+                        oninput="outgoingPageValidate();"/>
+          </hbox>
         </vbox>
-    </vbox>
-  </wizardpage>
 
-  <!-- Outgoing page : Collects outgoing server name and login name. -->
-  <!-- Outgoing server name is collected if there isn't one already -->
-  <!-- Login name is prefilled with user id from the email address provided in identity page -->
-  <!-- User can enter a login name here if it is different from the user id of his/her email address -->
-  <wizardpage id="outgoingpage" pageid="outgoingpage"
-              label="&outgoingTitle.label;">
-    <vbox flex="1">
-      <vbox id="noSmtp">
-        <description>&outgoingServer.description;</description>
-        <hbox align="center" class="serverDataBox input-container">
-          <label id="smtphostnameLabel" class="label serverLabel"
-                 value="&outgoingServer.label;"
-                 accesskey="&outgoingServer.accesskey;"
-                 control="smtphostname"/>
-          <html:input id="smtphostname"
+        <vbox id="haveSmtp">
+          <description id="smtpStaticText1"
+                       style="width: 200px;"
+                       prefix="&haveSmtp1.prefix;"
+                       suffix="&haveSmtp1.suffix3; &modifyOutgoing.suffix;">*</description>
+        </vbox>
+
+        <vbox id="loginSet1">
+          <description>&outgoingUsername.description;</description>
+          <separator class="thin"/>
+          <hbox align="center" class="input-container">
+            <label id="smtpusernameLabel" class="label"
+                   value="&outgoingUsername.label;"
+                   style="width: 8em;"
+                   accesskey="&outgoingUsername.accesskey;"
+                   control="smtpusername"/>
+            <html:input id="smtpusername"
+                        type="text"
+                        class="input-inline"
+                        aria-labelledby="smtpusernameLabel"
+                        wsm_persist="true"/>
+          </hbox>
+        </vbox>
+
+        <vbox id="loginSet2" hidden="true">
+          <description id="smtpStaticText2" style="width: 200px;" prefix="&haveSmtp2.prefix;"
+                       suffix="&haveSmtp2.suffix3; &modifyOutgoing.suffix;">*</description>
+        </vbox>
+
+        <vbox id="loginSet3" hidden="true">
+          <description id="smtpStaticText3" style="width: 200px;" prefix="&haveSmtp3.prefix;"
+                       suffix="&haveSmtp3.suffix3; &modifyOutgoing.suffix;">*</description>
+        </vbox>
+
+      </vbox>
+    </wizardpage>
+
+    <!-- News Server page : Collects the News groups server name -->
+    <wizardpage id="newsserver" pageid="newsserver"
+                label="&incomingTitle.label;">
+      <vbox flex="1">
+        <description>&newsServerNameDesc.label;</description>
+        <separator class="thin"/>
+        <hbox align="center" class="input-container">
+          <label id="newsServerLabel" control="newsServer"
+                 value="&newsServerLabel.label;"
+                 accesskey="&newsServerLabel.accesskey;"
+                 style="width: 8em;"/>
+          <html:input id="newsServer"
                       type="text"
                       wsm_persist="true"
                       class="uri-element input-inline"
-                      aria-labelledby="smtphostnameLabel"
-                      oninput="outgoingPageValidate();"/>
+                      aria-labelledby="newsServerLabel"
+                      oninput="incomingPageValidate();"/>
         </hbox>
       </vbox>
+    </wizardpage>
 
-      <vbox id="haveSmtp">
-        <description id="smtpStaticText1"
-                     style="width: 200px;"
-                     prefix="&haveSmtp1.prefix;"
-                     suffix="&haveSmtp1.suffix3; &modifyOutgoing.suffix;">*</description>
-      </vbox>
-
-      <vbox id="loginSet1">
-        <description>&outgoingUsername.description;</description>
+    <!-- Account name page : User gets a choice to enter a pretty name for the account -->
+    <!-- Defaults : Mail account -> Email address, Newsgroup account -> Newsgroup server name -->
+    <wizardpage id="accnamepage" pageid="accnamepage"
+                label="&accnameTitle.label;">
+      <vbox flex="1">
+        <description>&accnameDesc.label;</description>
         <separator class="thin"/>
         <hbox align="center" class="input-container">
-          <label id="smtpusernameLabel" class="label"
-                 value="&outgoingUsername.label;"
+          <label id="prettyNameLabel" class="label"
+                 value="&accnameLabel.label;"
                  style="width: 8em;"
-                 accesskey="&outgoingUsername.accesskey;"
-                 control="smtpusername"/>
-          <html:input id="smtpusername"
+                 accesskey="&accnameLabel.accesskey;"
+                 control="prettyName"/>
+          <html:input id="prettyName"
                       type="text"
+                      size="40"
+                      wsm_persist="true"
                       class="input-inline"
-                      aria-labelledby="smtpusernameLabel"
-                      wsm_persist="true"/>
+                      aria-labelledby="prettyNameLabel"
+                      oninput="acctNamePageValidate();"/>
         </hbox>
       </vbox>
-
-      <vbox id="loginSet2" hidden="true">
-        <description id="smtpStaticText2" style="width: 200px;" prefix="&haveSmtp2.prefix;"
-                     suffix="&haveSmtp2.suffix3; &modifyOutgoing.suffix;">*</description>
-      </vbox>
-
-      <vbox id="loginSet3" hidden="true">
-        <description id="smtpStaticText3" style="width: 200px;" prefix="&haveSmtp3.prefix;"
-                     suffix="&haveSmtp3.suffix3; &modifyOutgoing.suffix;">*</description>
-      </vbox>
-
-    </vbox>
-  </wizardpage>
-
-  <!-- News Server page : Collects the News groups server name -->
-  <wizardpage id="newsserver" pageid="newsserver"
-              label="&incomingTitle.label;">
-    <vbox flex="1">
-      <description>&newsServerNameDesc.label;</description>
-      <separator class="thin"/>
-      <hbox align="center" class="input-container">
-        <label id="newsServerLabel" control="newsServer"
-               value="&newsServerLabel.label;"
-               accesskey="&newsServerLabel.accesskey;"
-               style="width: 8em;"/>
-        <html:input id="newsServer"
-                    type="text"
-                    wsm_persist="true"
-                    class="uri-element input-inline"
-                    aria-labelledby="newsServerLabel"
-                    oninput="incomingPageValidate();"/>
-      </hbox>
-    </vbox>
-  </wizardpage>
-
-  <!-- Account name page : User gets a choice to enter a pretty name for the account -->
-  <!-- Defaults : Mail account -> Email address, Newsgroup account -> Newsgroup server name -->
-  <wizardpage id="accnamepage" pageid="accnamepage"
-              label="&accnameTitle.label;">
-    <vbox flex="1">
-      <description>&accnameDesc.label;</description>
-      <separator class="thin"/>
-      <hbox align="center" class="input-container">
-        <label id="prettyNameLabel" class="label"
-               value="&accnameLabel.label;"
-               style="width: 8em;"
-               accesskey="&accnameLabel.accesskey;"
-               control="prettyName"/>
-        <html:input id="prettyName"
-                    type="text"
-                    size="40"
-                    wsm_persist="true"
-                    class="input-inline"
-                    aria-labelledby="prettyNameLabel"
-                    oninput="acctNamePageValidate();"/>
-      </hbox>
-    </vbox>
-  </wizardpage>
+    </wizardpage>
 
-  <!-- Done page : this page summarizes information collected to create a mail/news account -->
-  <wizardpage id="done" pageid="done"
-              label="&completionTitle.label;">
-    <vbox flex="1">
-      <description>&completionText.label;</description>
-      <separator class="thin"/>
-      <vbox>
-        <hbox id="account.name" equalsize="always" align="start">
-          <label id="account.name.label" flex="1" class="label" value="&accnameLabel.label;"/>
-          <label id="account.name.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="identity.email" equalsize="always" align="start">
-          <label id="identity.email.label" flex="1" class="label" value="&emailLabel.label;"/>
-          <label id="identity.email.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="server.username" equalsize="always" align="start">
-          <label id="server.username.label" flex="1" class="label" value="&incomingUsername.label;"/>
-          <label id="server.username.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="server.name" equalsize="always" align="start">
-          <label id="server.name.label" flex="1" class="label" value="&serverNamePrefix.label;"/>
-          <label id="server.name.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="server.type" equalsize="always" align="start">
-          <label id="server.type.label" flex="1" class="label" value="&serverTypePrefix.label;"/>
-          <label id="server.type.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="server.port" equalsize="always" align="start">
-          <label id="server.port.label" flex="1" class="label" value="&portNum.label;"/>
-          <label id="server.port.text" flex="1" class="label" />
+    <!-- Done page : this page summarizes information collected to create a mail/news account -->
+    <wizardpage id="done" pageid="done"
+                label="&completionTitle.label;">
+      <vbox flex="1">
+        <description>&completionText.label;</description>
+        <separator class="thin"/>
+        <vbox>
+          <hbox id="account.name" equalsize="always" align="start">
+            <label id="account.name.label" flex="1" class="label" value="&accnameLabel.label;"/>
+            <label id="account.name.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="identity.email" equalsize="always" align="start">
+            <label id="identity.email.label" flex="1" class="label" value="&emailLabel.label;"/>
+            <label id="identity.email.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="server.username" equalsize="always" align="start">
+            <label id="server.username.label" flex="1" class="label" value="&incomingUsername.label;"/>
+            <label id="server.username.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="server.name" equalsize="always" align="start">
+            <label id="server.name.label" flex="1" class="label" value="&serverNamePrefix.label;"/>
+            <label id="server.name.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="server.type" equalsize="always" align="start">
+            <label id="server.type.label" flex="1" class="label" value="&serverTypePrefix.label;"/>
+            <label id="server.type.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="server.port" equalsize="always" align="start">
+            <label id="server.port.label" flex="1" class="label" value="&portNum.label;"/>
+            <label id="server.port.text" flex="1" class="label" />
+          </hbox>
+          <hbox id="newsServer.name" equalsize="always" align="start">
+            <label id="newsServer.name.label" flex="1" class="label" value="&newsServerNamePrefix.label;"/>
+            <label id="newsServer.name.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="smtpServer.username" equalsize="always" align="start">
+            <label id="smtpServer.username.label" flex="1" class="label" value="&outgoingUsername.label;"/>
+            <label id="smtpServer.username.text" flex="1" class="label"/>
+          </hbox>
+          <hbox id="smtpServer.name" equalsize="always" align="start">
+            <label id="smtpServer.name.label" flex="1" class="label" value="&smtpServerNamePrefix.label;"/>
+            <label id="smtpServer.name.text" flex="1" class="label"/>
+          </hbox>
+        </vbox>
+        <separator/>
+        <hbox id="downloadMsgsBox">
+          <checkbox id="downloadMsgs"
+                    label="&downloadOnLogin.label;"
+                    accesskey="&downloadOnLogin.accesskey;"
+                    hidden="true"
+                    checked="true"/>
         </hbox>
-        <hbox id="newsServer.name" equalsize="always" align="start">
-          <label id="newsServer.name.label" flex="1" class="label" value="&newsServerNamePrefix.label;"/>
-          <label id="newsServer.name.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="smtpServer.username" equalsize="always" align="start">
-          <label id="smtpServer.username.label" flex="1" class="label" value="&outgoingUsername.label;"/>
-          <label id="smtpServer.username.text" flex="1" class="label"/>
-        </hbox>
-        <hbox id="smtpServer.name" equalsize="always" align="start">
-          <label id="smtpServer.name.label" flex="1" class="label" value="&smtpServerNamePrefix.label;"/>
-          <label id="smtpServer.name.text" flex="1" class="label"/>
-        </hbox>
+        <spacer flex="1"/>
+#ifndef XP_MACOSX
+        <description>&clickFinish.label;</description>
+#else
+        <description>&clickFinish.labelMac;</description>
+#endif
       </vbox>
-      <separator/>
-      <hbox id="downloadMsgsBox">
-        <checkbox id="downloadMsgs"
-                  label="&downloadOnLogin.label;"
-                  accesskey="&downloadOnLogin.accesskey;"
-                  hidden="true"
-                  checked="true"/>
-      </hbox>
-      <spacer flex="1"/>
-#ifndef XP_MACOSX
-      <description>&clickFinish.label;</description>
-#else
-      <description>&clickFinish.labelMac;</description>
-#endif
-    </vbox>
-  </wizardpage>
-</wizard>
+    </wizardpage>
+  </wizard>
+</window>
--- a/mailnews/base/prefs/content/accountUtils.js
+++ b/mailnews/base/prefs/content/accountUtils.js
@@ -222,17 +222,17 @@ function msgOpenAccountWizard(wizardCall
 function initAccountWizardTB(args) {
   let type = args[0] && args[0].acctType;
   let selType = null;
   if (type == "newsgroups") {
     selType = "newsaccount";
   } else if (type == "movemail") {
     selType = "movemail";
   }
-  let accountwizard = document.getElementById("AccountWizard");
+  let accountwizard = document.querySelector("wizard");
   let acctyperadio = document.getElementById("acctyperadio");
   let feedRadio = acctyperadio.querySelector("radio[value='Feeds']");
   if (feedRadio) {
     feedRadio.remove();
   }
   if (selType) {
     acctyperadio.selectedItem = acctyperadio.querySelector(
       "radio[value='" + selType + "']"
--- a/mailnews/base/prefs/content/aw-accname.js
+++ b/mailnews/base/prefs/content/aw-accname.js
@@ -12,17 +12,17 @@ function acctNamePageValidate() {
   var canAdvance = !!accountname;
 
   // Check if this accountname already exists. If so, return false so that
   // user can enter a different unique account name.
   if (canAdvance && accountNameExists(accountname)) {
     canAdvance = false;
   }
 
-  document.documentElement.canAdvance = canAdvance;
+  document.querySelector("wizard").canAdvance = canAdvance;
 }
 
 function acctNamePageUnload() {
   var pageData = parent.GetPageData();
   var accountname = document.getElementById("prettyName").value;
   setPageData(pageData, "accname", "prettyName", accountname);
   // Set this to true so we know the user has set the name.
   setPageData(pageData, "accname", "userset", true);
--- a/mailnews/base/prefs/content/aw-identity.js
+++ b/mailnews/base/prefs/content/aw-identity.js
@@ -30,17 +30,17 @@ function identityPageValidate() {
         parent.AccountExists(email, hostName, serverType) ||
         parent.AccountExists(usernameWithDomain, hostName, serverType)
       ) {
         canAdvance = false;
       }
     }
   }
 
-  document.documentElement.canAdvance = canAdvance;
+  document.querySelector("wizard").canAdvance = canAdvance;
 }
 
 function identityPageUnload() {
   var pageData = parent.GetPageData();
   var name = document.getElementById("fullName").value;
   let email = document.getElementById("email").value.trim();
   setPageData(pageData, "identity", "fullName", name);
   setPageData(pageData, "identity", "email", email);
--- a/mailnews/base/prefs/content/aw-incoming.js
+++ b/mailnews/base/prefs/content/aw-incoming.js
@@ -37,17 +37,17 @@ function incomingPageValidate() {
     if (
       (gProtocolInfo && gProtocolInfo.requiresUsername && !username) ||
       parent.AccountExists(username, hostName, serverType)
     ) {
       canAdvance = false;
     }
   }
 
-  document.documentElement.canAdvance = canAdvance;
+  document.querySelector("wizard").canAdvance = canAdvance;
 }
 
 function incomingPageUnload() {
   var pageData = parent.GetPageData();
 
   if (gOnMailServersPage) {
     var incomingServerName = document.getElementById("incomingServer");
     setPageData(
@@ -70,18 +70,19 @@ function incomingPageUnload() {
     );
   }
 
   return true;
 }
 
 function incomingPageInit() {
   gOnMailServersPage =
-    document.documentElement.currentPage.id == "incomingpage";
-  gOnNewsServerPage = document.documentElement.currentPage.id == "newsserver";
+    document.querySelector("wizard").currentPage.id == "incomingpage";
+  gOnNewsServerPage =
+    document.querySelector("wizard").currentPage.id == "newsserver";
   var pageData = parent.GetPageData();
   if (gOnNewsServerPage) {
     var newsServer = document.getElementById("newsServer");
     if (pageData.newsserver && pageData.newsserver.hostname) {
       newsServer.value = pageData.newsserver.hostname.value;
     }
   }
 
--- a/mailnews/base/prefs/content/aw-outgoing.js
+++ b/mailnews/base/prefs/content/aw-outgoing.js
@@ -19,17 +19,17 @@ function outgoingPageValidate() {
   let canAdvance = true;
 
   let smtpServer = document.getElementById("smtphostname").value;
   let usingDefaultSMTP = document.getElementById("noSmtp").hidden;
   if (!usingDefaultSMTP && !isLegalHostNameOrIP(cleanUpHostName(smtpServer))) {
     canAdvance = false;
   }
 
-  document.documentElement.canAdvance = canAdvance;
+  document.querySelector("wizard").canAdvance = canAdvance;
 }
 
 function outgoingPageUnload() {
   var pageData = parent.GetPageData();
   var username = document.getElementById("username").value;
   let smtpserver = document.getElementById("smtphostname").value;
   setPageData(pageData, "server", "smtphostname", cleanUpHostName(smtpserver));
 
--- a/mailnews/extensions/newsblog/content/feedAccountWizard.js
+++ b/mailnews/extensions/newsblog/content/feedAccountWizard.js
@@ -5,36 +5,35 @@
 
 var { FeedUtils } = ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 
 /* Feed account standalone wizard functions */
 var FeedAccountWizard = {
   accountName: "",
 
   onLoad() {
-    document.documentElement.addEventListener(
-      "wizardfinish",
-      this.onFinish.bind(this)
-    );
+    document
+      .querySelector("wizard")
+      .addEventListener("wizardfinish", this.onFinish.bind(this));
     let accountSetupPage = document.getElementById("accountsetuppage");
     accountSetupPage.addEventListener(
       "pageshow",
       this.accountSetupPageValidate.bind(this)
     );
     accountSetupPage.addEventListener(
       "pagehide",
       this.accountSetupPageValidate.bind(this)
     );
     let donePage = document.getElementById("done");
     donePage.addEventListener("pageshow", this.donePageInit.bind(this));
   },
 
   accountSetupPageValidate() {
     this.accountName = document.getElementById("prettyName").value.trim();
-    document.documentElement.canAdvance = this.accountName;
+    document.querySelector("wizard").canAdvance = this.accountName;
   },
 
   donePageInit() {
     document.getElementById("account.name.text").value = this.accountName;
   },
 
   onFinish() {
     let account = FeedUtils.createRssAccount(this.accountName);
--- a/mailnews/extensions/newsblog/content/feedAccountWizard.xul
+++ b/mailnews/extensions/newsblog/content/feedAccountWizard.xul
@@ -1,68 +1,69 @@
 <?xml version="1.0"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://messenger/skin/accountWizard.css" type="text/css"?>
 <?xml-stylesheet type="text/css" href="chrome://messenger/skin/input-fields.css"?>
 
-<!DOCTYPE wizard [
+<!DOCTYPE window [
   <!ENTITY %  accountDTD SYSTEM "chrome://messenger/locale/AccountWizard.dtd">
   %accountDTD;
   <!ENTITY % newsblogDTD SYSTEM "chrome://messenger-newsblog/locale/am-newsblog.dtd" >
   %newsblogDTD;
   <!ENTITY %       imDTD SYSTEM "chrome://messenger/locale/imAccountWizard.dtd" >
   %imDTD;
 ]>
 
-<wizard id="FeedAccountWizard"
+<window id="FeedAccountWizard"
         title="&feedWindowTitle.label;"
         onload="FeedAccountWizard.onLoad();"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
-
   <script src="chrome://global/content/globalOverlay.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
   <script src="chrome://messenger-newsblog/content/feedAccountWizard.js"/>
 
-  <!-- Account setup page : User gets a choice to enter a name for the account -->
-  <!-- Defaults : Feed account name -> default string -->
-  <wizardpage id="accountsetuppage"
-              pageid="accountsetuppage"
-              label="&accnameTitle.label;">
-    <vbox flex="1">
-      <description>&accnameDesc.label;</description>
-      <separator class="thin"/>
-      <hbox align="center" class="input-container">
-        <label id="prettyNameLabel" class="label"
-               value="&accnameLabel.label;"
-               accesskey="&accnameLabel.accesskey;"
-               control="prettyName"/>
-        <html:input id="prettyName" type="text" class="input-inline"
-                    value="&feeds.accountName;"
-                    aria-labelledby="prettyNameLabel"
-                    oninput="FeedAccountWizard.accountSetupPageValidate();"/>
-      </hbox>
-    </vbox>
-  </wizardpage>
+  <wizard>
+    <!-- Account setup page : User gets a choice to enter a name for the account -->
+    <!-- Defaults : Feed account name -> default string -->
+    <wizardpage id="accountsetuppage"
+                pageid="accountsetuppage"
+                label="&accnameTitle.label;">
+      <vbox flex="1">
+        <description>&accnameDesc.label;</description>
+        <separator class="thin"/>
+        <hbox align="center" class="input-container">
+          <label id="prettyNameLabel" class="label"
+                 value="&accnameLabel.label;"
+                 accesskey="&accnameLabel.accesskey;"
+                 control="prettyName"/>
+          <html:input id="prettyName" type="text" class="input-inline"
+                      value="&feeds.accountName;"
+                      aria-labelledby="prettyNameLabel"
+                      oninput="FeedAccountWizard.accountSetupPageValidate();"/>
+        </hbox>
+      </vbox>
+    </wizardpage>
 
-  <!-- Done page : Summarizes information collected to create a feed account -->
-  <wizardpage id="done"
-              pageid="done"
-              label="&accountSummaryTitle.label;">
-    <vbox flex="1">
-      <description>&accountSummaryInfo.label;</description>
-      <separator class="thin"/>
-      <hbox id="account.name"
-            align="center">
-        <label id="account.name.label"
-               class="label"
-               value="&accnameLabel.label;"/>
-        <label id="account.name.text"
-               class="label"/>
-      </hbox>
-      <separator/>
-      <spacer flex="1"/>
-    </vbox>
-  </wizardpage>
+    <!-- Done page : Summarizes information collected to create a feed account -->
+    <wizardpage id="done"
+                pageid="done"
+                label="&accountSummaryTitle.label;">
+      <vbox flex="1">
+        <description>&accountSummaryInfo.label;</description>
+        <separator class="thin"/>
+        <hbox id="account.name"
+              align="center">
+          <label id="account.name.label"
+                 class="label"
+                 value="&accnameLabel.label;"/>
+          <label id="account.name.text"
+                 class="label"/>
+        </hbox>
+        <separator/>
+        <spacer flex="1"/>
+      </vbox>
+    </wizardpage>
 
-</wizard>
+  </wizard>
+</window>