Bug 1565703 - Hide unused port settings elements correctly. r=mkmelin a=jorgk DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 15 Jul 2019 21:20:43 +0200
changeset 36081 a1430256e067950d4f90b666314b814b1f1b1c52
parent 36080 eaaaf150fd01837ef7924878d308b7901688d6c4
child 36090 192982b565aaad4b96429a0d95a6c335cc19d982
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin, jorgk
bugs1565703
Bug 1565703 - Hide unused port settings elements correctly. r=mkmelin a=jorgk DONTBUILD
mailnews/base/prefs/content/am-server.css
mailnews/base/prefs/content/am-server.xul
--- a/mailnews/base/prefs/content/am-server.css
+++ b/mailnews/base/prefs/content/am-server.css
@@ -2,16 +2,17 @@
  * 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/. */
 
 #amServerSetting {
   display: inline-grid;
   grid-template-columns: auto auto auto;
 }
 
-#amServerSetting div {
+#amServerSetting div:not([hidden]) {
+  /* Do not override display: none when hidden. */
   display: flex;
   align-items: center;
 }
 
 #amServerSetting textbox.textbox-flex {
   flex-grow: 1;
 }
--- a/mailnews/base/prefs/content/am-server.xul
+++ b/mailnews/base/prefs/content/am-server.xul
@@ -8,17 +8,18 @@
 <?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/content/am-server.css" type="text/css"?>
 
 <!DOCTYPE page [
 <!ENTITY % trashDTD SYSTEM "chrome://messenger/locale/am-server-top.dtd">
 %trashDTD;
 ]>
 
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"
+<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      xmlns:html="http://www.w3.org/1999/xhtml"
       xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       title="&serverSettings.label;"
       onload="parent.onPanelLoaded('am-server.xul');">
 
   <vbox flex="1" style="overflow: auto;">
     <script src="chrome://messenger/content/am-server.js"/>
     <script src="chrome://messenger/content/am-prefs.js"/>
     <script src="chrome://messenger/content/amUtils.js"/>
@@ -41,58 +42,56 @@
 
     <div xmlns="http://www.w3.org/1999/xhtml" id="amServerSetting">
       <div>
         <xul:label value="&serverType.label;"/>
       </div>
       <div>
         <xul:label id="servertype.verbose"/>
       </div>
-      <div/>
-      <div>
+      <div style="grid-row: 2;">
         <xul:label value="&serverName.label;" accesskey="&serverName.accesskey;"
                    control="server.realHostName"/>
       </div>
-      <div>
+      <div style="grid-row: 2;">
         <xul:label id="fixedServerName" collapsed="true" use="server.realHostName"/>
         <xul:textbox id="server.realHostName"
                      wsm_persist="true"
                      size="20"
                      flex="1"
                      prefstring="mail.server.%serverkey%.realhostname"
                      class="uri-element textbox-flex"/>
       </div>
-      <div>
-        <xul:label hidefor="movemail" value="&port.label;"
+      <div hidefor="movemail" style="grid-row: 2;">
+        <xul:label value="&port.label;"
                    accesskey="&port.accesskey;" control="server.port"/>
-        <xul:label id="fixedServerPort" hidefor="movemail"
+        <xul:label id="fixedServerPort"
                    collapsed="true" use="server.port"/>
         <html:input id="server.port" type="number" class="size3"
                     min="1" max="65535"
                     wsm_persist="true"
-                    preftype="int" hidefor="movemail"
+                    preftype="int"
                     prefstring="mail.server.%serverkey%.port"/>
-        <xul:label value="&serverPortDefault.label;" hidefor="movemail"/>
-        <xul:label id="defaultPort" hidefor="movemail"/>
+        <xul:label value="&serverPortDefault.label;"/>
+        <xul:label id="defaultPort"/>
       </div>
-      <div hidefor="nntp">
+      <div hidefor="nntp" style="grid-row: 3;">
         <xul:label value="&userName.label;"
                    accesskey="&userName.accesskey;"
                    control="server.realUsername"/>
       </div>
-      <div hidefor="nntp">
+      <div hidefor="nntp" style="grid-row: 3;">
         <xul:label id="fixedUserName" collapsed="true" use="server.realUsername"/>
         <xul:textbox id="server.realUsername"
                      wsm_persist="true"
                      size="20"
                      flex="1"
                      class="textbox-flex"
                      prefstring="mail.server.%serverkey%.realusername"/>
       </div>
-      <div/>
     </div>
 
     <separator class="thin"/>
 
     <groupbox hidefor="movemail">
       <label class="header">&securitySettings.label;</label>
       <html:table>
         <html:tr>