Bug 932158 - Ensure that the type information is not included into the output for an input of type 'text'. r=eeejay, a=bajaj
authorYura Zenevich <yura.zenevich@gmail.com>
Fri, 01 Nov 2013 09:38:41 -0400
changeset 167326 f040b8d8c29d4c9c9f0278f2ddf63799edcd392c
parent 167325 2da1e7e586a4608096dc0db258a0da8fdc9452f0
child 167327 6383a9b61c9acc413c32c9e0a85e619ddbd79b86
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay, bajaj
bugs932158
milestone27.0a2
Bug 932158 - Ensure that the type information is not included into the output for an input of type 'text'. r=eeejay, a=bajaj
accessible/src/jsat/OutputGenerator.jsm
accessible/tests/mochitest/jsat/test_utterance_order.html
--- a/accessible/src/jsat/OutputGenerator.jsm
+++ b/accessible/src/jsat/OutputGenerator.jsm
@@ -211,17 +211,18 @@ this.OutputGenerator = {
    * @param {String} aRoleStr aAccessible's role string.
    */
   _addType: function _addType(aDesc, aAccessible, aRoleStr) {
     if (aRoleStr !== 'entry') {
       return;
     }
 
     let typeName = Utils.getAttributes(aAccessible)['text-input-type'];
-    if (!typeName) {
+    // Ignore the the input type="text" case.
+    if (!typeName || typeName === 'text') {
       return;
     }
     aDesc.push(gStringBundle.GetStringFromName('textInputType_' + typeName));
   },
 
   get outputOrder() {
     if (!this._utteranceOrder) {
       this._utteranceOrder = new PrefCache('accessibility.accessfu.utterance');
--- a/accessible/tests/mochitest/jsat/test_utterance_order.html
+++ b/accessible/tests/mochitest/jsat/test_utterance_order.html
@@ -102,16 +102,19 @@ https://bugzilla.mozilla.org/show_bug.cg
           ]
         }, {
           accOrElmOrID: "url",
           expected: [
             ["URL entry", "http://example.com"],
             ["http://example.com", "URL entry"]
           ]
         }, {
+          accOrElmOrID: "textInput",
+          expected: [["entry", "This is text."], ["This is text.", "entry"]]
+        }, {
           // Test pivot to list from li_one.
           accOrElmOrID: "list",
           oldAccOrElmOrID: "li_one",
           expected: [
             ["list 1 item", "First item", "1.", "list one"],
             ["1.", "list one", "First item", "list 1 item"]
           ]
         }, {
@@ -298,11 +301,12 @@ https://bugzilla.mozilla.org/show_bug.cg
       <label id="label3">First name: <input id="input3" value="Joe"></label>
       <label id="label4">Points:
         <input id="input4" type="range" name="points" min="1" max="10" value="3">
       </label>
       <input id="email" type="email" value="test@example.com" />
       <input id="search" type="search" value="This is a search" />
       <input id="tel" type="tel" value="555-5555" />
       <input id="url" type="url" value="http://example.com" />
+      <input id="textInput" type="text" value="This is text." />
     </div>
   </body>
 </html>