Bug 1122857 - form controls fail to emit TYPE_VIEW_CLICKED events upon state change. r=eeejay
authorMax Li <maxli@maxli.ca>
Fri, 20 Feb 2015 12:38:50 -0500
changeset 257129 41b3823ec7172ef528e1ee75ead39e9bd0ca0179
parent 257128 5b3151e57fcab9652265017dc12ac539e30ace9a
child 257130 238915c01dc417e306c5529f342a1d9c3a91a5dc
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1122857
milestone38.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 1122857 - form controls fail to emit TYPE_VIEW_CLICKED events upon state change. r=eeejay
accessible/jsat/Presentation.jsm
accessible/tests/mochitest/jsat/test_content_integration.html
--- a/accessible/jsat/Presentation.jsm
+++ b/accessible/jsat/Presentation.jsm
@@ -315,27 +315,29 @@ AndroidPresenter.prototype.pivotChanged 
       details: androidEvents
     };
   };
 
 AndroidPresenter.prototype.actionInvoked =
   function AndroidPresenter_actionInvoked(aObject, aActionName) {
     let state = Utils.getState(aObject);
 
-    // Checkable objects will have a state changed event we will use instead.
-    if (state.contains(States.CHECKABLE)) {
-      return null;
+    // Checkable objects use TalkBack's text derived from the event state,
+    // so we don't populate the text here.
+    let text = '';
+    if (!state.contains(States.CHECKABLE)) {
+      text = Utils.localize(UtteranceGenerator.genForAction(aObject,
+        aActionName));
     }
 
     return {
       type: this.type,
       details: [{
         eventType: this.ANDROID_VIEW_CLICKED,
-        text: Utils.localize(UtteranceGenerator.genForAction(aObject,
-          aActionName)),
+        text: text,
         checked: state.contains(States.CHECKED)
       }]
     };
   };
 
 AndroidPresenter.prototype.tabSelected =
   function AndroidPresenter_tabSelected(aDocContext, aVCContext) {
     // Send a pivot change message with the full context utterance for this doc.
--- a/accessible/tests/mochitest/jsat/test_content_integration.html
+++ b/accessible/tests/mochitest/jsat/test_content_integration.html
@@ -43,17 +43,17 @@
           [ContentMessages.simpleMoveNext,
            new ExpectedCursorChange(['many option', {'string': 'stateNotChecked'},
             {'string': 'checkbutton'}, {'string': 'listStart'},
             {'string': 'list'}, {'string': 'listItemsCount', 'count': 1}])],
 
           // check checkbox
           [ContentMessages.activateCurrent(),
            new ExpectedClickAction({ no_android: true }),
-           new ExpectedCheckAction(true, { android_todo: true })],
+           new ExpectedCheckAction(true)],
           [ContentMessages.simpleMoveNext,
            new ExpectedCursorChange(['much range', {'string': 'label'}])],
           [ContentMessages.simpleMoveNext,
            new ExpectedCursorChange(['much range', '5', {'string': 'slider'}])],
           [ContentMessages.moveOrAdjustUp(), new ExpectedValueChange('6')],
           [ContentMessages.simpleMoveNext,
            new ExpectedCursorChange(['Home', {'string': 'pushbutton'}])],
           [ContentMessages.simpleMoveNext,
@@ -69,17 +69,17 @@
            new ExpectedCursorChange(['much range', {'string': 'label'}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['many option', {'string': 'stateChecked'},
             {'string': 'checkbutton'}, {'string': 'listStart'},
             {'string': 'list'}, {'string': 'listItemsCount', 'count': 1}])],
           // uncheck checkbox
           [ContentMessages.activateCurrent(),
            new ExpectedClickAction({ no_android: true }),
-           new ExpectedCheckAction(false, { android_todo: true })],
+           new ExpectedCheckAction(false)],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['wow', {'string': 'headingLevel', 'args': [1]}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(["Back", {"string": "pushbutton"}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['Phone status bar'])],
 
           [ContentMessages.simpleMoveNext,