Bug 1358431 - Remove delay rendering add-on permissions popup header r?florian draft
authorMark Striemer <mstriemer@mozilla.com>
Fri, 09 Jun 2017 14:59:04 -0500
changeset 591998 898f67e3e694f848bc1ccb58a67cc2f6b3ab728c
parent 591948 215bc80625c4733e2f65e39873b1a4fe55321c09
child 632690 9b9b6e14e89e6caa8a732103903f5b3ada820dfb
push id63245
push userbmo:mstriemer@mozilla.com
push dateFri, 09 Jun 2017 20:57:06 +0000
reviewersflorian
bugs1358431
milestone55.0a1
Bug 1358431 - Remove delay rendering add-on permissions popup header r?florian MozReview-Commit-ID: rlpOW0xFtm
browser/base/content/popup-notifications.inc
browser/modules/ExtensionsUI.jsm
browser/themes/linux/browser.css
browser/themes/osx/browser.css
browser/themes/windows/browser.css
toolkit/content/widgets/notification.xml
--- a/browser/base/content/popup-notifications.inc
+++ b/browser/base/content/popup-notifications.inc
@@ -68,17 +68,18 @@
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="addon-install-confirmation-notification" hidden="true">
       <popupnotificationcontent id="addon-install-confirmation-content" orient="vertical"/>
     </popupnotification>
 
     <popupnotification id="addon-webext-permissions-notification" hidden="true">
-      <popupnotificationcontent orient="vertical">
+      <popupnotificationcontent class="addon-webext-perm-notification-content" orient="vertical">
+        <description id="addon-webext-perm-header" class="addon-webext-perm-header"/>
         <description id="addon-webext-perm-text" class="addon-webext-perm-text"/>
         <label id="addon-webext-perm-intro" class="addon-webext-perm-text"/>
         <html:ul id="addon-webext-perm-list" class="addon-webext-perm-list"/>
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="addon-installed-notification" hidden="true">
       <popupnotificationcontent class="addon-installed-notification-content" orient="vertical">
