Bug 449045 - Drop support for type="timed" textboxes. r?enn draft
authorDão Gottwald <dao@mozilla.com>
Fri, 05 Jan 2018 21:03:39 +0100
changeset 716431 d79222293d4970239b0c8ecdc1151351fc5d0480
parent 716325 81362f7306fe413b19fdba27cd0e9a5525d902e1
child 745041 4ada4ef3c7b2f86f1f1a6e6ad091c0048ea0d1d6
push id94442
push userdgottwald@mozilla.com
push dateFri, 05 Jan 2018 20:04:07 +0000
reviewersenn
bugs449045
milestone59.0a1
Bug 449045 - Drop support for type="timed" textboxes. r?enn MozReview-Commit-ID: 4qyghHveFUf
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");
 }