Bug 1078636 - adding state output to gridcells. r=eeejay
authorYura Zenevich <yzenevich@mozilla.com>
Tue, 07 Oct 2014 21:38:57 -0400
changeset 232466 a86612eb044a4d5da1d0522bff175107a7340eeb
parent 232465 0564e5f5037c1f948f8760f9cfa87cc99d4a63a1
child 232467 fd9219cb431c6016646cf33fb8c930c2cb788853
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1078636
milestone35.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 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>