Bug 449045 - Drop support for type=timed textboxes. r=enn
authorDão Gottwald <dao@mozilla.com>
Fri, 05 Jan 2018 21:03:39 +0100
changeset 450105 eef0978b42ad4765f71c8c9abe9e5b4a7356da68
parent 450104 7b0bbd94352de559b0656c2b19e482c679ea34b8
child 450106 7c9de87c6eb02d7448297bff489f27cb20c33d24
child 450137 79dbd796c8747d8a70b8669bce06561250241cec
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn
bugs449045
milestone59.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 449045 - Drop support for type=timed textboxes. r=enn MozReview-Commit-ID: Ld6foAxCAhW
editor/reftests/xul/emptytextbox-5.xul
editor/reftests/xul/reftest.list
toolkit/content/widgets/textbox.xml
toolkit/content/xul.css
deleted file mode 100644
--- a/editor/reftests/xul/emptytextbox-5.xul
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        xmlns:html="http://www.w3.org/1999/xhtml"
-        title="Textbox tests">
-
-  <script type="text/javascript" src="platform.js"/>
-
-  <textbox type="timed"/>
-      
-</window>
--- a/editor/reftests/xul/reftest.list
+++ b/editor/reftests/xul/reftest.list
@@ -5,17 +5,16 @@ fails-if(Android) skip-if(winWidget) == 
 fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == autocomplete-1.xul autocomplete-ref.xul # bug 783658
 fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == emptyautocomplete-1.xul emptyautocomplete-ref.xul # bug 783658
 != emptymultiline-1.xul emptymultiline-ref.xul
 fails-if(Android) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658
 fails-if(Android) skip-if(winWidget) == emptytextbox-1.xul emptytextbox-ref.xul # Windows: bug 1239170
 fails-if(Android) skip-if(winWidget) == emptytextbox-2.xul emptytextbox-ref.xul # Windows: bug 1239170
 != emptytextbox-3.xul emptytextbox-ref.xul
 != emptytextbox-4.xul emptytextbox-ref.xul
-fails-if(Android) skip-if(winWidget) == emptytextbox-5.xul emptytextbox-ref.xul # Windows: bug 1239170
 # There is no way to simulate a number textbox in windows XP/Vista/7 default theme using CSS.
 # Therefore, the equlity tests below should be marked as failing.
 != number-1.xul number-ref.xul
 != number-2.xul number-ref.xul
 fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == number-3.xul number-ref.xul # bug 783658
 != number-4.xul number-ref.xul
 fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == number-5.xul number-ref.xul # bug 783658
 fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -252,72 +252,16 @@
         let box = this.inputField.parentNode;
         let menu = document.getAnonymousElementByAttribute(box, "anonid", "input-box-contextmenu");
         box._doPopupItemEnabling(menu);
       </handler>
 #endif
     </handlers>
   </binding>
 
-  <binding id="timed-textbox" extends="chrome://global/content/bindings/textbox.xml#textbox">
-    <implementation>
-      <constructor><![CDATA[
-        try {
-          var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
-                                         .getService(Components.interfaces.nsIConsoleService);
-          var scriptError = Components.classes["@mozilla.org/scripterror;1"]
-                                      .createInstance(Components.interfaces.nsIScriptError);
-          scriptError.init("Timed textboxes are deprecated. Consider using type=\"search\" instead.",
-                           this.ownerDocument.location.href, null, null,
-                           null, scriptError.warningFlag, "XUL Widgets");
-          consoleService.logMessage(scriptError);
-        } catch (e) {}
-      ]]></constructor>
-      <field name="_timer">null</field>
-      <property name="timeout"
-                onset="this.setAttribute('timeout', val); return val;"
-                onget="return parseInt(this.getAttribute('timeout')) || 0;"/>
-      <property name="value"
-                onget="return this.inputField.value;">
-        <setter><![CDATA[
-          this.inputField.value = val;
-          if (this._timer)
-            clearTimeout(this._timer);
-          return val;
-        ]]></setter>
-      </property>
-      <method name="_fireCommand">
-        <parameter name="me"/>
-        <body>
-          <![CDATA[
-            me._timer = null;
-            me.doCommand();
-          ]]>
-        </body>
-      </method>
-    </implementation>
-    <handlers>
-      <handler event="input">
-        <![CDATA[
-          if (this._timer)
-            clearTimeout(this._timer);
-          this._timer = this.timeout && setTimeout(this._fireCommand, this.timeout, this);
-        ]]>
-      </handler>
-      <handler event="keypress" keycode="VK_RETURN">
-        <![CDATA[
-          if (this._timer)
-            clearTimeout(this._timer);
-          this._fireCommand(this);
-          event.preventDefault();
-        ]]>
-      </handler>
-    </handlers>
-  </binding>
-
   <binding id="search-textbox" extends="chrome://global/content/bindings/textbox.xml#textbox">
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck" align="center">
         <xul:image class="textbox-search-sign"/>
         <html:input class="textbox-input" anonid="input" mozactionhint="search"
                     xbl:inherits="value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,spellcheck"/>
         <xul:deck class="textbox-search-icons" anonid="search-icons">
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -773,20 +773,16 @@ html|textarea.textbox-textarea {
 textbox[resizable="true"] > .textbox-input-box > html|textarea.textbox-textarea {
   resize: both;
 }
 
 .textbox-input-box[spellcheck="true"] {
   -moz-binding: url("chrome://global/content/bindings/textbox.xml#input-box-spell");
 }
 
-textbox[type="timed"] {
-  -moz-binding: url("chrome://global/content/bindings/textbox.xml#timed-textbox");
-}
-
 textbox[type="search"] {
   -moz-binding: url("chrome://global/content/bindings/textbox.xml#search-textbox");
 }
 
 textbox[type="number"] {
   -moz-binding: url("chrome://global/content/bindings/numberbox.xml#numberbox");
 }