Bug 1403733 - Fix single button styling on Flash doorhanger r?felipe draft
authorDoug Thayer <dothayer@mozilla.com>
Tue, 10 Oct 2017 12:24:15 -0700
changeset 681648 a0e24abed3687a50a83e410e536ebf805657a081
parent 677774 a0488ecc201c04f2617e7b02f039344e8fbf0d9a
child 736201 e04ec81e212ecd7c01425f6b25e8dd68763ab33d
push id84887
push userbmo:dothayer@mozilla.com
push dateTue, 17 Oct 2017 15:59:48 +0000
reviewersfelipe
bugs1403733
milestone58.0a1
Bug 1403733 - Fix single button styling on Flash doorhanger r?felipe There's not a great selector that covers the case of either button being hidden, so the best option seems to be an additional attribute. MozReview-Commit-ID: CMdjWQnPjGA
browser/base/content/urlbarBindings.xml
toolkit/themes/shared/popupnotification.inc.css
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -2990,16 +2990,22 @@ file, You can obtain one at http://mozil
           this._secondaryButton.label = gNavigatorBundle.getString(button2.label);
           this._secondaryButton.accessKey = gNavigatorBundle.getString(button2.accesskey);
           this._secondaryButton.setAttribute("action", button2.action);
           if (button1.default) {
             this._primaryButton.setAttribute("default", "true");
           } else if (button2.default) {
             this._secondaryButton.setAttribute("default", "true");
           }
+
+          if (this._primaryButton.hidden) {
+            this._secondaryButton.setAttribute("alone", "true");
+          } else if (this._secondaryButton.hidden) {
+            this._primaryButton.setAttribute("alone", "true");
+          }
         ]]></body>
       </method>
       <method name="_setupDescription">
         <parameter name="baseString" />
         <parameter name="pluginName" /> <!-- null for the multiple-plugin case -->
         <parameter name="prePath" />
         <body><![CDATA[
           var span = document.getAnonymousElementByAttribute(this, "anonid", "click-to-play-plugins-notification-description");
--- a/toolkit/themes/shared/popupnotification.inc.css
+++ b/toolkit/themes/shared/popupnotification.inc.css
@@ -73,17 +73,17 @@
   box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset;
 }
 
 .popup-notification-button[disabled] {
   background-color: var(--arrowpanel-dimmed-further);
   color: graytext;
 }
 
-.popup-notification-button[default] {
+.popup-notification-button[default]:not([alone]) {
   flex: 0 50%;
 }
 
 .popup-notification-button[default][highlight="true"]:not([disabled]) {
   background-color: #0996f8;
   color: white;
 }