Bug 1562809 - Convert XUL textboxes in setp12password.xul and changepassword.xul to HTML inputs. r=keeler
☠☠ backed out by 89ef9660735b ☠ ☠
authorTim Nguyen <ntim.bugs@gmail.com>
Wed, 03 Jul 2019 17:32:25 +0000
changeset 544002 08ff2f330260f8b888447ee4c5695bf58104654e
parent 544001 8a08f6450ed10f1bfdefb1f4c0af0b71da7bd55f
child 544003 80afa74b9d9f95d663dc7f93e8077ab50f9d73ef
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1562809
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1562809 - Convert XUL textboxes in setp12password.xul and changepassword.xul to HTML inputs. r=keeler Differential Revision: https://phabricator.services.mozilla.com/D36560
security/manager/pki/resources/content/changepassword.js
security/manager/pki/resources/content/changepassword.xul
security/manager/pki/resources/content/setp12password.xul
--- a/security/manager/pki/resources/content/changepassword.js
+++ b/security/manager/pki/resources/content/changepassword.js
@@ -28,32 +28,32 @@ function onLoad() {
 
 function process() {
   let bundle = document.getElementById("pippki_bundle");
   let oldpwbox = document.getElementById("oldpw");
   let msgBox = document.getElementById("message");
   // If the token is unitialized, don't use the old password box.
   // Otherwise, do.
   if ((token.needsLogin() && token.needsUserInit) || !token.needsLogin()) {
-    oldpwbox.setAttribute("hidden", "true");
+    oldpwbox.hidden = true;
     msgBox.setAttribute("value", bundle.getString("password_not_set"));
-    msgBox.setAttribute("hidden", "false");
+    msgBox.hidden = false;
 
     if (!token.needsLogin()) {
       oldpwbox.setAttribute("inited", "empty");
     } else {
       oldpwbox.setAttribute("inited", "true");
     }
 
     // Select first password field
     document.getElementById("pw1").focus();
   } else {
     // Select old password field
-    oldpwbox.setAttribute("hidden", "false");
-    msgBox.setAttribute("hidden", "true");
+    oldpwbox.hidden = false;
+    msgBox.hidden = true;
     oldpwbox.setAttribute("inited", "false");
     oldpwbox.focus();
   }
 
   // Return value 0 means "canceled"
   params.SetInt(1, 0);
 
   checkPasswords();
--- a/security/manager/pki/resources/content/changepassword.xul
+++ b/security/manager/pki/resources/content/changepassword.xul
@@ -8,48 +8,54 @@
 <!DOCTYPE dialog SYSTEM "chrome://pippki/locale/pippki.dtd">
 
 <dialog id="set_password" title="&setPassword.title;"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:html="http://www.w3.org/1999/xhtml"
   buttons="accept,cancel"
   onload="onLoad();">
 
+<html:style>
+.input-row {
+  margin-block: 2px;
+}
+</html:style>
+
 <stringbundle id="pippki_bundle" src="chrome://pippki/locale/pippki.properties"/>
 
 <script src="chrome://pippki/content/changepassword.js"/>
 
 <hbox align="center">
   <label value="&setPassword.tokenName.label;: "/>
   <label id="tokenName" />
 </hbox>
 
 <separator/>
 
 <vbox>
-  <hbox>
+  <hbox class="input-row">
     <label flex="1" value="&setPassword.oldPassword.label;"/>
-    <textbox id="oldpw" type="password"/>
+    <html:input id="oldpw" type="password"/>
     <!-- This textbox is inserted as a workaround to the fact that making the 'type'
          & 'disabled' property of the 'oldpw' textbox toggle between ['password' &
          'false'] and ['text' & 'true'] - as would be necessary if the menu has more
          than one tokens, some initialized and some not - does not work properly. So,
          either the textbox 'oldpw' or the textbox 'message' would be displayed,
          depending on the state of the token selected
      -->
-     <textbox id="message" disabled="true" />
+     <html:input id="message" disabled="true" />
    </hbox>
-  <hbox>
+  <hbox class="input-row">
     <label flex="1" value="&setPassword.newPassword.label;"/>
-    <textbox id="pw1" type="password"
-             oninput="setPasswordStrength(); checkPasswords();"/>
+    <html:input id="pw1" type="password"
+                oninput="setPasswordStrength(); checkPasswords();"/>
   </hbox>
-  <hbox>
+  <hbox class="input-row">
     <label flex="1" value="&setPassword.reenterPassword.label;"/>
-    <textbox id="pw2" type="password" oninput="checkPasswords();"/>
+    <html:input id="pw2" type="password" oninput="checkPasswords();"/>
   </hbox>
 </vbox>
 
 <vbox style="margin: 6px;">
   <html:label for="pwmeter" style="display: -moz-box;">&setPassword.meter.label;</html:label>
   <html:progress id="pwmeter" value="0" max="100"/>
 </vbox>
 
--- a/security/manager/pki/resources/content/setp12password.xul
+++ b/security/manager/pki/resources/content/setp12password.xul
@@ -10,28 +10,35 @@
 <dialog id="setp12password"
         title="&pkcs12.setpassword.title;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         style="width: 48em;"
         buttons="accept,cancel"
         onload="onLoad();">
 
+  <html:style>
+  .input-row {
+    margin-block: 2px;
+    margin-inline-end: 6px; /* align with password meter vbox */
+  }
+  </html:style>
+
   <script src="chrome://pippki/content/setp12password.js"/>
 
   <description>&pkcs12.setpassword.message;</description>
   <separator />
   <vbox>
-    <hbox>
+    <hbox class="input-row">
       <label flex="1" value="&pkcs12.setpassword.label1;"/>
-      <textbox id="pw1" type="password" oninput="onPasswordInput(true);"/>
+      <html:input id="pw1" type="password" oninput="onPasswordInput(true);"/>
     </hbox>
-    <hbox>
+    <hbox class="input-row">
       <label flex="1" value="&pkcs12.setpassword.label2;"/>
-      <textbox id="pw2" type="password" oninput="onPasswordInput(false);"/>
+      <html:input id="pw2" type="password" oninput="onPasswordInput(false);"/>
     </hbox>
   </vbox>
   <separator/>
   <description>&pkcs12.setpassword.reminder;</description>
   <separator/>
 
   <vbox style="margin: 6px;">
     <html:label for="pwmeter" style="display: -moz-box;">&setPassword.meter.label;</html:label>