Bug 1078636 - adding state output to gridcells. r=eeejay
authorYura Zenevich <yzenevich@mozilla.com>
Tue, 07 Oct 2014 21:38:57 -0400
changeset 209251 a86612eb044a4d5da1d0522bff175107a7340eeb
parent 209250 0564e5f5037c1f948f8760f9cfa87cc99d4a63a1
child 209252 fd9219cb431c6016646cf33fb8c930c2cb788853
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerseeejay
bugs1078636
milestone35.0a1
Bug 1078636 - adding state output to gridcells. r=eeejay --- accessible/jsat/OutputGenerator.jsm | 8 ++++++++ accessible/tests/mochitest/jsat/test_output.html | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
accessible/jsat/OutputGenerator.jsm
accessible/tests/mochitest/jsat/test_output.html
--- a/accessible/jsat/OutputGenerator.jsm
+++ b/accessible/jsat/OutputGenerator.jsm
@@ -380,16 +380,24 @@ let OutputGenerator = {
         }, {
           string: this._getOutputName('tblRowInfo'),
           count: table.rowCount
         });
         this._addName(output, aAccessible, aFlags);
         this._addLandmark(output, aAccessible);
         return output;
       }
+    },
+
+    gridcell: function gridcell(aAccessible, aRoleStr, aState, aFlags) {
+      let output = [];
+      this._addState(output, aState);
+      this._addName(output, aAccessible, aFlags);
+      this._addLandmark(output, aAccessible);
+      return output;
     }
   }
 };
 
 /**
  * Generates speech utterances from objects, actions and state changes.
  * An utterance is an array of speech data.
  *
--- a/accessible/tests/mochitest/jsat/test_output.html
+++ b/accessible/tests/mochitest/jsat/test_output.html
@@ -435,16 +435,22 @@ https://bugzilla.mozilla.org/show_bug.cg
           oldAccOrElmOrID: "grid",
           expectedUtterance: [["3"], ["3"]],
           expectedBraille: [["3"], ["3"]]
         }, {
           accOrElmOrID: "gridcell2",
           oldAccOrElmOrID: "grid",
           expectedUtterance: [["4", "7"], ["4", "7"]],
           expectedBraille: [["4", "7"], ["4", "7"]]
+        }, {
+          accOrElmOrID: "gridcell3",
+          oldAccOrElmOrID: "grid",
+          expectedUtterance: [[{"string": "stateSelected"}, "5"],
+                              ["5", {"string": "stateSelected"}]],
+          expectedBraille: [["5"], ["5"]],
         }];
 
         // Test all possible utterance order preference values.
         tests.forEach(function run(test) {
           var utteranceOrderValues = [0, 1];
           utteranceOrderValues.forEach(
             function testUtteranceOrder(utteranceOrder) {
               SpecialPowers.setIntPref(PREF_UTTERANCE_ORDER, utteranceOrder);
@@ -576,15 +582,15 @@ https://bugzilla.mozilla.org/show_bug.cg
         </ol>
         <ol role="row">
           <li id="rowheader" role="rowheader" aria-label="Week 1">1</li>
           <li id="gridcell1" role="gridcell"><span>3</span><div></div></li>
           <li id="gridcell2" role="gridcell"><span>4</span><div>7</div></li>
         </ol>
         <ol role="row">
           <li role="rowheader">2</li>
-          <li role="gridcell">5</li>
+          <li id="gridcell3" aria-selected="true" role="gridcell">5</li>
           <li role="gridcell">6</li>
         </ol>
       </section>
     </div>
   </body>
 </html>