--- a/browser/modules/ExtensionsUI.jsm
+++ b/browser/modules/ExtensionsUI.jsm
@@ -372,20 +372,18 @@ this.ExtensionsUI = {
     }
 
     return result;
   },
 
   showPermissionsPrompt(browser, strings, icon, histkey) {
     function eventCallback(topic) {
       let doc = this.browser.ownerDocument;
-      if (topic == "shown") {
-        doc.getElementById("addon-webext-permissions-notification")
-           .description.innerHTML = strings.header;
-      } else if (topic == "showing") {
+      if (topic == "showing") {
+        doc.getElementById("addon-webext-perm-header").innerHTML = strings.header;
         let textEl = doc.getElementById("addon-webext-perm-text");
         textEl.innerHTML = strings.text;
         textEl.hidden = !strings.text;
 
         let listIntroEl = doc.getElementById("addon-webext-perm-intro");
         listIntroEl.value = strings.listIntro;
         listIntroEl.hidden = (strings.msgs.length == 0);
 
@@ -432,22 +430,17 @@ this.ExtensionsUI = {
             if (histkey) {
               this.histogram.add(histkey + "Rejected");
             }
             resolve(false);
           },
         },
       ];
 
-      // Get the text value of strings.header to pre-populate the header. This will get
-      // overwritten with the HTML version later.
-      let escapeHeader = browser.ownerDocument.createElement("div");
-      escapeHeader.innerHTML = strings.header;
-      win.PopupNotifications.show(browser, "addon-webext-permissions",
-                                  escapeHeader.textContent,
+      win.PopupNotifications.show(browser, "addon-webext-permissions", "",
                                   "addons-notification-icon",
                                   action, secondaryActions, popupOptions);
     });
   },
 
   showInstallNotification(target, addon) {
     let win = target.ownerGlobal;
     let popups = win.PopupNotifications;
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -490,29 +490,32 @@ html|*.addon-webext-perm-list {
   margin-block-end: 0;
   padding-inline-start: 10px;
 }
 
 .addon-webext-perm-text {
   margin-inline-start: 0;
 }
 
-.popup-notification-description[popupid="addon-webext-permissions"] {
-  margin: 0;
-  padding: 0;
-}
-
+.popup-notification-description[popupid="addon-webext-permissions"],
 .popup-notification-description[popupid="addon-installed"] {
   display: none;
 }
 
+.addon-webext-perm-notification-content,
 .addon-installed-notification-content {
   margin-top: 0;
 }
 
+#addon-webext-perm-header {
+  /* Align the text more closely with the icon by clearing some top line height. */
+  margin-top: -1px;
+  margin-inline-start: 0;
+}
+
 #addon-installed-notification-header {
   /* Align the text more closely with the icon by clearing some top line height. */
   margin-top: -1px;
 }
 
 .addon-webext-name {
   display: inline;
   font-weight: bold;
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -1968,29 +1968,32 @@ html|*.addon-webext-perm-list {
   margin-block-end: 0;
   padding-inline-start: 10px;
 }
 
 .addon-webext-perm-text {
   margin-inline-start: 0;
 }
 
-.popup-notification-description[popupid="addon-webext-permissions"] {
-  margin: 0;
-  padding: 0;
-}
-
+.popup-notification-description[popupid="addon-webext-permissions"],
 .popup-notification-description[popupid="addon-installed"] {
   display: none;
 }
 
+.addon-webext-perm-notification-content,
 .addon-installed-notification-content {
   margin-top: 0;
 }
 
+#addon-webext-perm-header {
+  /* Align the text more closely with the icon by clearing some top line height. */
+  margin-top: -1px;
+  margin-inline-start: 0;
+}
+
 #addon-installed-notification-header {
   /* Align the text more closely with the icon by clearing some top line height. */
   margin-top: -1px;
 }
 
 .addon-webext-name {
   display: inline;
   font-weight: bold;
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -1590,29 +1590,32 @@ html|*.addon-webext-perm-list {
   margin-block-end: 0;
   padding-inline-start: 10px;
 }
 
 .addon-webext-perm-text {
   margin-inline-start: 0;
 }
 
-.popup-notification-description[popupid="addon-webext-permissions"] {
-  margin: 0;
-  padding: 0;
-}
-
+.popup-notification-description[popupid="addon-webext-permissions"],
 .popup-notification-description[popupid="addon-installed"] {
   display: none;
 }
 
+.addon-webext-perm-notification-content,
 .addon-installed-notification-content {
   margin-top: 0;
 }
 
+#addon-webext-perm-header {
+  /* Align the text more closely with the icon by clearing some top line height. */
+  margin-top: -1px;
+  margin-inline-start: 0;
+}
+
 #addon-installed-notification-header {
   /* Align the text more closely with the icon by clearing some top line height. */
   margin-top: -1px;
 }
 
 .addon-webext-name {
   display: inline;
   font-weight: bold;
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -507,18 +507,17 @@
                    xbl:inherits="popupid,src=icon,class=iconclass"/>
         <xul:vbox flex="1" pack="start"
                   class="popup-notification-body" xbl:inherits="popupid">
           <xul:hbox align="start">
             <xul:vbox flex="1">
               <xul:label class="popup-notification-origin header"
                          xbl:inherits="value=origin,tooltiptext=origin"
                          crop="center"/>
-              <xul:description anonid="description"
-                               class="popup-notification-description"
+              <xul:description class="popup-notification-description"
                                xbl:inherits="xbl:text=label,popupid"/>
             </xul:vbox>
             <xul:toolbarbutton anonid="closebutton"
                                class="messageCloseButton close-icon popup-notification-closebutton tabbable"
                                xbl:inherits="oncommand=closebuttoncommand,hidden=closebuttonhidden"
                                tooltiptext="&closeNotification.tooltip;"/>
           </xul:hbox>
           <children includes="popupnotificationcontent"/>
@@ -558,19 +557,16 @@
     </resources>
     <implementation>
       <field name="checkbox" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "checkbox");
       </field>
       <field name="closebutton" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "closebutton");
       </field>
-      <field name="description">
-        document.getAnonymousElementByAttribute(this, "anonid", "description");
-      </field>
       <field name="button" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "button");
       </field>
       <field name="secondaryButton" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "secondarybutton");
       </field>
       <field name="menubutton" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "menubutton");