[tbb-commits] [tor-launcher/master] Bug 32154: Custom bridge field only allows one line of input

gk at torproject.org gk at torproject.org
Fri Oct 18 21:10:59 UTC 2019


commit d3c66f516b07271ea4bb5f2481d9e02ff912b0ce
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Fri Oct 18 13:39:15 2019 -0400

    Bug 32154: Custom bridge field only allows one line of input
    
    Mozilla is working on removing XUL <textbox>, and prior to ESR68
    they removed support for the multiline attribute. Switch to
    <html:textarea> and adjust styles to make the appearance closely
    match <textbox>.
---
 src/chrome/content/network-settings-shared.js  |  6 +++---
 src/chrome/content/network-settings-wizard.xul |  1 +
 src/chrome/content/network-settings.js         |  4 +++-
 src/chrome/content/network-settings.xul        |  1 +
 src/chrome/skin/network-settings.css           | 11 ++++++++++-
 5 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/chrome/content/network-settings-shared.js b/src/chrome/content/network-settings-shared.js
index f1bdb91..1575f3d 100644
--- a/src/chrome/content/network-settings-shared.js
+++ b/src/chrome/content/network-settings-shared.js
@@ -122,9 +122,9 @@ var bridgeSettings = `
       <vbox id="bridgeCustomEntry">
         <label id="bridgeListLabel" style="margin-top:0px;"
                value="&torsettings.useBridges.label;" control="bridgeList"/>
-        <textbox id="bridgeList" multiline="true" rows="3" wrap="off"
-                 oninput="onCustomBridgesTextInput();"
-                 placeholder="&torsettings.useBridges.placeholder;"/>
+        <html:textarea id="bridgeList" rows="3" wrap="off"
+                       oninput="onCustomBridgesTextInput();"
+                       placeholder="&torsettings.useBridges.placeholder;"/>
       </vbox>
     </groupbox>
   </vbox>
diff --git a/src/chrome/content/network-settings-wizard.xul b/src/chrome/content/network-settings-wizard.xul
index ec48bd0..98dbdd8 100644
--- a/src/chrome/content/network-settings-wizard.xul
+++ b/src/chrome/content/network-settings-wizard.xul
@@ -12,6 +12,7 @@
 
 <wizard id="TorNetworkSettings"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
         defaulttitle="&torsettings.wizard.title.default;"
         windowtype="TorLauncher:NetworkSettings"
         persist="screenX screenY"
diff --git a/src/chrome/content/network-settings.js b/src/chrome/content/network-settings.js
index 8c1db0f..709c939 100644
--- a/src/chrome/content/network-settings.js
+++ b/src/chrome/content/network-settings.js
@@ -2485,6 +2485,7 @@ function setElemValue(aID, aValue)
         elem.checked = val;
         toggleElemUI(elem);
         break;
+      case "html:textarea":
       case "textbox":
         if (Array.isArray(aValue))
         {
@@ -2534,7 +2535,7 @@ function setBridgeListElemValue(aBridgeArray)
 
 
 // Returns a Boolean (for checkboxes/radio buttons) or a
-// string (textbox and menulist).
+// string (textarea, textbox, and menulist).
 // Leading and trailing white space is trimmed from strings.
 function getElemValue(aID, aDefaultValue)
 {
@@ -2550,6 +2551,7 @@ function getElemValue(aID, aDefaultValue)
       case "radio":
         rv = elem.selected;
         break;
+      case "html:textarea":
       case "textbox":
       case "menulist":
       case "richlistbox":
diff --git a/src/chrome/content/network-settings.xul b/src/chrome/content/network-settings.xul
index 6a8fac4..1d3423e 100644
--- a/src/chrome/content/network-settings.xul
+++ b/src/chrome/content/network-settings.xul
@@ -13,6 +13,7 @@
 
 <dialog id="TorNetworkSettings"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
         title="&torsettings.dialog.title;"
         windowtype="TorLauncher:NetworkSettings"
         persist="screenX screenY"
diff --git a/src/chrome/skin/network-settings.css b/src/chrome/skin/network-settings.css
index 9fed4f2..aae7c0b 100644
--- a/src/chrome/skin/network-settings.css
+++ b/src/chrome/skin/network-settings.css
@@ -5,6 +5,8 @@
  * vim: set sw=2 sts=2 ts=8 et syntax=css:
  */
 
+ at namespace html "http://www.w3.org/1999/xhtml";
+
 dialog {
   width: 45em;
   height: 41em;
@@ -294,13 +296,20 @@ dialog .help {
   max-width: 34em;
 }
 
+html|textarea {
+  padding: 4px !important;
+  margin-top: 4px;
+  font-family: inherit;
+}
+
 /* Increase font size on Windows for readability */
 .os-windows div,
 .os-windows label,
 .os-windows description,
+.os-windows html|textarea,
 .os-windows textbox
 {
-  font-size: 120%;
+  font-size: 120% !important;
 }
 
 .torWarning {



More information about the tbb-commits mailing list