Bug 1448946 - Replace the Editor overlays with inlining and pre-processing. r=jorgk,frg
authorRichard Marti <richard.marti@gmail.com>
Sat, 31 Mar 2018 12:11:56 +0200
changeset 30759 1ff14a05b2a11739c1bc68ccee89f2804ba233f8
parent 30758 f466d0abed9f578f55e5921b7cc88e38a2778b61
child 30760 3213fa235aef00d065affbe563a05a4469f2e96d
push id2198
push userclokep@gmail.com
push dateMon, 07 May 2018 22:01:28 +0000
treeherdercomm-beta@c31c128cd17a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, frg
bugs1448946
Bug 1448946 - Replace the Editor overlays with inlining and pre-processing. r=jorgk,frg
editor/ui/dialogs/content/EdAdvancedEdit.xul
editor/ui/dialogs/content/EdButtonProps.xul
editor/ui/dialogs/content/EdColorPicker.xul
editor/ui/dialogs/content/EdColorProps.js
editor/ui/dialogs/content/EdColorProps.xul
editor/ui/dialogs/content/EdConvertToTable.xul
editor/ui/dialogs/content/EdDialogOverlay.xul
editor/ui/dialogs/content/EdFieldSetProps.xul
editor/ui/dialogs/content/EdFormProps.xul
editor/ui/dialogs/content/EdHLineProps.xul
editor/ui/dialogs/content/EdImageDialog.js
editor/ui/dialogs/content/EdImageLinkLoader.js
editor/ui/dialogs/content/EdImageOverlay.js
editor/ui/dialogs/content/EdImageOverlay.xul
editor/ui/dialogs/content/EdImageProps.js
editor/ui/dialogs/content/EdImageProps.xul
editor/ui/dialogs/content/EdInputImage.xul
editor/ui/dialogs/content/EdInputProps.xul
editor/ui/dialogs/content/EdInsSrc.xul
editor/ui/dialogs/content/EdInsertChars.xul
editor/ui/dialogs/content/EdInsertMath.xul
editor/ui/dialogs/content/EdInsertTOC.xul
editor/ui/dialogs/content/EdInsertTable.xul
editor/ui/dialogs/content/EdLabelProps.xul
editor/ui/dialogs/content/EdLinkChecker.xul
editor/ui/dialogs/content/EdLinkProps.xul
editor/ui/dialogs/content/EdListProps.xul
editor/ui/dialogs/content/EdNamedAnchorProps.xul
editor/ui/dialogs/content/EdPageProps.xul
editor/ui/dialogs/content/EdSelectProps.xul
editor/ui/dialogs/content/EdSnapToGrid.xul
editor/ui/dialogs/content/EdTableProps.xul
editor/ui/dialogs/content/EdTextAreaProps.xul
editor/ui/dialogs/content/EditConflict.xul
editor/ui/dialogs/content/EditorPublish.xul
editor/ui/dialogs/content/EditorPublishProgress.xul
editor/ui/dialogs/content/EditorPublishSettings.xul
editor/ui/dialogs/content/EditorSaveAsCharset.xul
editor/ui/dialogs/content/edImage.inc
editor/ui/jar.mn
mail/base/content/EdSpellCheckOverlay.js
mail/base/content/EdSpellCheckOverlay.xul
mail/base/jar.mn
mail/components/compose/content/EdColorPropsOverlay.xul
mail/components/compose/content/EdImageOverlayOverlay.xul
mail/components/compose/jar.mn
mailnews/compose/content/mailComposeEditorOverlay.xul
mailnews/jar.mn
suite/mailnews/compose/EdColorPropsOverlay.xul
suite/mailnews/jar.mn
--- a/editor/ui/dialogs/content/EdAdvancedEdit.xul
+++ b/editor/ui/dialogs/content/EdAdvancedEdit.xul
@@ -4,20 +4,18 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- first checkin of the year 2000!      -->
 <!-- Ben Goodger, 12:50AM, 01/00/00 NZST  -->
 
 <?xml-stylesheet href="chrome://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<!-- May not need this here -->
-<!-- <?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?> -->
+<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdAdvancedEdit.dtd">
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdAdvancedEdit.dtd">
 <dialog title="&WindowTitle.label;"
     id="advancedEditDlg"
     style="width: 40em;"
     xmlns ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
--- a/editor/ui/dialogs/content/EdButtonProps.xul
+++ b/editor/ui/dialogs/content/EdButtonProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edButtonProperties SYSTEM "chrome://editor/locale/EditorButtonProperties.dtd">
+%edButtonProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorButtonProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -72,13 +76,17 @@
     </grid>
   </groupbox>
 
   <!-- from EdDialogOverlay -->
   <hbox flex="1" style="margin-top: 0.2em">
     <button id="RemoveButton" label="&RemoveButton.label;" accesskey="&RemoveButton.accesskey;" oncommand="RemoveButton();"/>
     <!-- This will right-align the button -->
     <spacer flex="1"/>
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdColorPicker.xul
+++ b/editor/ui/dialogs/content/EdColorPicker.xul
@@ -1,18 +1,16 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdColorPicker.dtd">
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancelColor();">
 
