Bug 1358431 - Remove delay rendering add-on permissions popup header. r=florian, a=jcristau
authorMark Striemer <mstriemer@mozilla.com>
Fri, 09 Jun 2017 14:59:04 -0500
changeset 413969 66df990d6ebf7e3746fe7f714a70ccdbaa5240e6
parent 413968 ea9a39406ec791128dfbbd54b5ecd8762ac21b7f
child 413970 2a945bd4b7aedfde7ab8d84383ae0b892626cd89
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, jcristau
bugs1358431
milestone55.0
Bug 1358431 - Remove delay rendering add-on permissions popup header. r=florian, a=jcristau 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
@@ -1981,29 +1981,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
@@ -1588,29 +1588,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");