Bug 1519957, remove textbox value resetting that relying on box objects. This in some cases prevents the value from restoring but it doesn't restore in all useful cases anyway, r=dao
authorNeil Deakin <neil@mozilla.com>
Fri, 01 Mar 2019 12:27:08 -0500
changeset 519982 63908a1890a03509eb8176562b46fa484b71673e
parent 519981 bc5daa250f8a86bde24db54e9b242b98c3560777
child 519983 57624be2e55cefabe21feb5e0169f33b283f9ddd
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1519957
milestone67.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 1519957, remove textbox value resetting that relying on box objects. This in some cases prevents the value from restoring but it doesn't restore in all useful cases anyway, r=dao
toolkit/content/widgets/textbox.xml
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -158,33 +158,35 @@
           if (!this.mIgnoreClick && this.clickSelectsAll &&
               document.activeElement == this.inputField &&
               this.inputField.selectionStart == this.inputField.selectionEnd)
             this.editor.selectAll();
         ]]></body>
       </method>
 
       <constructor><![CDATA[
-        var str = this.boxObject.getProperty("value");
+        var str = this._cachedInputFieldValue;
         if (str) {
           this.inputField.value = str;
-          this.boxObject.removeProperty("value");
+          delete this._cachedInputFieldValue;
         }
 
         this._setNewlineHandling();
 
         if (this.hasAttribute("emptytext"))
           this.placeholder = this.getAttribute("emptytext");
       ]]></constructor>
 
       <destructor>
         <![CDATA[
           var field = this.inputField;
-          if (field && field.value)
-            this.boxObject.setProperty("value", field.value);
+          if (field && field.value) {
+            this._cachedInputFieldValue = field.value;
+          }
+
           this.mInputField = null;
         ]]>
       </destructor>
 
     </implementation>
 
     <handlers>
       <handler event="focus" phase="capturing">