Bug 1546338 - fix some instances of createElement that were creating HTML elements to use in a xul document. rs=bustage-fix
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 24 May 2019 13:39:57 +0300
changeset 35680 a315856a66fa97d4485d94dd556cb01e0d5228db
parent 35679 eebe1c3a65ec5d5538e9e2be887e676df4e973d6
child 35681 d5d5ade9fbd66e53a8f9e7ff921d1c36348aefc0
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersbustage-fix
bugs1546338
Bug 1546338 - fix some instances of createElement that were creating HTML elements to use in a xul document. rs=bustage-fix
calendar/base/content/calendar-multiday-base-view.js
calendar/lightning/content/lightning-item-panel.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/preferences/applications.js
--- a/calendar/base/content/calendar-multiday-base-view.js
+++ b/calendar/base/content/calendar-multiday-base-view.js
@@ -133,17 +133,17 @@
                 topbox.lastChild.remove();
             }
 
             const orient = topbox.getAttribute("orient");
             const timeFormatter = cal.getDateFormatter();
             const jsTime = new Date();
 
             this.getSections().forEach(([startMinute, duration]) => {
-                const box = document.createXULElement("div");
+                const box = document.createXULElement("box");
                 box.setAttribute("orient", orient);
 
                 // Calculate duration pixel as the difference between
                 // start pixel and end pixel to avoid rounding errors.
                 const startPix = Math.round(startMinute * this.mPixPerMin);
                 const endPix = Math.round((startMinute + duration) * this.mPixPerMin);
                 const durPix = endPix - startPix;
 
--- a/calendar/lightning/content/lightning-item-panel.js
+++ b/calendar/lightning/content/lightning-item-panel.js
@@ -222,17 +222,17 @@ function onLoadLightningItemPanel(aIfram
         let iframeId = aIframeId || gTabmail.currentTabInfo.iframe.id;
         iframe = document.getElementById(iframeId);
         iframeSrc = aUrl;
 
         // Add a listener to detect close events, prompt user about saving changes.
         window.addEventListener("close", windowCloseListener);
     } else {
         // window dialog case
-        iframe = document.createXULElement("iframe");
+        iframe = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
         iframeSrc = window.arguments[0].useNewItemUI
             ? "chrome://lightning/content/html-item-editing/lightning-item-iframe.html"
             : "chrome://lightning/content/lightning-item-iframe.xul";
 
         iframe.setAttribute("id", "lightning-item-panel-iframe");
         iframe.setAttribute("flex", "1");
 
         let statusbar = document.getElementById("status-bar");
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -6882,17 +6882,17 @@ var gComposeNotificationBar = {
     gNotification.notificationbox.removeAllNotifications(true);
   },
 
   setIdentityWarning(aIdentityName) {
     if (!gNotification.notificationbox.getNotificationWithValue("identityWarning")) {
       let text = getComposeBundle().getString("identityWarning").split("%S");
       let label = new DocumentFragment();
       label.appendChild(document.createTextNode(text[0]));
-      label.appendChild(document.createXULElement("b"));
+      label.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "b"));
       label.lastChild.appendChild(document.createTextNode(aIdentityName));
       label.appendChild(document.createTextNode(text[1]));
       gNotification.notificationbox.appendNotification(label, "identityWarning", null,
         gNotification.notificationbox.PRIORITY_WARNING_HIGH, null);
     }
   },
 
   clearIdentityWarning() {
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -737,17 +737,17 @@ var gCloudFileTab = {
   },
 
   _showAccountInfo(aAccountKey) {
     let account = cloudFileAccounts.getAccount(aAccountKey);
     this._settingsDeck.selectedPanel = this._settingsPanelWrap;
 
     let url = account.managementURL + `?accountId=${account.accountKey}`;
 
-    let iframe = document.createXULElement("iframe");
+    let iframe = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
     iframe.setAttribute("flex", "1");
     // allows keeping dialog background color without hoops
     iframe.setAttribute("transparent", "true");
 
     let type = url.startsWith("chrome:") ? "chrome" : "content";
     iframe.setAttribute("type", type);
     iframe.setAttribute("src", url);