Bug 1567785 - Convert XUL textbox to HTML input in toolkit/components/prompts/content/. r=bgrins
authorTim Nguyen <ntim.bugs@gmail.com>
Thu, 26 Sep 2019 03:19:36 +0000
changeset 495037 ffcbc621a3be37f38229fc079eb76ee455eabf9d
parent 495036 70f93c9956fc4b4ffc513b610804c91fc4b5be6f
child 495038 4380c0fcda8bc5a31f0f0e20cf53eac499a57a74
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1567785
milestone71.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 1567785 - Convert XUL textbox to HTML input in toolkit/components/prompts/content/. r=bgrins Differential Revision: https://phabricator.services.mozilla.com/D38823
toolkit/components/prompts/content/commonDialog.xul
toolkit/components/prompts/content/tabprompts.jsm
toolkit/components/prompts/test/chromeScript.js
--- a/toolkit/components/prompts/content/commonDialog.xul
+++ b/toolkit/components/prompts/content/commonDialog.xul
@@ -7,22 +7,24 @@
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://global/content/commonDialog.css" type="text/css"?>
 <?xml-stylesheet href="chrome://global/skin/commonDialog.css" type="text/css"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://global/locale/commonDialog.dtd">
 
 <dialog id="commonDialog"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
         aria-describedby="infoBody"
         onunload="commonDialogOnUnload();"
         buttonpack="center">
 
   <script src="chrome://global/content/commonDialog.js"/>
   <script src="chrome://global/content/globalOverlay.js"/>
+  <script src="chrome://global/content/editMenuOverlay.js"/>
   <script src="chrome://global/content/customElements.js"/>
   <script>
     document.addEventListener("DOMContentLoaded", function() {
       commonDialogOnLoad();
     });
   </script>
 
   <commandset id="selectEditMenuItems">
@@ -73,21 +75,21 @@
             style="margin-bottom: 1em"
 #endif
           />
           <description id="infoBody" context="contentAreaContextMenu" noinitialfocus="true"/>
         </vbox>
       </row>
       <row id="loginContainer" hidden="true" align="center">
         <label id="loginLabel" value="&editfield0.label;" control="loginTextbox"/>
-        <textbox id="loginTextbox"/>
+        <html:input id="loginTextbox"/>
       </row>
       <row id ="password1Container" hidden="true" align="center">
         <label id="password1Label" value="&editfield1.label;" control="password1Textbox"/>
-        <textbox type="password" id="password1Textbox"/>
+        <html:input type="password" id="password1Textbox"/>
       </row>
       <row id="checkboxContainer" hidden="true">
         <spacer/>
         <checkbox id="checkbox" oncommand="Dialog.onCheckbox()"/>
       </row>
     </rows>
   </grid>
 
--- a/toolkit/components/prompts/content/tabprompts.jsm
+++ b/toolkit/components/prompts/content/tabprompts.jsm
@@ -37,22 +37,22 @@ var TabModalPrompt = class {
               <rows class="tabmodalprompt-rows">
                 <vbox class="tabmodalprompt-infoContainer" align="center" pack="center" flex="1">
                   <description class="tabmodalprompt-infoTitle infoTitle" hidden="true" />
                   <description class="tabmodalprompt-infoBody infoBody" id="infoBody-${randomIdSuffix}"/>
                 </vbox>
 
                 <row class="tabmodalprompt-loginContainer" hidden="true" align="center">
                   <label class="tabmodalprompt-loginLabel" value="&editfield0.label;" control="loginTextbox-${randomIdSuffix}"/>
-                  <textbox class="tabmodalprompt-loginTextbox" id="loginTextbox-${randomIdSuffix}"/>
+                  <html:input class="tabmodalprompt-loginTextbox" id="loginTextbox-${randomIdSuffix}"/>
                 </row>
 
                 <row class="tabmodalprompt-password1Container" hidden="true" align="center">
                   <label class="tabmodalprompt-password1Label" value="&editfield1.label;" control="password1Textbox-${randomIdSuffix}"/>
-                  <textbox class="tabmodalprompt-password1Textbox" type="password" id="password1Textbox-${randomIdSuffix}"/>
+                  <html:input class="tabmodalprompt-password1Textbox" type="password" id="password1Textbox-${randomIdSuffix}"/>
                 </row>
 
                 <row class="tabmodalprompt-checkboxContainer" hidden="true">
                   <spacer/>
                   <checkbox class="tabmodalprompt-checkbox"/>
                 </row>
 
                 <!-- content goes here -->
--- a/toolkit/components/prompts/test/chromeScript.js
+++ b/toolkit/components/prompts/test/chromeScript.js
@@ -87,18 +87,18 @@ function getPromptState(ui) {
   state.titleHidden = ui.infoTitle.getAttribute("hidden") == "true";
   state.textHidden = ui.loginContainer.hidden;
   state.passHidden = ui.password1Container.hidden;
   state.checkHidden = ui.checkboxContainer.hidden;
   state.checkMsg = state.checkHidden ? "" : ui.checkbox.label;
   state.checked = state.checkHidden ? false : ui.checkbox.checked;
   // tab-modal prompts don't have an infoIcon
   state.iconClass = ui.infoIcon ? ui.infoIcon.className : null;
-  state.textValue = ui.loginTextbox.getAttribute("value");
-  state.passValue = ui.password1Textbox.getAttribute("value");
+  state.textValue = ui.loginTextbox.value;
+  state.passValue = ui.password1Textbox.value;
 
   state.butt0Label = ui.button0.label;
   state.butt1Label = ui.button1.label;
   state.butt2Label = ui.button2.label;
 
   state.butt0Disabled = ui.button0.disabled;
   state.butt1Disabled = ui.button1.disabled;
   state.butt2Disabled = ui.button2.disabled;
@@ -115,19 +115,19 @@ function getPromptState(ui) {
   if (e == null) {
     state.focused = null;
   } else if (ui.button0.isSameNode(e)) {
     state.focused = "button0";
   } else if (ui.button1.isSameNode(e)) {
     state.focused = "button1";
   } else if (ui.button2.isSameNode(e)) {
     state.focused = "button2";
-  } else if (e.isSameNode(ui.loginTextbox.inputField)) {
+  } else if (e.isSameNode(ui.loginTextbox)) {
     state.focused = "textField";
-  } else if (e.isSameNode(ui.password1Textbox.inputField)) {
+  } else if (e.isSameNode(ui.password1Textbox)) {
     state.focused = "passField";
   } else if (ui.infoBody.isSameNode(e)) {
     state.focused = "infoBody";
   } else {
     state.focused =
       "ERROR: unexpected element focused: " + (e ? e.localName : "<null>");
   }