--- a/editor/ui/dialogs/content/EdColorProps.js
+++ b/editor/ui/dialogs/content/EdColorProps.js
@@ -406,18 +406,36 @@ function ValidateData()
       return true;
     }
   } catch (e) {}
   return false;
 }
 
 function onAccept()
 {
-  if (ValidateData())
-  {
+  // If it's a file, convert to a data URL.
+  if (gBackgroundImage && /^file:/i.test(gBackgroundImage)) {
+    let nsFile = Services.io.newURI(gBackgroundImage)
+      .QueryInterface(Ci.nsIFileURL).file;
+    if (nsFile.exists()) {
+      let reader = new FileReader();
+      reader.addEventListener("load", function() {
+        gBackgroundImage = reader.result;
+        gDialog.BackgroundImageInput.value = reader.result;
+        if (onAccept()) {
+          window.close();
+        }
+      });
+      File.createFromNsIFile(nsFile).then(file => {
+        reader.readAsDataURL(file);
+      });
+      return false; // Don't close just yet...
+    }
+  }
+  if (ValidateData()) {
     // Copy attributes to element we are changing
     try {
       GetCurrentEditor().cloneAttributes(gBodyElement, globalElement);
     } catch (e) {}
 
     SaveWindowLocation();
     return true; // do close the window
   }
--- a/editor/ui/dialogs/content/EdColorProps.xul
+++ b/editor/ui/dialogs/content/EdColorProps.xul
@@ -1,20 +1,24 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorColorProperties.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % edColorPropertiesDTD SYSTEM "chrome://editor/locale/EditorColorProperties.dtd">
+%edColorPropertiesDTD;
+<!ENTITY % composeEditorOverlayDTD SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd">
+%composeEditorOverlayDTD;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
@@ -101,22 +105,31 @@
          tooltiptext="&backgroundImage.tooltip;"
          accesskey="&backgroundImage.accessKey;"/>
   <tooltip id="shortenedDataURI">
     <label value="&backgroundImage.shortenedDataURI;"/>
   </tooltip>
   <textbox id="BackgroundImageInput" class="uri-element" oninput="ChangeBackgroundImage()"
            tooltiptext="&backgroundImage.tooltip;" flex="1"/>
   <hbox align="center">
-    <!-- from EdDialogOverlay.xul 'for' identifies the textfield to get URL from -->
-    <checkbox id="MakeRelativeCheckbox" for="BackgroundImageInput"/>
+    <checkbox id="MakeRelativeCheckbox"
+              for="BackgroundImageInput"
+              label="&makeUrlRelative.label;"
+              accesskey="&makeUrlRelative.accessKey;"
+              oncommand="MakeInputValueRelativeOrAbsolute(this);"
+              tooltiptext="&makeUrlRelative.tooltip;"/>
     <spacer flex="1"/>
-    <!-- from EdDialogOverlay.xul -->
-    <button id="ChooseFile"/>
+    <button id="ChooseFile"
+            oncommand="chooseFile()"
+            label="&chooseFileButton.label;"
+            accesskey="&chooseFileButton.accessKey;"/>
   </hbox>
   <spacer class="smallspacer"/>
   <hbox>
     <spacer flex="1"/>
-    <!-- from EdDialogOverlay.xul -->
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 </dialog>
--- a/editor/ui/dialogs/content/EdConvertToTable.xul
+++ b/editor/ui/dialogs/content/EdConvertToTable.xul
@@ -2,18 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdConvertToTable.dtd">
 
 <dialog title="&windowTitle.label;"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    onload = "Startup()"
    ondialogaccept="return onAccept();"
    ondialogcancel="return onCancel();"
    style="min-width:20em">
deleted file mode 100644
--- a/editor/ui/dialogs/content/EdDialogOverlay.xul
+++ /dev/null
@@ -1,75 +0,0 @@
-<?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/. -->
-
-<!DOCTYPE overlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
-
-<overlay id="EdDialogOverlay"
-     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<vbox id="AdvancedEdit">
-  <hbox flex="1" style="margin-top: 0.2em" align="center">
-    <!-- This will right-align the button -->
-    <spacer flex="1"/>
-    <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
-            accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
-  </hbox>
-  <separator id="advancedSeparator" class="groove"/>
-</vbox>
-
-<!-- Extra buttons to use when just button is needed
-     E.g. Image Properties Dialog switches position between 2 locations
-     Placed here to use same attributes as AdvancedEditButton button
--->
-<button
-  id        = "AdvancedEditButton"
-  oncommand = "onAdvancedEdit();"
-  label     = "&AdvancedEditButton.label;"
-  accesskey = "&AdvancedEditButton.accessKey;"
-  tooltiptext="&AdvancedEditButton.tooltip;"/>
-
-<button
-  id        = "AdvancedEditButton2"
-  oncommand = "onAdvancedEdit()"
-  label     = "&AdvancedEditButton.label;"
-  accesskey = "&AdvancedEditButton.accessKey;"
-  tooltiptext="&AdvancedEditButton.tooltip;"/>
-
-<button
-  id        = "ChooseFile"
-  oncommand = "chooseFile()"
-  label     = "&chooseFileButton.label;"
-  accesskey = "&chooseFileButton.accessKey;"/>
-
-<checkbox
-  id        = "MakeRelativeCheckbox"
-  label     = "&makeUrlRelative.label;"
-  accesskey = "&makeUrlRelative.accessKey;"
-  oncommand = "MakeInputValueRelativeOrAbsolute(this);"
-  tooltiptext = "&makeUrlRelative.tooltip;"/>
-
-<vbox id="LinkLocationBox">
-  <label control="hrefInput" accesskey="&LinkURLEditField2.accessKey;" width="1">&LinkURLEditField2.label;</label>
-  <textbox id="hrefInput" type="autocomplete"
-           autocompletesearch="unifiedcomplete" timeout="50" maxrows="6"
-           class="uri-element padded" oninput="ChangeLinkLocation();">
-    <menupopup class="autocomplete-history-popup"
-               popupalign="topleft" popupanchor="bottomleft"
-               oncommand="this.parentNode.value = event.target.getAttribute('label'); ChangeLinkLocation();"/>
-  </textbox>
-  <hbox align="center">
-    <!-- from EdDialogOverlay.xul 'for' identifies the textfield to get URL from -->
-    <checkbox id="MakeRelativeLink"
-              for="hrefInput"
-              label="&makeUrlRelative.label;"
-              accesskey="&makeUrlRelative.accessKey;"
-              oncommand="MakeInputValueRelativeOrAbsolute(this);"
-              tooltiptext="&makeUrlRelative.tooltip;"/>
-    <spacer flex="1"/>
-    <button label="&chooseFileLinkButton.label;" accesskey="&chooseFileLinkButton.accessKey;" oncommand="chooseLinkFile();"/>
-  </hbox>
-</vbox>
-
-</overlay>
--- a/editor/ui/dialogs/content/EdFieldSetProps.xul
+++ b/editor/ui/dialogs/content/EdFieldSetProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edFieldSetProperties SYSTEM "chrome://editor/locale/EditorFieldSetProperties.dtd">
+%edFieldSetProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorFieldSetProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -47,13 +51,17 @@
     </grid>
   </groupbox>
 
   <!-- from EdDialogOverlay -->
   <hbox flex="1" style="margin-top: 0.2em">
     <button id="RemoveFieldSet" label="&RemoveFieldSet.label;" accesskey="&RemoveFieldSet.accesskey;" oncommand="RemoveFieldSet();"/>
     <!-- This will right-align the button -->
     <spacer flex="1"/>
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdFormProps.xul
+++ b/editor/ui/dialogs/content/EdFormProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edFormProperties SYSTEM "chrome://editor/locale/EditorFormProperties.dtd">
+%edFormProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorFormProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -76,13 +80,17 @@
     </grid>
   </groupbox>
 
   <!-- from EdDialogOverlay -->
   <hbox flex="1" style="margin-top: 0.2em">
     <button id="RemoveForm" label="&RemoveForm.label;" accesskey="&RemoveForm.accesskey;" oncommand="RemoveForm();"/>
     <!-- This will right-align the button -->
     <spacer flex="1"/>
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdHLineProps.xul
+++ b/editor/ui/dialogs/content/EdHLineProps.xul
@@ -2,19 +2,22 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorHLineProperties.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % edHLineProperties SYSTEM "chrome://editor/locale/EditorHLineProperties.dtd">
+%edHLineProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -58,12 +61,16 @@
   </groupbox>
   <spacer class="spacer"/>
   <hbox>
     <button  id="SaveDefault" label="&saveSettings.label;"
          accesskey="&saveSettings.accessKey;"
          oncommand="onSaveDefault()"
          tooltiptext="&saveSettings.tooltip;" />
     <spacer flex="1"/>
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 </dialog>
rename from editor/ui/dialogs/content/EdImageOverlay.js
rename to editor/ui/dialogs/content/EdImageDialog.js
rename from mailnews/compose/content/mailComposeEditorOverlay.xul
rename to editor/ui/dialogs/content/EdImageLinkLoader.js
--- a/mailnews/compose/content/mailComposeEditorOverlay.xul
+++ b/editor/ui/dialogs/content/EdImageLinkLoader.js
@@ -1,157 +1,129 @@
-<?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/. -->
+/* 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/. */
+
+ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-<!DOCTYPE window SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd" >
-
-<overlay id="mailComposeEditorOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+var gMsgCompProcessLink = false;
+var gMsgCompInputElement = null;
+var gMsgCompPrevInputValue = null;
+var gMsgCompPrevMozDoNotSendAttribute;
+var gMsgCompAttachSourceElement = null;
 
-  <script type="application/javascript">
-  <![CDATA[
-    ChromeUtils.import("resource://gre/modules/Services.jsm");
+function OnLoadDialog() {
+  gMsgCompAttachSourceElement = document.getElementById("AttachSourceToMail");
+  var editor = GetCurrentEditor();
+  if (gMsgCompAttachSourceElement && editor &&
+      (editor.flags & Ci.nsIPlaintextEditor.eEditorMailMask))
+  {
+    SetRelativeCheckbox = function() { SetAttachCheckbox();};
+    //initialize the AttachSourceToMail checkbox
+    gMsgCompAttachSourceElement.hidden = false;
 
-    var gMsgCompProcessLink = false;
-    var gMsgCompInputElement = null;
-    var gMsgCompPrevInputValue = null;
-    var gMsgCompPrevMozDoNotSendAttribute;
-    var gMsgCompAttachSourceElement = null;
-
-    function OnLoadOverlay()
+    switch (document.documentElement.id)
+    {
+      case "imageDlg":
+        gMsgCompInputElement = gDialog.srcInput;
+        gMsgCompProcessLink = false;
+        break;
+      case "linkDlg" :
+        gMsgCompInputElement =  gDialog.hrefInput;
+        gMsgCompProcessLink = true;
+        break;
+    }
+    if (gMsgCompInputElement)
     {
-      gMsgCompAttachSourceElement = document.getElementById("AttachSourceToMail");
-      var editor = GetCurrentEditor();
-      if (gMsgCompAttachSourceElement && editor &&
-          (editor.flags & Ci.nsIPlaintextEditor.eEditorMailMask))
-      {
-        SetRelativeCheckbox = function() { SetAttachCheckbox();};
-        //initialize the AttachSourceToMail checkbox
-        gMsgCompAttachSourceElement.hidden = false;
+      SetAttachCheckbox();
+      gMsgCompPrevMozDoNotSendAttribute = globalElement.getAttribute("moz-do-not-send")
+    }
+  }
+}
+addEventListener("load", OnLoadDialog, false);
+
+function OnAcceptDialog() {
+  // Auto-convert file URLs to data URLs. If we're in the link properties
+  // dialog convert only when requested - for the image dialog do it always.
+  if (/^file:/i.test(gMsgCompInputElement.value.trim()) &&
+      (gMsgCompAttachSourceElement.checked || !gMsgCompProcessLink)) {
+    var dataURI = GenerateDataURL(gMsgCompInputElement.value.trim());
+    gMsgCompInputElement.value = dataURI;
+    gMsgCompAttachSourceElement.checked = true;
+  }
+  DoAttachSourceCheckbox();
+}
+addEventListener("dialogaccept", OnAcceptDialog, false);
+
+function SetAttachCheckbox() {
+  var resetCheckbox = false;
+  var mozDoNotSend = globalElement.getAttribute("moz-do-not-send");
 
-        switch (document.documentElement.id)
-        {
-          case "imageDlg":
-            gMsgCompInputElement = gDialog.srcInput;
-            gMsgCompProcessLink = false;
-            break;
-          case "linkDlg" :
-            gMsgCompInputElement =  gDialog.hrefInput;
-            gMsgCompProcessLink = true;
-            break;
-        }
-        if (gMsgCompInputElement)
-        {
-          SetAttachCheckbox();
-          gMsgCompPrevMozDoNotSendAttribute = globalElement.getAttribute("moz-do-not-send")
-        }
+  //In case somebody played with the advanced property and changed the moz-do-not-send attribute
+  if (mozDoNotSend != gMsgCompPrevMozDoNotSendAttribute)
+  {
+    gMsgCompPrevMozDoNotSendAttribute = mozDoNotSend;
+    resetCheckbox = true;
+  }
+
+  // Has the URL changed
+  if (gMsgCompInputElement && gMsgCompInputElement.value != gMsgCompPrevInputValue)
+  {
+    gMsgCompPrevInputValue = gMsgCompInputElement.value;
+    resetCheckbox = true;
+  }
+
+  if (gMsgCompInputElement && resetCheckbox)
+  {
+    // Here is the rule about how to set the checkbox Attach Source To Message:
+    // If the attribute "moz-do-not-send" has not been set, we look at the scheme of the URL
+    // and at some preference to decide what is the best for the user.
+    // If it is set to "false", the checkbox is checked, otherwise unchecked.
+    var attach = false;
+    if (mozDoNotSend == null)
+    {
+      // We haven't yet set the "moz-do-not-send" attribute.
+      var inputValue = gMsgCompInputElement.value.trim();
+      if (/^(file|data):/i.test(inputValue)) {
+        // For files or data URLs, default to attach them.
+        attach = true;
+      } else if (!gMsgCompProcessLink && // Implies image dialogue.
+                 /^https?:/i.test(inputValue)) {
+        // For images loaded via http(s) we default to the preference value.
+        attach = Services.prefs.getBoolPref("mail.compose.attach_http_images");
       }
     }
-    addEventListener("load", OnLoadOverlay, false);
-
-    function OnAcceptOverlay()
-    {
-      // Auto-convert file URLs to data URLs. If we're in the link properties
-      // dialog convert only when requested - for the image dialog do it always.
-      if (/^file:/i.test(gMsgCompInputElement.value.trim()) &&
-          (gMsgCompAttachSourceElement.checked || !gMsgCompProcessLink)) {
-        var dataURI = GenerateDataURL(gMsgCompInputElement.value.trim());
-        gMsgCompInputElement.value = dataURI;
-        gMsgCompAttachSourceElement.checked = true;
-      }
-      DoAttachSourceCheckbox();
-    }
-    addEventListener("dialogaccept", OnAcceptOverlay, false);
-
-    function SetAttachCheckbox()
+    else
     {
-      var resetCheckbox = false;
-      var mozDoNotSend = globalElement.getAttribute("moz-do-not-send");
-
-      //In case somebody played with the advanced property and changed the moz-do-not-send attribute
-      if (mozDoNotSend != gMsgCompPrevMozDoNotSendAttribute)
-      {
-        gMsgCompPrevMozDoNotSendAttribute = mozDoNotSend;
-        resetCheckbox = true;
-      }
-
-      // Has the URL changed
-      if (gMsgCompInputElement && gMsgCompInputElement.value != gMsgCompPrevInputValue)
-      {
-        gMsgCompPrevInputValue = gMsgCompInputElement.value;
-        resetCheckbox = true;
-      }
-
-      if (gMsgCompInputElement && resetCheckbox)
-      {
-        // Here is the rule about how to set the checkbox Attach Source To Message:
-        // If the attribute "moz-do-not-send" has not been set, we look at the scheme of the URL
-        // and at some preference to decide what is the best for the user.
-        // If it is set to "false", the checkbox is checked, otherwise unchecked.
-        var attach = false;
-        if (mozDoNotSend == null)
-        {
-          // We haven't yet set the "moz-do-not-send" attribute.
-          var inputValue = gMsgCompInputElement.value.trim();
-          if (/^(file|data):/i.test(inputValue)) {
-            // For files or data URLs, default to attach them.
-            attach = true;
-          } else if (!gMsgCompProcessLink && // Implies image dialogue.
-                     /^https?:/i.test(inputValue)) {
-            // For images loaded via http(s) we default to the preference value.
-            attach = Services.prefs.getBoolPref("mail.compose.attach_http_images");
-          }
-        }
-        else
-        {
-          attach = (mozDoNotSend == "false");
-        }
-
-        gMsgCompAttachSourceElement.checked = attach;
-      }
+      attach = (mozDoNotSend == "false");
     }
 
-    function DoAttachSourceCheckbox()
-    {
-      gMsgCompPrevMozDoNotSendAttribute = (!gMsgCompAttachSourceElement.checked).toString();
-      globalElement.setAttribute("moz-do-not-send", gMsgCompPrevMozDoNotSendAttribute);
-    }
+    gMsgCompAttachSourceElement.checked = attach;
+  }
+}
+
+function DoAttachSourceCheckbox() {
+  gMsgCompPrevMozDoNotSendAttribute = (!gMsgCompAttachSourceElement.checked).toString();
+  globalElement.setAttribute("moz-do-not-send", gMsgCompPrevMozDoNotSendAttribute);
+}
 
-    function GenerateDataURL(url) {
-      var file = Services.io.newURI(url)
-        .QueryInterface(Ci.nsIFileURL).file;
-      var contentType = Cc["@mozilla.org/mime;1"]
-        .getService(Ci.nsIMIMEService)
-        .getTypeFromFile(file);
-      var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
-        .createInstance(Ci.nsIFileInputStream);
-      inputStream.init(file, 0x01, 0o600, 0);
-      var stream = Cc["@mozilla.org/binaryinputstream;1"]
-        .createInstance(Ci.nsIBinaryInputStream);
-      stream.setInputStream(inputStream);
-      let data = "";
-      while (stream.available() > 0) {
-        data += stream.readBytes(stream.available());
-      }
-      let encoded = btoa(data);
-      stream.close();
-      return "data:" + contentType +
-        ";filename=" + encodeURIComponent(file.leafName) +
-        ";base64," + encoded;
-    }
-  ]]>
-  </script>
-
-  <hbox id="MakeRelativeHbox">
-    <checkbox id="AttachSourceToMail" hidden="true"
-              label="&attachImageSource.label;" accesskey="&attachImageSource.accesskey;"
-              insertafter="MakeRelativeCheckbox" oncommand="DoAttachSourceCheckbox()"/>
-  </hbox>
-
-  <groupbox id="LinkURLBox">
-    <checkbox id="AttachSourceToMail" hidden="true"
-              label="&attachLinkSource.label;" accesskey="&attachLinkSource.accesskey;"
-              insertafter="LinkLocationBox" oncommand="DoAttachSourceCheckbox()"/>
-  </groupbox>
-
-</overlay>
+function GenerateDataURL(url) {
+  var file = Services.io.newURI(url)
+    .QueryInterface(Ci.nsIFileURL).file;
+  var contentType = Cc["@mozilla.org/mime;1"]
+    .getService(Ci.nsIMIMEService)
+    .getTypeFromFile(file);
+  var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
+    .createInstance(Ci.nsIFileInputStream);
+  inputStream.init(file, 0x01, 0o600, 0);
+  var stream = Cc["@mozilla.org/binaryinputstream;1"]
+    .createInstance(Ci.nsIBinaryInputStream);
+  stream.setInputStream(inputStream);
+  let data = "";
+  while (stream.available() > 0) {
+    data += stream.readBytes(stream.available());
+  }
+  let encoded = btoa(data);
+  stream.close();
+  return "data:" + contentType +
+    ";filename=" + encodeURIComponent(file.leafName) +
+    ";base64," + encoded;
+}
--- a/editor/ui/dialogs/content/EdImageProps.js
+++ b/editor/ui/dialogs/content/EdImageProps.js
@@ -115,19 +115,16 @@ function Startup()
   if (gDialog.linkTab && "arguments" in window && window.arguments[1])
   {
     document.getElementById("TabBox").selectedTab = gDialog.linkTab;
     SetTextboxFocus(gDialog.hrefInput);
   }
   else
     SetTextboxFocus(gDialog.srcInput);
 
-  // Hide the separator from EdDialogOverlay.xul as we show our own
-  document.getElementById("advancedSeparator").hidden = true;
-
   SetWindowLocation();
 }
 
 // Set dialog widgets with attribute data
 // We get them from globalElement copy so this can be used
 //   by AdvancedEdit(), which is shared by all property dialogs
 function InitDialog()
 {
--- a/editor/ui/dialogs/content/EdImageProps.xul
+++ b/editor/ui/dialogs/content/EdImageProps.xul
@@ -1,52 +1,76 @@
 <?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/. -->
+# 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdImageOverlay.xul"?>
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorImageProperties.dtd">
-
+<!DOCTYPE dialog [
+<!ENTITY % edImageProperties SYSTEM "chrome://editor/locale/EditorImageProperties.dtd">
+%edImageProperties;
+<!ENTITY % composeEditorOverlayDTD SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd">
+%composeEditorOverlayDTD;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <!-- dialog containing a control requiring initial setup -->
 <dialog id="imageDlg" title="&windowTitle.label;"
     xmlns ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     buttons="accept,cancel"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdImageProps.js"/>
+  <script type="application/javascript" src="chrome://editor/content/EdImageDialog.js"/>
+  <script type="application/javascript" src="chrome://editor/content/EdImageLinkLoader.js"/>
 
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
   <broadcaster id="args" value=""/>
 
   <tabbox id="TabBox">
     <tabs flex="1">
-      <tab id="imageLocationTab"/>
-      <tab id="imageDimensionsTab"/>
-      <tab id="imageAppearanceTab"/>
-      <tab id="imageLinkTab"/>
+      <tab id="imageLocationTab" label="&imageLocationTab.label;"/>
+      <tab id="imageDimensionsTab" label="&imageDimensionsTab.label;"/>
+      <tab id="imageAppearanceTab" label="&imageAppearanceTab.label;"/>
+      <tab id="imageLinkTab" label="&imageLinkTab.label;"/>
     </tabs>
     <tabpanels>
-      <!-- panels overlaid from EdImageOverlay.xul -->
-      <vbox id="imageLocation"/>
-      <vbox id="imageDimensions"/>
-      <hbox id="imageAppearance"/>
+#include edImage.inc
       <vbox>
         <spacer class="spacer"/>
-        <vbox id="LinkLocationBox"/>
+        <vbox id="LinkLocationBox">
+          <label control="hrefInput"
+                 accesskey="&LinkURLEditField2.accessKey;"
+                 width="1">&LinkURLEditField2.label;</label>
+          <textbox id="hrefInput" type="autocomplete"
+                   autocompletesearch="unifiedcomplete" timeout="50" maxrows="6"
+                   class="uri-element padded" oninput="ChangeLinkLocation();">
+            <menupopup class="autocomplete-history-popup"
+                       popupalign="topleft" popupanchor="bottomleft"
+                       oncommand="this.parentNode.value = event.target.getAttribute('label'); ChangeLinkLocation();"/>
+          </textbox>
+          <hbox align="center">
+            <checkbox id="MakeRelativeLink"
+                      for="hrefInput"
+                      label="&makeUrlRelative.label;"
+                      accesskey="&makeUrlRelative.accessKey;"
+                      oncommand="MakeInputValueRelativeOrAbsolute(this);"
+                      tooltiptext="&makeUrlRelative.tooltip;"/>
+            <spacer flex="1"/>
+            <button label="&chooseFileLinkButton.label;" accesskey="&chooseFileLinkButton.accessKey;"
+                    oncommand="chooseLinkFile();"/>
+          </hbox>
+        </vbox>
         <spacer class="spacer"/>
         <hbox>
           <checkbox id="showLinkBorder"
                     label="&showImageLinkBorder.label;"
                     accesskey="&showImageLinkBorder.accessKey;"
                     oncommand="ToggleShowLinkBorder();"/>
           <spacer flex="1"/>
           <button id="LinkAdvancedEditButton"
@@ -55,16 +79,44 @@
                   tooltiptext="&LinkAdvancedEditButton.tooltip;"
                   oncommand="onLinkAdvancedEdit();"/>
         </hbox>
       </vbox>
     </tabpanels>
   </tabbox>
 
   <hbox align="end">
-    <groupbox id="imagePreview"/>
+    <groupbox id="imagePreview" orient="horizontal" flex="1">
+      <caption label="&previewBox.label;"/>
+      <hbox id="preview-image-box" align="center">
+        <spacer flex="1"/>
+        <description id="preview-image-holder"/>
+        <spacer flex="1"/>
+      </hbox>
+      <vbox id="PreviewSize" collapsed="true">
+        <spacer flex="1"/>
+        <label value="&actualSize.label;"/>
+        <hbox>
+          <label value="&widthEditField.label;"/>
+          <spacer flex="1"/>
+          <label id="PreviewWidth"/>
+        </hbox>
+        <hbox>
+          <label value="&heightEditField.label;"/>
+          <spacer flex="1"/>
+          <label id="PreviewHeight"/>
+        </hbox>
+        <spacer flex="1"/>
+      </vbox>
+    </groupbox>
 
-    <!-- from EdDialogOverlay -->
-    <vbox id="AdvancedEdit"/>
+    <vbox id="AdvancedEdit">
+      <hbox flex="1" style="margin-top: 0.2em" align="center">
+        <!-- This will right-align the button -->
+        <spacer flex="1"/>
+        <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+                accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+      </hbox>
+    </vbox>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdInputImage.xul
+++ b/editor/ui/dialogs/content/EdInputImage.xul
@@ -1,40 +1,47 @@
 <?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/. -->
+# 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdImageOverlay.xul"?>
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edInputProperties SYSTEM "chrome://editor/locale/EditorInputProperties.dtd">
+%edInputProperties;
+<!ENTITY % edImageProperties SYSTEM "chrome://editor/locale/EditorImageProperties.dtd">
+%edImageProperties;
+<!ENTITY % composeEditorOverlayDTD SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd">
+%composeEditorOverlayDTD;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInputProperties.dtd">
 <dialog title="&windowTitleImage.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
-  <!-- Methods common to all editor dialogs -->
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdInputImage.js"/>
+  <script type="application/javascript" src="chrome://editor/content/EdImageDialog.js"/>
 
   <broadcaster id="args" value=""/>
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
 
   <tabbox id="TabBox">
     <tabs flex="1">
-      <tab id="imageInputTab"/>
-      <tab id="imageLocationTab"/>
-      <tab id="imageDimensionsTab"/>
-      <tab id="imageAppearanceTab"/>
+      <tab id="imageInputTab" label="&imageInputTab.label;"/>
+      <tab id="imageLocationTab" label="&imageLocationTab.label;"/>
+      <tab id="imageDimensionsTab" label="&imageDimensionsTab.label;"/>
+      <tab id="imageAppearanceTab" label="&imageAppearanceTab.label;"/>
     </tabs>
     <tabpanels>
       <groupbox><caption label="&InputSettings.label;"/>
         <grid><columns><column/><column/></columns>
           <rows>
             <row align="center">
               <label value="&InputName.label;"/>
               <textbox id="InputName"/>
@@ -47,25 +54,49 @@
               <label value="&tabIndex.label;"/>
               <hbox>
                 <textbox id="InputTabIndex" class="narrow" oninput="forceInteger(this.id);"/>
               </hbox>
             </row>
           </rows>
         </grid>
       </groupbox>
-
-      <!-- panels overlaid from EdImageOverlay.xul -->
-      <vbox id="imageLocation"/>
-      <vbox id="imageDimensions"/>
-      <hbox id="imageAppearance"/>
-
+#include edImage.inc
     </tabpanels>
   </tabbox>
 
   <hbox align="end">
-    <groupbox id="imagePreview"/>
+    <groupbox id="imagePreview" orient="horizontal" flex="1">
+      <caption label="&previewBox.label;"/>
+      <hbox id="preview-image-box" align="center">
+        <spacer flex="1"/>
+        <description id="preview-image-holder"/>
+        <spacer flex="1"/>
+      </hbox>
+      <vbox id="PreviewSize" collapsed="true">
+        <spacer flex="1"/>
+        <label value="&actualSize.label;"/>
+        <hbox>
+          <label value="&widthEditField.label;"/>
+          <spacer flex="1"/>
+          <label id="PreviewWidth"/>
+        </hbox>
+        <hbox>
+          <label value="&heightEditField.label;"/>
+          <spacer flex="1"/>
+          <label id="PreviewHeight"/>
+        </hbox>
+        <spacer flex="1"/>
+      </vbox>
+    </groupbox>
 
-    <!-- from EdDialogOverlay -->
-    <vbox id="AdvancedEdit"/>
+    <vbox id="AdvancedEdit">
+      <hbox flex="1" style="margin-top: 0.2em" align="center">
+        <!-- This will right-align the button -->
+        <spacer flex="1"/>
+        <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+                accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+      </hbox>
+      <separator id="advancedSeparator" class="groove"/>
+    </vbox>
   </hbox>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdInputProps.xul
+++ b/editor/ui/dialogs/content/EdInputProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edInputProperties SYSTEM "chrome://editor/locale/EditorInputProperties.dtd">
+%edInputProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInputProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -110,15 +114,19 @@
     </grid>
   </groupbox>
 
   <!-- from EdDialogOverlay -->
   <hbox flex="1" style="margin-top: 0.2em">
     <!-- This will right-align the button -->
     <spacer flex="1"/>
     <deck id="AdvancedEditDeck">
-      <button id="AdvancedEditButton"/>
+      <button id="AdvancedEditButton"
+        oncommand="onAdvancedEdit();"
+        label="&AdvancedEditButton.label;"
+        accesskey="&AdvancedEditButton.accessKey;"
+        tooltiptext="&AdvancedEditButton.tooltip;"/>
       <button label="&ImageProperties.label;" accesskey="&ImageProperties.accesskey;" oncommand="doImageProperties();"/>
     </deck>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdInsSrc.xul
+++ b/editor/ui/dialogs/content/EdInsSrc.xul
@@ -2,18 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInsertSource.dtd">
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     buttonlabelaccept="&insertButton.label;"
     buttonaccesskeyaccept="&insertButton.accesskey;"
     ondialogaccept="return onAccept();"
--- a/editor/ui/dialogs/content/EdInsertChars.xul
+++ b/editor/ui/dialogs/content/EdInsertChars.xul
@@ -1,18 +1,16 @@
 <?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://editor/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInsertChars.dtd">
 
 <dialog id="insertCharsDlg" title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload = "Startup()"
         onfocus = "onFocus()"
         buttonlabelaccept="&insertButton.label;"
         buttonlabelcancel="&closeButton.label;"
--- a/editor/ui/dialogs/content/EdInsertMath.xul
+++ b/editor/ui/dialogs/content/EdInsertMath.xul
@@ -2,18 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInsertMath.dtd">
 
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttonlabelaccept="&insertButton.label;"
         buttonaccesskeyaccept="&insertButton.accesskey;"
         ondialogaccept="return onAccept();"
--- a/editor/ui/dialogs/content/EdInsertTOC.xul
+++ b/editor/ui/dialogs/content/EdInsertTOC.xul
@@ -2,19 +2,16 @@
 <!-- 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"?>
 <?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInsertTOC.dtd">
 
 <dialog title="&Window.title;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:html="http://www.w3.org/1999/xhtml"
     onload="Startup();"
     ondialogaccept="return BuildTOC(true);"
     oncancel="window.close(); return true;">
--- a/editor/ui/dialogs/content/EdInsertTable.xul
+++ b/editor/ui/dialogs/content/EdInsertTable.xul
@@ -2,19 +2,22 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorInsertTable.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % edInsertTable SYSTEM "chrome://editor/locale/EditorInsertTable.dtd">
+%edInsertTable;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -62,11 +65,18 @@
   <hbox align="center">
     <label control="borderInput" class="align-right"
         value="&borderEditField.label;"
         accesskey="&borderEditField.accessKey;"
         tooltiptext="&borderEditField.tooltip;" />
     <textbox class="narrow" id="borderInput" oninput="forceInteger(this.id)" />
     <label value="&pixels.label;"/>
   </hbox>
-  <!-- from EdDialogOverlay -->
-  <vbox id="AdvancedEdit"/>
+  <vbox id="AdvancedEdit">
+    <hbox flex="1" style="margin-top: 0.2em" align="center">
+      <!-- This will right-align the button -->
+      <spacer flex="1"/>
+      <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+              accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+    </hbox>
+    <separator id="advancedSeparator" class="groove"/>
+  </vbox>
 </dialog>
--- a/editor/ui/dialogs/content/EdLabelProps.xul
+++ b/editor/ui/dialogs/content/EdLabelProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edLabelProperties SYSTEM "chrome://editor/locale/EditorLabelProperties.dtd">
+%edLabelProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorLabelProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -46,13 +50,17 @@
     </grid>
   </groupbox>
 
   <!-- from EdDialogOverlay -->
   <hbox flex="1" style="margin-top: 0.2em">
     <button id="RemoveLabel" label="&RemoveLabel.label;" accesskey="&RemoveLabel.accesskey;" oncommand="RemoveLabel();"/>
     <!-- This will right-align the button -->
     <spacer flex="1"/>
-    <button id="AdvancedEditButton"/>
+    <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
   </hbox>
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdLinkChecker.xul
+++ b/editor/ui/dialogs/content/EdLinkChecker.xul
@@ -1,28 +1,25 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdLinkChecker.dtd">
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdLinkChecker.dtd">
-<!-- dialog containing a control requiring initial setup -->
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     buttonlabelcancel="&closeButton.label;"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancelLinkChecker();">
 
-  <!-- Methods common to all editor dialogs -->
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdLinkChecker.js"/>
 
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
   <broadcaster id="args" value=""/>
 
   <listbox rows="8" id="LinksList" class="MinWidth20" flex="1"/>
--- a/editor/ui/dialogs/content/EdLinkProps.xul
+++ b/editor/ui/dialogs/content/EdLinkProps.xul
@@ -2,41 +2,80 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorLinkProperties.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % linkPropertiesDTD SYSTEM "chrome://editor/locale/EditorLinkProperties.dtd">
+%linkPropertiesDTD;
+<!ENTITY % composeEditorOverlayDTD SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd">
+%composeEditorOverlayDTD;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog id="linkDlg" title="&windowTitle.label;"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    onload = "Startup()"
    ondialogaccept="return onAccept();"
    ondialogcancel="return onCancel();">
 
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdLinkProps.js"/>
+  <script type="application/javascript" src="chrome://editor/content/EdImageLinkLoader.js"/>
 
   <broadcaster id="args" value=""/>
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
 
   <vbox style="min-width: 20em">
     <groupbox><caption id="linkTextCaption"/>
       <vbox>
         <label id="linkTextMessage" control="linkTextInput"/>
         <textbox id="linkTextInput"/>
       </vbox>
     </groupbox>
 
     <groupbox id="LinkURLBox"><caption label="&LinkURLBox.label;"/>
-      <vbox id="LinkLocationBox"/>
-      <!-- mail compose will insert custom item here defined in mailComposeEditorOverlay.xul -->
+      <vbox id="LinkLocationBox">
+        <label control="hrefInput"
+               accesskey="&LinkURLEditField2.accessKey;"
+               width="1">&LinkURLEditField2.label;</label>
+        <textbox id="hrefInput" type="autocomplete"
+                 autocompletesearch="unifiedcomplete" timeout="50" maxrows="6"
+                 class="uri-element padded" oninput="ChangeLinkLocation();">
+          <menupopup class="autocomplete-history-popup"
+                     popupalign="topleft" popupanchor="bottomleft"
+                     oncommand="this.parentNode.value = event.target.getAttribute('label'); ChangeLinkLocation();"/>
+        </textbox>
+        <hbox align="center">
+          <checkbox id="MakeRelativeLink"
+                    for="hrefInput"
+                    label="&makeUrlRelative.label;"
+                    accesskey="&makeUrlRelative.accessKey;"
+                    oncommand="MakeInputValueRelativeOrAbsolute(this);"
+                    tooltiptext="&makeUrlRelative.tooltip;"/>
+          <spacer flex="1"/>
+          <button label="&chooseFileLinkButton.label;" accesskey="&chooseFileLinkButton.accessKey;"
+                  oncommand="chooseLinkFile();"/>
+        </hbox>
+      </vbox>
+      <checkbox id="AttachSourceToMail"
+                hidden="true"
+                label="&attachLinkSource.label;"
+                accesskey="&attachLinkSource.accesskey;"
+                oncommand="DoAttachSourceCheckbox()"/>
     </groupbox>
   </vbox>
-  <!-- from EdDialogOverlay -->
-  <vbox id="AdvancedEdit"/>
+  <vbox id="AdvancedEdit">
+    <hbox flex="1" style="margin-top: 0.2em" align="center">
+      <!-- This will right-align the button -->
+      <spacer flex="1"/>
+      <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+              accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+    </hbox>
+    <separator id="advancedSeparator" class="groove"/>
+  </vbox>
 </dialog>
--- a/editor/ui/dialogs/content/EdListProps.xul
+++ b/editor/ui/dialogs/content/EdListProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edListProperties SYSTEM "chrome://editor/locale/EditorListProperties.dtd">
+%edListProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorListProperties.dtd">
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
@@ -49,11 +53,18 @@
       <textbox class="narrow" id="StartingNumber"/>
       <spacer/>
     </hbox>
   </groupbox>
   <radiogroup id="RadioGroup" index="0" persist="index">
     <radio id="ChangeAll"      label="&changeEntireListRadio.label;" accesskey="&changeEntireListRadio.accessKey;"/>
     <radio id="ChangeSelected" label="&changeSelectedRadio.label;"   accesskey="&changeSelectedRadio.accessKey;"/>
   </radiogroup>
-  <!-- from EdDialogOverlay -->
-  <vbox id="AdvancedEdit"/>
+  <vbox id="AdvancedEdit">
+    <hbox flex="1" style="margin-top: 0.2em" align="center">
+      <!-- This will right-align the button -->
+      <spacer flex="1"/>
+      <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+              accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+    </hbox>
+    <separator id="advancedSeparator" class="groove"/>
+  </vbox>
 </dialog>
--- a/editor/ui/dialogs/content/EdNamedAnchorProps.xul
+++ b/editor/ui/dialogs/content/EdNamedAnchorProps.xul
@@ -2,19 +2,22 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EdNamedAnchorProperties.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % edNamedAnchorProperties SYSTEM "chrome://editor/locale/EdNamedAnchorProperties.dtd">
+%edNamedAnchorProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -25,11 +28,18 @@
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
 
   <label control="nameInput"
          value="&anchorNameEditField.label;"
          accesskey="&anchorNameEditField.accessKey;"/>
   <textbox class="MinWidth20em" id="nameInput" oninput="ChangeName()"
              tooltiptext="&nameInput.tooltip;"/>
   <spacer class="spacer"/>
-  <!-- from EdDialogOverlay -->
-  <vbox id="AdvancedEdit"/>
+  <vbox id="AdvancedEdit">
+    <hbox flex="1" style="margin-top: 0.2em" align="center">
+      <!-- This will right-align the button -->
+      <spacer flex="1"/>
+      <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+              accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+    </hbox>
+    <separator id="advancedSeparator" class="groove"/>
+  </vbox>
 </dialog>
--- a/editor/ui/dialogs/content/EdPageProps.xul
+++ b/editor/ui/dialogs/content/EdPageProps.xul
@@ -1,28 +1,24 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorPageProperties.dtd">
 
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
-  <!-- Methods common to all editor dialogs -->
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdPageProps.js"/>
 
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
   <broadcaster id="args" value=""/>
   <grid>
     <columns><column flex="1"/><column flex="2"/></columns>
--- a/editor/ui/dialogs/content/EdSelectProps.xul
+++ b/editor/ui/dialogs/content/EdSelectProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edSelectProperties SYSTEM "chrome://editor/locale/EditorSelectProperties.dtd">
+%edSelectProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorSelectProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -114,16 +118,20 @@
         <button label="&AddOptGroup.label;" accesskey="&AddOptGroup.accesskey;" oncommand="AddOptGroup();"/>
         <button id="RemoveButton" label="&RemoveElement.label;" accesskey="&RemoveElement.accesskey;"
                 oncommand="RemoveElement();" disabled="true"/>
         <button id="PreviousButton" label="&MoveElementUp.label;" accesskey="&MoveElementUp.accesskey;"
                 oncommand="currentItem.moveUp();" disabled="true" type="row"/>
         <button id="NextButton" label="&MoveElementDown.label;" accesskey="&MoveElementDown.accesskey;"
                 oncommand="currentItem.moveDown();" disabled="true" type="row"/>
         <spacer flex="1"/>
-        <button id="AdvancedEditButton"/>
+        <button id="AdvancedEditButton"
+                oncommand="onAdvancedEdit();"
+                label="&AdvancedEditButton.label;"
+                accesskey="&AdvancedEditButton.accessKey;"
+                tooltiptext="&AdvancedEditButton.tooltip;"/>
       </vbox>
     </hbox>
   </vbox>
 
   <separator class="groove"/>
 
 </dialog>
--- a/editor/ui/dialogs/content/EdSnapToGrid.xul
+++ b/editor/ui/dialogs/content/EdSnapToGrid.xul
@@ -1,19 +1,16 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorSnapToGrid.dtd">
 
 <dialog title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();">
 
--- a/editor/ui/dialogs/content/EdTableProps.xul
+++ b/editor/ui/dialogs/content/EdTableProps.xul
@@ -2,19 +2,22 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorTableProperties.dtd">
+<!DOCTYPE dialog [
+<!ENTITY % edTableProperties SYSTEM "chrome://editor/locale/EditorTableProperties.dtd">
+%edTableProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
 <dialog title="&tableWindow.title;"
     id="tableDlg"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="Startup()"
     buttons="accept,extra1,cancel"
     buttonlabelclose="&closeButton.label;"
     buttonlabelextra1="&applyButton.label;"
@@ -126,18 +129,21 @@
             <spacer id="tableBackgroundCW" class="color-well"/>
           </button>
           <spacer class="spacer"/>
           <label id="TableInheritColor" value="&tableInheritColor.label;" collapsed="true"/>
         </hbox>
         <separator class="groove"/>
         <hbox flex="1" align="center">
           <spacer flex="1"/>
-          <!-- From EdDialogOvlerlay.xul -->
-          <button id="AdvancedEditButton"/>
+          <button id="AdvancedEditButton"
+            oncommand="onAdvancedEdit();"
+            label="&AdvancedEditButton.label;"
+            accesskey="&AdvancedEditButton.accessKey;"
+            tooltiptext="&AdvancedEditButton.tooltip;"/>
         </hbox>
         <spacer flex="1"/>
       </vbox><!-- Table Panel -->
 
       <!-- CELL PANEL -->
       <vbox>
         <groupbox orient="horizontal" align="center">
           <caption label="&cellSelection.label;"/>
@@ -250,17 +256,20 @@
             <spacer id="cellBackgroundCW" class="color-well"/>
           </button>
           <spacer class="spacer"/>
           <label id="CellInheritColor" value="&cellInheritColor.label;" collapsed="true"/>
         </hbox>
         <separator class="groove"/>
         <hbox align="center">
           <description class="wrap" flex="1" style="width: 1em">&cellUseCheckboxHelp.label;</description>
-          <!-- From EdDialogOvlerlay.xul -->
-          <button id="AdvancedEditButton2"/>
+          <button id="AdvancedEditButton2"
+                  oncommand="onAdvancedEdit()"
+                  label="&AdvancedEditButton.label;"
+                  accesskey="&AdvancedEditButton.accessKey;"
+                  tooltiptext="&AdvancedEditButton.tooltip;"/>
         </hbox>
         <spacer flex="1"/>
       </vbox><!-- Cell Panel -->
     </tabpanels>
   </tabbox>
   <spacer class="spacer"/>
 </dialog>
--- a/editor/ui/dialogs/content/EdTextAreaProps.xul
+++ b/editor/ui/dialogs/content/EdTextAreaProps.xul
@@ -1,19 +1,23 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog [
+<!ENTITY % edTextAreaProperties SYSTEM "chrome://editor/locale/EditorTextAreaProperties.dtd">
+%edTextAreaProperties;
+<!ENTITY % edDialogOverlay SYSTEM "chrome://editor/locale/EdDialogOverlay.dtd">
+%edDialogOverlay;
+]>
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorTextAreaProperties.dtd">
 <dialog title="&windowTitle.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup();"
         buttons="accept,cancel"
         ondialogaccept="return onAccept();"
         ondialogcancel="return onCancel();">
 
   <!-- Methods common to all editor dialogs -->
@@ -92,12 +96,19 @@
         <row>
           <label control="TextAreaValue" value="&InitialText.label;" accesskey="&InitialText.accessKey;"/>
         </row>
         <textbox id="TextAreaValue" flex="1" multiline="true" rows="5"/>
       </rows>
     </grid>
   </groupbox>
 
-  <!-- from EdDialogOverlay -->
-  <vbox id="AdvancedEdit"/>
+  <vbox id="AdvancedEdit">
+    <hbox flex="1" style="margin-top: 0.2em" align="center">
+      <!-- This will right-align the button -->
+      <spacer flex="1"/>
+      <button id="AdvancedEditButton1" oncommand="onAdvancedEdit()" label="&AdvancedEditButton.label;"
+              accesskey="&AdvancedEditButton.accessKey;" tooltiptext="&AdvancedEditButton.tooltip;"/>
+    </hbox>
+    <separator id="advancedSeparator" class="groove"/>
+  </vbox>
 
 </dialog>
--- a/editor/ui/dialogs/content/EditConflict.xul
+++ b/editor/ui/dialogs/content/EditConflict.xul
@@ -2,18 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
-
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditConflict.dtd">
 
 <dialog buttons="cancel" title="&windowTitle.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     ondialogcancel="return onClose();">
 
   <!-- Methods common to all editor dialogs -->
--- a/editor/ui/dialogs/content/EditorPublish.xul
+++ b/editor/ui/dialogs/content/EditorPublish.xul
@@ -2,17 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
 <?xul-overlay href="chrome://editor/content/EditorPublishOverlay.xul"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorPublish.dtd">
 
 <dialog title="&windowTitle.label;"
         id="publishDlg"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup()"
--- a/editor/ui/dialogs/content/EditorPublishProgress.xul
+++ b/editor/ui/dialogs/content/EditorPublishProgress.xul
@@ -1,30 +1,27 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorPublishProgress.dtd">
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorPublishProgress.dtd">
-<!-- dialog containing a control requiring initial setup -->
 <dialog title=""
     id="publishProgressDlg"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     buttons="cancel"
     buttonlabelclose="&closeButton.label;"
     onload="Startup()"
     ondialogaccept="return onEnterKey();"
     ondialogcancel="return onClose();">
 
-  <!-- Methods common to all editor dialogs -->
   <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
   <script type="application/javascript" src="chrome://editor/content/publishprefs.js"/>
   <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
   <script type="application/javascript" src="chrome://editor/content/EditorPublishProgress.js"/>
 
   <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
   <broadcaster id="args" value=""/>
 
--- a/editor/ui/dialogs/content/EditorPublishSettings.xul
+++ b/editor/ui/dialogs/content/EditorPublishSettings.xul
@@ -2,17 +2,16 @@
 
 <!-- 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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
 <?xul-overlay href="chrome://editor/content/EditorPublishOverlay.xul"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorPublish.dtd">
 
 <dialog title="&windowTitleSettings.label;"
         id="publishSettingsDlg"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="Startup()"
--- a/editor/ui/dialogs/content/EditorSaveAsCharset.xul
+++ b/editor/ui/dialogs/content/EditorSaveAsCharset.xul
@@ -1,38 +1,33 @@
 <?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://editor/skin/editor.css" type="text/css"?>
 <?xml-stylesheet href="chrome://editor/skin/EditorDialog.css" type="text/css"?>
 
-<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?>
+<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorSaveAsCharset.dtd">
 
-<!DOCTYPE dialog SYSTEM "chrome://editor/locale/EditorSaveAsCharset.dtd">
-<!-- dialog containing a control requiring initial setup -->
-<!-- WE SHOULD NOT USE ABSOLUTE WITH AND HEIGHT - USE BOXES INSTEAD? -->
 <dialog title="&windowTitle2.label;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload = "Startup()"
     ondialogaccept="return onAccept();"
     ondialogcancel="return onCancel();"
     style="width: 32em;">
 
-    <!-- Methods common to all editor dialogs -->
     <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
     <script type="application/javascript" src="chrome://editor/content/EdDialogCommon.js"/>
     <script type="application/javascript" src="chrome://editor/content/EditorSaveAsCharset.js"/>
 
     <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
     <broadcaster id="args" value=""/>
 
     <groupbox><caption label="&documentTitleTitle.label;"/>
-        <!-- Text labels filled in from editor.properties -->
         <label id="EnterTitleLabel"/>
         <textbox id="TitleInput" oninput="TitleChanged();"/>
         <description id="TitleHelp" class="wrap" style="width:1em" />
     </groupbox>
 
     <groupbox flex="1"><caption label="&documentCharsetTitle2.label;"/>
         <label value="&documentCharsetDesc2.label;"/>
         <tree id="CharsetTree" rows="8" hidecolumnpicker="true" onselect="SelectCharset();">
rename from editor/ui/dialogs/content/EdImageOverlay.xul
rename to editor/ui/dialogs/content/edImage.inc
--- a/editor/ui/dialogs/content/EdImageOverlay.xul
+++ b/editor/ui/dialogs/content/edImage.inc
@@ -1,267 +1,240 @@
-<?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/. -->
-
-<!DOCTYPE overlay SYSTEM "chrome://editor/locale/EditorImageProperties.dtd">
-
-<overlay id="EdImageOverlay"
-     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript" src="chrome://editor/content/EdImageOverlay.js"/>
-
-  <tab id="imageInputTab" label="&imageInputTab.label;"/>
-  <tab id="imageLocationTab" label="&imageLocationTab.label;"/>
-  <tab id="imageDimensionsTab" label="&imageDimensionsTab.label;"/>
-  <tab id="imageAppearanceTab" label="&imageAppearanceTab.label;"/>
-  <tab id="imageLinkTab" label="&imageLinkTab.label;"/>
+# 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/.
 
-  <vbox id="imageLocation">
-    <spacer class="spacer"/>
-    <label control = "srcInput"
-      value = "&locationEditField.label;"
-      accesskey="&locationEditField.accessKey;"
-      tooltiptext="&locationEditField.tooltip;"
-      />
-    <tooltip id="shortenedDataURI">
-      <label value="&locationEditField.shortenedDataURI;"/>
-    </tooltip>
-    <textbox id="srcInput" oninput="ChangeImageSrc();" tabindex="1" class="uri-element"
-             tooltiptext="&locationEditField.tooltip;"/>
-    <hbox id="MakeRelativeHbox">
-      <checkbox
-        id  = "MakeRelativeCheckbox"
-        for = "srcInput"
-        tabindex="2"/>
-      <!-- mail compose will insert custom item here defined in mailComposeEditorOverlay.xul -->
-      <spacer flex="1"/>
-      <!-- from EdDialogOverlay.xul -->
-      <button id="ChooseFile"  tabindex="3"/>
-    </hbox>
-    <spacer class="spacer"/>
-    <radiogroup id="altTextRadioGroup" flex="1">
-      <grid>
-        <columns><column/><column flex="1"/></columns>
-        <rows>
-          <row align="center">
-            <label
-              style   = "margin-left: 26px"
-              control = "titleInput"
-              accesskey = "&title.accessKey;"
-              value   ="&title.label;"
-              tooltiptext="&title.tooltip;"
-              for     = "titleInput"/>
-            <textbox flex="1"
-              id      = "titleInput"
-              class   = "MinWidth20em"
-              tooltiptext="&title.tooltip;"
-              tabindex="4"/>
-          </row>
-          <row align="center">
-            <radio id = "altTextRadio"
-              label   = "&altText.label;"
-              accesskey = "&altText.accessKey;"
-              tooltiptext="&altTextEditField.tooltip;"
-              oncommand = "SetAltTextDisabled(false);"
-              tabindex="5"/>
-            <textbox flex="1"
-              id      = "altTextInput"
-              class   = "MinWidth20em"
-              tooltiptext="&altTextEditField.tooltip;"
-              oninput = "SetAltTextDisabled(false);"
-              tabindex="6"/>
-          </row>
-        </rows>
-      </grid>
+      <vbox id="imageLocation">
+        <spacer class="spacer"/>
+        <label control = "srcInput"
+          value = "&locationEditField.label;"
+          accesskey="&locationEditField.accessKey;"
+          tooltiptext="&locationEditField.tooltip;"
+          />
+        <tooltip id="shortenedDataURI">
+          <label value="&locationEditField.shortenedDataURI;"/>
+        </tooltip>
+        <textbox id="srcInput" oninput="ChangeImageSrc();" tabindex="1" class="uri-element"
+                 tooltiptext="&locationEditField.tooltip;"/>
+        <hbox id="MakeRelativeHbox">
+          <checkbox id="MakeRelativeCheckbox"
+                    for="srcInput"
+                    tabindex="2"
+                    label="&makeUrlRelative.label;"
+                    accesskey="&makeUrlRelative.accessKey;"
+                    oncommand="MakeInputValueRelativeOrAbsolute(this);"
+                    tooltiptext="&makeUrlRelative.tooltip;"/>
+          <checkbox id="AttachSourceToMail"
+                    hidden="true"
+                    label="&attachImageSource.label;"
+                    accesskey="&attachImageSource.accesskey;"
+                    oncommand="DoAttachSourceCheckbox()"/>
+          <spacer flex="1"/>
+          <button id="ChooseFile"
+                  tabindex="3"
+                  oncommand="chooseFile()"
+                  label="&chooseFileButton.label;"
+                  accesskey="&chooseFileButton.accessKey;"/>
+        </hbox>
+        <spacer class="spacer"/>
+        <radiogroup id="altTextRadioGroup" flex="1">
+          <grid>
+            <columns><column/><column flex="1"/></columns>
+            <rows>
+              <row align="center">
+                <label
+                  style   = "margin-left: 26px"
+                  control = "titleInput"
+                  accesskey = "&title.accessKey;"
+                  value   ="&title.label;"
+                  tooltiptext="&title.tooltip;"
+                  for     = "titleInput"/>
+                <textbox flex="1"
+                  id      = "titleInput"
+                  class   = "MinWidth20em"
+                  tooltiptext="&title.tooltip;"
+                  tabindex="4"/>
+              </row>
+              <row align="center">
+                <radio id = "altTextRadio"
+                  label   = "&altText.label;"
+                  accesskey = "&altText.accessKey;"
+                  tooltiptext="&altTextEditField.tooltip;"
+#ifndef MOZ_SUITE
+            persist="selected"
+#endif
+                  oncommand = "SetAltTextDisabled(false);"
+                  tabindex="5"/>
+                <textbox flex="1"
+                  id      = "altTextInput"
+                  class   = "MinWidth20em"
+                  tooltiptext="&altTextEditField.tooltip;"
+                  oninput = "SetAltTextDisabled(false);"
+                  tabindex="6"/>
+              </row>
+            </rows>
+          </grid>
 
-      <radio id = "noAltTextRadio"
-        label   = "&noAltText.label;"
-        accesskey = "&noAltText.accessKey;"
-        oncommand = "SetAltTextDisabled(true);"/>
-    </radiogroup>
-  </vbox>
-
-  <groupbox id="imagePreview" orient="horizontal" flex="1">
-    <caption label="&previewBox.label;"/>
-    <hbox id="preview-image-box" align="center">
-      <spacer flex="1"/>
-      <description id="preview-image-holder"/>
-      <spacer flex="1"/>
-    </hbox>
-    <vbox id="PreviewSize" collapsed="true">
-      <spacer flex="1"/>
-      <label value="&actualSize.label;"/>
-      <hbox>
-        <label value="&widthEditField.label;"/>
-        <spacer flex="1"/>
-        <label id="PreviewWidth"/>
-      </hbox>
-      <hbox>
-        <label value="&heightEditField.label;"/>
-        <spacer flex="1"/>
-        <label id="PreviewHeight"/>
-      </hbox>
-      <spacer flex="1"/>
-    </vbox>
-  </groupbox>
-
-  <vbox id="imageDimensions" align="start">
-    <spacer class="spacer"/>
-    <hbox>
-      <radiogroup id="imgSizeGroup">
-        <radio
-          id      = "actualSizeRadio"
-          label   = "&actualSizeRadio.label;"
-          accesskey = "&actualSizeRadio.accessKey;"
-          tooltiptext="&actualSizeRadio.tooltip;"
-          oncommand = "SetActualSize()"/>
-        <radio
-          id      = "customSizeRadio"
-          label   = "&customSizeRadio.label;"
-          selected = "true"
-          accesskey = "&customSizeRadio.accessKey;"
-          tooltiptext="&customSizeRadio.tooltip;"
-          oncommand = "doDimensionEnabling();" />
-      </radiogroup>
-      <spacer flex="1"/>
-      <vbox>
-        <spacer flex="1"/>
-        <checkbox id="constrainCheckbox" label="&constrainCheckbox.label;"
-             accesskey="&constrainCheckbox.accessKey;"
-             oncommand="ToggleConstrain()"
-             tooltiptext="&constrainCheckbox.tooltip;"/>
+          <radio id = "noAltTextRadio"
+            label   = "&noAltText.label;"
+            accesskey = "&noAltText.accessKey;"
+#ifndef MOZ_SUITE
+            persist="selected"
+#endif
+            oncommand = "SetAltTextDisabled(true);"/>
+        </radiogroup>
       </vbox>
-      <spacer flex="1"/>
-    </hbox>
-    <spacer class="spacer"/>
-    <grid class="indent">
-      <columns><column/><column/><column flex="1"/></columns>
-      <rows>
-        <row align="center">
-          <label id    = "widthLabel"
-            control   = "widthInput"
-            accesskey = "&widthEditField.accessKey;"
-            value = "&widthEditField.label;" />
-          <textbox
-            id       = "widthInput"
-            class    = "narrow"
-            oninput  = "constrainProportions(this.id, 'heightInput')"/>
-          <menulist id = "widthUnitsMenulist"
-            oncommand = "doDimensionEnabling();" />
-          <!-- contents are appended by JS -->
-        </row>
-        <row align="center">
-          <label id    = "heightLabel"
-            control   = "heightInput"
-            accesskey = "&heightEditField.accessKey;"
-            value = "&heightEditField.label;" />
-          <textbox
-            id       = "heightInput"
-            class    = "narrow"
-            oninput  = "constrainProportions(this.id, 'widthInput')"/>
-          <menulist id = "heightUnitsMenulist"
-            oncommand = "doDimensionEnabling();" />
-          <!-- contents are appended by JS -->
-        </row>
-      </rows>
-    </grid>
-    <spacer flex="1"/>
-  </vbox>
+
+      <vbox id="imageDimensions" align="start">
+        <spacer class="spacer"/>
+        <hbox>
+          <radiogroup id="imgSizeGroup">
+            <radio
+              id      = "actualSizeRadio"
+              label   = "&actualSizeRadio.label;"
+              accesskey = "&actualSizeRadio.accessKey;"
+              tooltiptext="&actualSizeRadio.tooltip;"
+              oncommand = "SetActualSize()"/>
+            <radio
+              id      = "customSizeRadio"
+              label   = "&customSizeRadio.label;"
+              selected = "true"
+              accesskey = "&customSizeRadio.accessKey;"
+              tooltiptext="&customSizeRadio.tooltip;"
+              oncommand = "doDimensionEnabling();" />
+          </radiogroup>
+          <spacer flex="1"/>
+          <vbox>
+            <spacer flex="1"/>
+            <checkbox id="constrainCheckbox" label="&constrainCheckbox.label;"
+                 accesskey="&constrainCheckbox.accessKey;"
+                 oncommand="ToggleConstrain()"
+                 tooltiptext="&constrainCheckbox.tooltip;"/>
+          </vbox>
+          <spacer flex="1"/>
+        </hbox>
+        <spacer class="spacer"/>
+        <grid class="indent">
+          <columns><column/><column/><column flex="1"/></columns>
+          <rows>
+            <row align="center">
+              <label id    = "widthLabel"
+                control   = "widthInput"
+                accesskey = "&widthEditField.accessKey;"
+                value = "&widthEditField.label;" />
+              <textbox
+                id       = "widthInput"
+                class    = "narrow"
+                oninput  = "constrainProportions(this.id, 'heightInput')"/>
+              <menulist id = "widthUnitsMenulist"
+                oncommand = "doDimensionEnabling();" />
+              <!-- contents are appended by JS -->
+            </row>
+            <row align="center">
+              <label id    = "heightLabel"
+                control   = "heightInput"
+                accesskey = "&heightEditField.accessKey;"
+                value = "&heightEditField.label;" />
+              <textbox
+                id       = "heightInput"
+                class    = "narrow"
+                oninput  = "constrainProportions(this.id, 'widthInput')"/>
+              <menulist id = "heightUnitsMenulist"
+                oncommand = "doDimensionEnabling();" />
+              <!-- contents are appended by JS -->
+            </row>
+          </rows>
+        </grid>
+        <spacer flex="1"/>
+      </vbox>
 
-  <hbox id="imageAppearance">
-    <groupbox>
-      <caption id="spacingLabel" label="&spacingBox.label;"/>
-      <grid>
-        <columns><column/><column/><column/></columns>
-        <rows>
-          <row align="center">
-            <label
-              class = "align-right"
-              id    = "leftrightLabel"
-              control = "imageleftrightInput"
-              accesskey = "&leftRightEditField.accessKey;"
-              value = "&leftRightEditField.label;"/>
-            <textbox
-              class     = "narrow"
-              id        = "imageleftrightInput"
-              oninput   = "forceInteger(this.id)"/>
-            <label
-              id    = "leftrighttypeLabel"
-              value = "&pixelsPopup.value;" />
-          </row>
-          <spacer class="spacer"/>
-          <row align="center">
-            <label
-              class = "align-right"
-              id    = "topbottomLabel"
-              control = "imagetopbottomInput"
-              accesskey = "&topBottomEditField.accessKey;"
-              value = "&topBottomEditField.label;"/>
-            <textbox
-              class     = "narrow"
-              id        = "imagetopbottomInput"
-              oninput   = "forceInteger(this.id)"/>
-            <label
-              id    = "topbottomtypeLabel"
-              value = "&pixelsPopup.value;" />
-          </row>
-          <spacer class="spacer"/>
-          <row align="center">
-            <label class = "align-right"
-              id    = "borderLabel"
-              control = "border"
-              accesskey = "&borderEditField.accessKey;"
-              value = "&borderEditField.label;"/>
-            <textbox
-              class     = "narrow"
-              id        = "border"
-              oninput   = "forceInteger(this.id)"/>
-            <label
-              id    = "bordertypeLabel"
-              value = "&pixelsPopup.value;" />
-          </row>
-        </rows>
-      </grid>
-    </groupbox>
+      <hbox id="imageAppearance">
+        <groupbox>
+          <caption id="spacingLabel" label="&spacingBox.label;"/>
+          <grid>
+            <columns><column/><column/><column/></columns>
+            <rows>
+              <row align="center">
+                <label
+                  class = "align-right"
+                  id    = "leftrightLabel"
+                  control = "imageleftrightInput"
+                  accesskey = "&leftRightEditField.accessKey;"
+                  value = "&leftRightEditField.label;"/>
+                <textbox
+                  class     = "narrow"
+                  id        = "imageleftrightInput"
+                  oninput   = "forceInteger(this.id)"/>
+                <label
+                  id    = "leftrighttypeLabel"
+                  value = "&pixelsPopup.value;" />
+              </row>
+              <spacer class="spacer"/>
+              <row align="center">
+                <label
+                  class = "align-right"
+                  id    = "topbottomLabel"
+                  control = "imagetopbottomInput"
+                  accesskey = "&topBottomEditField.accessKey;"
+                  value = "&topBottomEditField.label;"/>
+                <textbox
+                  class     = "narrow"
+                  id        = "imagetopbottomInput"
+                  oninput   = "forceInteger(this.id)"/>
+                <label id="topbottomtypeLabel"
+                       value="&pixelsPopup.value;" />
+              </row>
+              <spacer class="spacer"/>
+              <row align="center">
+                <label class="align-right"
+                       id="borderLabel"
+                       control="border"
+                       accesskey="&borderEditField.accessKey;"
+                       value="&borderEditField.label;"/>
+                <textbox
+                  class     = "narrow"
+                  id        = "border"
+                  oninput   = "forceInteger(this.id)"/>
+                <label id="bordertypeLabel"
+                       value="&pixelsPopup.value;" />
+              </row>
+            </rows>
+          </grid>
+        </groupbox>
 
-    <vbox>
-      <groupbox align="start">
-        <caption id="alignLabel" label="&alignment.label;"/>
-        <menulist id="alignTypeSelect" class="align-menu">
-          <menupopup>
-            <menuitem class="align-menu menuitem-iconic"
-                      value="top"
-                      label="&topPopup.value;"/>
-            <menuitem class="align-menu menuitem-iconic"
-                      value="middle"
-                      label="&centerPopup.value;"/>
-            <menuitem class="align-menu menuitem-iconic"
-                      value="bottom"
-                      label="&bottomPopup.value;"/>
-            <!-- HTML attribute value is opposite of the button label on purpose -->
-            <menuitem class="align-menu menuitem-iconic"
-                      value="right"
-                      label="&wrapLeftPopup.value;"/>
-            <menuitem class="align-menu menuitem-iconic"
-                      value="left"
-                      label="&wrapRightPopup.value;"/>
-          </menupopup>
-        </menulist>
-      </groupbox>
+        <vbox>
+          <groupbox align="start">
+            <caption id="alignLabel" label="&alignment.label;"/>
+            <menulist id="alignTypeSelect" class="align-menu">
+              <menupopup>
+                <menuitem class="align-menu menuitem-iconic"
+                          value="top"
+                          label="&topPopup.value;"/>
+                <menuitem class="align-menu menuitem-iconic"
+                          value="middle"
+                          label="&centerPopup.value;"/>
+                <menuitem class="align-menu menuitem-iconic"
+                          value="bottom"
+                          label="&bottomPopup.value;"/>
+                <!-- HTML attribute value is opposite of the button label on purpose -->
+                <menuitem class="align-menu menuitem-iconic"
+                          value="right"
+                          label="&wrapLeftPopup.value;"/>
+                <menuitem class="align-menu menuitem-iconic"
+                          value="left"
+                          label="&wrapRightPopup.value;"/>
+              </menupopup>
+            </menulist>
+          </groupbox>
 
-      <groupbox>
-        <caption id="imagemapLabel" label="&imagemapBox.label;"/>
-        <hbox equalsize="always">
-        <button
-          id      = "removeImageMap"
-          oncommand = "removeImageMap()"
-          accesskey = "&removeImageMapButton.accessKey;"
-          label   = "&removeImageMapButton.label;"
-          flex    = "1"/>
-        <spacer flex="1"/><!-- remove when we restore Image Map Editor -->
-        </hbox>
-      </groupbox>
-    </vbox>
-  </hbox>
-
-</overlay>
+          <groupbox>
+            <caption id="imagemapLabel" label="&imagemapBox.label;"/>
+            <hbox equalsize="always">
+            <button id="removeImageMap"
+                    oncommand="removeImageMap()"
+                    accesskey="&removeImageMapButton.accessKey;"
+                    label="&removeImageMapButton.label;"
+                    flex="1"/>
+            <spacer flex="1"/><!-- remove when we restore Image Map Editor -->
+            </hbox>
+          </groupbox>
+        </vbox>
+      </hbox>
--- a/editor/ui/jar.mn
+++ b/editor/ui/jar.mn
@@ -11,26 +11,24 @@ comm.jar:
 % overlay chrome://communicator/content/pref/pref-appearance.xul chrome://editor/content/editorPrefsOverlay.xul
 % overlay chrome://navigator/content/navigatorOverlay.xul chrome://editor/content/editorNavigatorOverlay.xul
 % content editor-region %content/editor-region/
 #endif
       content/editor/editor.js                                 (composer/content/editor.js)
       content/editor/editorUtilities.js                        (composer/content/editorUtilities.js)
       content/editor/ComposerCommands.js                       (composer/content/ComposerCommands.js)
       content/editor/EditorContent.css                         (composer/content/EditorContent.css)
-      content/editor/editorSmileyOverlay.xul                   (composer/content/editorSmileyOverlay.xul)
-      content/editor/editorApplicationOverlay.js               (composer/content/editorApplicationOverlay.js)
       content/editor/images/tag-anchor.gif                     (composer/content/images/tag-anchor.gif)
       content/editor/EdDialogCommon.js                         (dialogs/content/EdDialogCommon.js)
       content/editor/EdLinkProps.xul                           (dialogs/content/EdLinkProps.xul)
       content/editor/EdLinkProps.js                            (dialogs/content/EdLinkProps.js)
-      content/editor/EdImageProps.xul                          (dialogs/content/EdImageProps.xul)
+*     content/editor/EdImageProps.xul                          (dialogs/content/EdImageProps.xul)
       content/editor/EdImageProps.js                           (dialogs/content/EdImageProps.js)
-      content/editor/EdImageOverlay.xul                        (dialogs/content/EdImageOverlay.xul)
-      content/editor/EdImageOverlay.js                         (dialogs/content/EdImageOverlay.js)
+      content/editor/EdImageLinkLoader.js                      (dialogs/content/EdImageLinkLoader.js)
+      content/editor/EdImageDialog.js                          (dialogs/content/EdImageDialog.js)
       content/editor/EdHLineProps.xul                          (dialogs/content/EdHLineProps.xul)
       content/editor/EdHLineProps.js                           (dialogs/content/EdHLineProps.js)
       content/editor/EdReplace.xul                             (dialogs/content/EdReplace.xul)
       content/editor/EdReplace.js                              (dialogs/content/EdReplace.js)
       content/editor/EdSpellCheck.xul                          (dialogs/content/EdSpellCheck.xul)
       content/editor/EdSpellCheck.js                           (dialogs/content/EdSpellCheck.js)
       content/editor/EdDictionary.xul                          (dialogs/content/EdDictionary.xul)
       content/editor/EdDictionary.js                           (dialogs/content/EdDictionary.js)
@@ -43,33 +41,32 @@ comm.jar:
       content/editor/EdInsertMath.xul                          (dialogs/content/EdInsertMath.xul)
       content/editor/EdInsertMath.js                           (dialogs/content/EdInsertMath.js)
       content/editor/EdTableProps.xul                          (dialogs/content/EdTableProps.xul)
       content/editor/EdTableProps.js                           (dialogs/content/EdTableProps.js)
       content/editor/EdFormProps.xul                           (dialogs/content/EdFormProps.xul)
       content/editor/EdFormProps.js                            (dialogs/content/EdFormProps.js)
       content/editor/EdInputProps.xul                          (dialogs/content/EdInputProps.xul)
       content/editor/EdInputProps.js                           (dialogs/content/EdInputProps.js)
-      content/editor/EdInputImage.xul                          (dialogs/content/EdInputImage.xul)
+*     content/editor/EdInputImage.xul                          (dialogs/content/EdInputImage.xul)
       content/editor/EdInputImage.js                           (dialogs/content/EdInputImage.js)
       content/editor/EdTextAreaProps.xul                       (dialogs/content/EdTextAreaProps.xul)
       content/editor/EdTextAreaProps.js                        (dialogs/content/EdTextAreaProps.js)
       content/editor/EdSelectProps.xul                         (dialogs/content/EdSelectProps.xul)
       content/editor/EdSelectProps.js                          (dialogs/content/EdSelectProps.js)
       content/editor/EdButtonProps.xul                         (dialogs/content/EdButtonProps.xul)
       content/editor/EdButtonProps.js                          (dialogs/content/EdButtonProps.js)
       content/editor/EdLabelProps.xul                          (dialogs/content/EdLabelProps.xul)
       content/editor/EdLabelProps.js                           (dialogs/content/EdLabelProps.js)
       content/editor/EdFieldSetProps.xul                       (dialogs/content/EdFieldSetProps.xul)
       content/editor/EdFieldSetProps.js                        (dialogs/content/EdFieldSetProps.js)
       content/editor/EdInsSrc.xul                              (dialogs/content/EdInsSrc.xul)
       content/editor/EdInsSrc.js                               (dialogs/content/EdInsSrc.js)
       content/editor/EdInsertChars.xul                         (dialogs/content/EdInsertChars.xul)
       content/editor/EdInsertChars.js                          (dialogs/content/EdInsertChars.js)
-      content/editor/EdDialogOverlay.xul                       (dialogs/content/EdDialogOverlay.xul)
       content/editor/EdAdvancedEdit.xul                        (dialogs/content/EdAdvancedEdit.xul)
       content/editor/EdAdvancedEdit.js                         (dialogs/content/EdAdvancedEdit.js)
       content/editor/EdListProps.xul                           (dialogs/content/EdListProps.xul)
       content/editor/EdListProps.js                            (dialogs/content/EdListProps.js)
       content/editor/EdPageProps.xul                           (dialogs/content/EdPageProps.xul)
       content/editor/EdPageProps.js                            (dialogs/content/EdPageProps.js)
       content/editor/EdColorProps.xul                          (dialogs/content/EdColorProps.xul)
       content/editor/EdColorProps.js                           (dialogs/content/EdColorProps.js)
@@ -79,16 +76,18 @@ comm.jar:
       content/editor/EdAEHTMLAttributes.js                     (dialogs/content/EdAEHTMLAttributes.js)
       content/editor/EdAEJSEAttributes.js                      (dialogs/content/EdAEJSEAttributes.js)
       content/editor/EdAEAttributes.js                         (dialogs/content/EdAEAttributes.js)
       content/editor/EdConvertToTable.xul                      (dialogs/content/EdConvertToTable.xul)
       content/editor/EdConvertToTable.js                       (dialogs/content/EdConvertToTable.js)
 #ifdef MOZ_SUITE
       content/editor/editor.xul                                (composer/content/editor.xul)
       content/editor/editingOverlay.js                         (composer/content/editingOverlay.js)
+      content/editor/editorSmileyOverlay.xul                   (composer/content/editorSmileyOverlay.xul)
+      content/editor/editorApplicationOverlay.js               (composer/content/editorApplicationOverlay.js)
       content/editor/publishprefs.js                           (composer/content/publishprefs.js)
       content/editor/EditorContextMenu.js                      (composer/content/EditorContextMenu.js)
       content/editor/EditorContextMenuOverlay.xul              (composer/content/EditorContextMenuOverlay.xul)
       content/editor/EditorAllTags.css                         (composer/content/EditorAllTags.css)
       content/editor/editorNavigatorOverlay.xul                (composer/content/editorNavigatorOverlay.xul)
       content/editor/editorMailOverlay.xul                     (composer/content/editorMailOverlay.xul)
       content/editor/editorTasksOverlay.xul                    (composer/content/editorTasksOverlay.xul)
       content/editor/editorOverlay.xul                         (composer/content/editorOverlay.xul)
deleted file mode 100644
--- a/mail/base/content/EdSpellCheckOverlay.js
+++ /dev/null
@@ -1,12 +0,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/. */
-
-/**
- * Override openURL to open in a content tab within Thunderbird.
- *
- * @param url the URL to open
- */
-function openURL(url) {
-  openContentTab(url, "tab", "^https://addons.mozilla.org");
-}
deleted file mode 100644
--- a/mail/base/content/EdSpellCheckOverlay.xul
+++ /dev/null
@@ -1,10 +0,0 @@
-<?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/. -->
-
-<overlay id="EdSpellCheckOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
-  <script type="application/javascript" src="chrome://messenger/content/EdSpellCheckOverlay.js"/>
-</overlay>
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -5,17 +5,16 @@ messenger.jar:
 % content messenger %content/messenger/
 % override chrome://global/content/nsDragAndDrop.js chrome://messenger/content/nsDragAndDrop.js
 % override chrome://messagebody/skin/messageBody.css chrome://messenger/skin/messageBody.css
 #ifndef MOZILLA_OFFICIAL
 % override chrome://browser/content/browser-development-helpers.js chrome://messenger/content/browser-development-helpers.js
   content/messenger/browser-development-helpers.js (../../common/src/browser-development-helpers.js)
 #endif
 % overlay chrome://global/content/config.xul chrome://messenger/content/configEditorOverlay.xul
-% overlay chrome://editor/content/EdSpellCheck.xul chrome://messenger/content/EdSpellCheckOverlay.xul
 % overlay about:addons chrome://messenger/content/extensionsOverlay.xul
 % style about:addons chrome://messenger/content/extensionsOverlay.css
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/content/messenger.css
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/skin/
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/skin/addressbook/addressbook.css
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/skin/messengercompose/messengercompose.css
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/skin/smime/msgCompSMIMEOverlay.css
 % style chrome://messenger/content/customizeToolbar.xul chrome://messenger/skin/messageHeader.css
@@ -77,18 +76,16 @@ messenger.jar:
     content/messenger/aboutDialog.css               (content/aboutDialog.css)
 *   content/messenger/messenger.css                 (content/messenger.css)
     content/messenger/search.xml                    (content/search.xml)
     content/messenger/tabmail.xml                   (content/tabmail.xml)
     content/messenger/tabmail.css                   (content/tabmail.css)
     content/messenger/newTagDialog.xul              (content/newTagDialog.xul)
     content/messenger/newTagDialog.js               (content/newTagDialog.js)
     content/messenger/configEditorOverlay.xul       (content/configEditorOverlay.xul)
-    content/messenger/EdSpellCheckOverlay.xul       (content/EdSpellCheckOverlay.xul)
-    content/messenger/EdSpellCheckOverlay.js        (content/EdSpellCheckOverlay.js)
     content/messenger/composerOverlay.css           (content/composerOverlay.css)
     content/messenger/threadPane.js                 (content/threadPane.js)
     content/messenger/threadPaneColumnPicker.xml    (content/threadPaneColumnPicker.xml)
     content/messenger/protovis-r2.6-modded.js       (content/protovis-r2.6-modded.js)
 #ifdef XP_MACOSX
     content/messenger/macMessengerMenu.js           (content/macMessengerMenu.js)
 #endif
     content/messenger/selectionsummaries.js         (content/selectionsummaries.js)
deleted file mode 100644
--- a/mail/components/compose/content/EdColorPropsOverlay.xul
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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/. -->
-
-<!DOCTYPE window SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd" >
-
-<overlay id="mailEdColorPropsOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript">
-  <![CDATA[
-  function onAccept() {
-    // If it's a file, convert to a data URL.
-    if (gBackgroundImage && /^file:/i.test(gBackgroundImage)) {
-      let nsFile = Services.io.newURI(gBackgroundImage)
-        .QueryInterface(Ci.nsIFileURL).file;
-      if (nsFile.exists()) {
-        let reader = new FileReader();
-        reader.addEventListener("load", function() {
-          gBackgroundImage = reader.result;
-          gDialog.BackgroundImageInput.value = reader.result;
-          if (onAccept()) {
-            window.close();
-          }
-        });
-        File.createFromNsIFile(nsFile).then(file => {
-          reader.readAsDataURL(file);
-        });
-        return false; // Don't close just yet...
-      }
-    }
-    if (ValidateData()) {
-      // Copy attributes to element we are changing
-      try {
-        GetCurrentEditor().cloneAttributes(gBodyElement, globalElement);
-      } catch (e) {}
-
-      SaveWindowLocation();
-      return true; // do close the window
-    }
-    return false;
-  }
-  ]]>
-  </script>
-
-</overlay>
deleted file mode 100644
--- a/mail/components/compose/content/EdImageOverlayOverlay.xul
+++ /dev/null
@@ -1,11 +0,0 @@
-<?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/. -->
-
-<overlay id="EdImageOverlayOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <radio id="altTextRadio" persist="selected"/>
-  <radio id="noAltTextRadio" persist="selected"/>
-
-</overlay>
--- a/mail/components/compose/jar.mn
+++ b/mail/components/compose/jar.mn
@@ -1,19 +1,13 @@
 # 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/.
 
 messenger.jar:
-% overlay chrome://editor/content/EdImageOverlay.xul chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
-% overlay chrome://editor/content/EdImageOverlay.xul chrome://messenger/content/messengercompose/EdImageOverlayOverlay.xul
-% overlay chrome://editor/content/EdColorProps.xul chrome://messenger/content/messengercompose/EdColorPropsOverlay.xul
-% overlay chrome://editor/content/EdLinkProps.xul chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
 *   content/messenger/messengercompose/messengercompose.xul        (content/messengercompose.xul)
     content/messenger/messengercompose/MsgComposeCommands.js       (content/MsgComposeCommands.js)
     content/messenger/messengercompose/bigFileObserver.js          (content/bigFileObserver.js)
     content/messenger/messengercompose/cloudAttachmentLinkManager.js (content/cloudAttachmentLinkManager.js)
-    content/messenger/messengercompose/EdImageOverlayOverlay.xul   (content/EdImageOverlayOverlay.xul)
-    content/messenger/messengercompose/EdColorPropsOverlay.xul     (content/EdColorPropsOverlay.xul)
     content/messenger/messengercompose/addressingWidgetOverlay.js  (content/addressingWidgetOverlay.js)
 
 comm.jar:
     content/editor/editorOverlay.xul                               (content/editorOverlay.xul)
--- a/mailnews/jar.mn
+++ b/mailnews/jar.mn
@@ -110,17 +110,16 @@ messenger.jar:
     content/messenger/FilterEditor.js                                          (base/search/content/FilterEditor.js)
     content/messenger/searchWidgets.xml                                        (base/search/content/searchWidgets.xml)
     content/messenger/viewLog.xul                                              (base/search/content/viewLog.xul)
     content/messenger/viewLog.js                                               (base/search/content/viewLog.js)
     content/messenger/messengercompose/askSendFormat.js                        (compose/content/askSendFormat.js)
     content/messenger/messengercompose/askSendFormat.xul                       (compose/content/askSendFormat.xul)
     content/messenger/messengercompose/sendProgress.xul                        (compose/content/sendProgress.xul)
     content/messenger/messengercompose/sendProgress.js                         (compose/content/sendProgress.js)
-    content/messenger/messengercompose/mailComposeEditorOverlay.xul            (compose/content/mailComposeEditorOverlay.xul)
 #ifndef MOZ_THUNDERBIRD
     content/messenger/messengercompose/menulistCompactBindings.xml             (compose/content/menulistCompactBindings.xml)
 #endif
     content/messenger/importDialog.js                                          (import/content/importDialog.js)
 *   content/messenger/importDialog.xul                                         (import/content/importDialog.xul)
     content/messenger/fieldMapImport.xul                                       (import/content/fieldMapImport.xul)
     content/messenger/fieldMapImport.js                                        (import/content/fieldMapImport.js)
     content/messenger/downloadheaders.js                                       (news/content/downloadheaders.js)
deleted file mode 100644
--- a/suite/mailnews/compose/EdColorPropsOverlay.xul
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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/. -->
-
-<!DOCTYPE window SYSTEM "chrome://messenger/locale/messengercompose/mailComposeEditorOverlay.dtd" >
-
-<overlay id="mailEdColorPropsOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript">
-  <![CDATA[
-  function onAccept() {
-    // If it's a file, convert to a data URL.
-    if (gBackgroundImage && /^file:/i.test(gBackgroundImage)) {
-      let nsFile = Services.io.newURI(gBackgroundImage)
-                              .QueryInterface(Ci.nsIFileURL)
-                              .file;
-      if (nsFile.exists()) {
-        let reader = new FileReader();
-        reader.addEventListener("load", function() {
-          gBackgroundImage = reader.result;
-          gDialog.BackgroundImageInput.value = reader.result;
-          if (onAccept()) {
-            window.close();
-          }
-        });
-        File.createFromNsIFile(nsFile).then(file => {
-          reader.readAsDataURL(file);
-        });
-        return false; // Don't close just yet...
-      }
-    }
-    if (ValidateData()) {
-      // Copy attributes to element we are changing
-      try {
-        GetCurrentEditor().cloneAttributes(gBodyElement, globalElement);
-      } catch (e) {}
-
-      SaveWindowLocation();
-      return true; // do close the window
-    }
-    return false;
-  }
-  ]]>
-  </script>
-
-</overlay>
--- a/suite/mailnews/jar.mn
+++ b/suite/mailnews/jar.mn
@@ -13,19 +13,16 @@ messenger.jar:
 % content messenger-region %content/messenger-region/
 % overlay chrome://communicator/content/pref/preferences.xul                   chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://communicator/content/pref/pref-appearance.xul               chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://communicator/content/pref/pref-scripts.xul                  chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://communicator/content/pref/pref-cookies.xul                  chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://editor/content/editorTasksOverlay.xul                       chrome://messenger/content/mailTasksOverlay.xul
 % overlay chrome://messenger/content/addressbook/abSelectAddressesDialog.xul   chrome://messenger/content/mailOverlay.xul
 % overlay chrome://editor/content/composerOverlay.xul                          chrome://messenger/content/mailEditorOverlay.xul
-% overlay chrome://editor/content/EdColorProps.xul                             chrome://messenger/content/messengercompose/EdColorPropsOverlay.xul
-% overlay chrome://editor/content/EdImageOverlay.xul                           chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
-% overlay chrome://editor/content/EdLinkProps.xul                              chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
     content/messenger/browserRequest.xul
     content/messenger/browserRequest.js
     content/messenger/msgViewPickerOverlay.js
     content/messenger/mailViewSetup.js
     content/messenger/mailViewSetup.xul
     content/messenger/mailViewList.xul
     content/messenger/mailViewList.js
     content/messenger/mailWidgets.xml
@@ -87,17 +84,16 @@ messenger.jar:
     content/messenger/ABSearchDialog.js                                        (search/ABSearchDialog.js)
     content/messenger/FilterListDialog.xul                                     (search/FilterListDialog.xul)
     content/messenger/FilterListDialog.js                                      (search/FilterListDialog.js)
     content/messenger/messengercompose/pref-composing_messages.xul             (compose/prefs/pref-composing_messages.xul)
     content/messenger/messengercompose/pref-composing_messages.js              (compose/prefs/pref-composing_messages.js)
     content/messenger/messengercompose/pref-formatting.xul                     (compose/prefs/pref-formatting.xul)
     content/messenger/messengercompose/pref-formatting.js                      (compose/prefs/pref-formatting.js)
     content/messenger/messengercompose/messengercompose.xul                    (compose/messengercompose.xul)
-    content/messenger/messengercompose/EdColorPropsOverlay.xul                 (compose/EdColorPropsOverlay.xul)
     content/messenger/messengercompose/mailComposeOverlay.xul                  (compose/mailComposeOverlay.xul)
     content/messenger/messengercompose/msgComposeContextOverlay.xul            (compose/msgComposeContextOverlay.xul)
     content/messenger/messengercompose/MsgComposeCommands.js                   (compose/MsgComposeCommands.js)
     content/messenger/messengercompose/addressingWidgetOverlay.js              (compose/addressingWidgetOverlay.js)
     content/messenger/messengercompose/addressingWidgetOverlay.xul             (compose/addressingWidgetOverlay.xul)
     content/messenger/messengercompose/mailComposeExtrasOverlay.xul            (compose/mailComposeExtrasOverlay.xul)
     content/messenger/addressbook/addressbook.js                               (addrbook/addressbook.js)
     content/messenger/addressbook/addressbook.xul                              (addrbook/addressbook.xul)