Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js

Issue 2072503002: Correctly fire active descendant changes for more roles Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Provides output services for ChromeVox. 6 * @fileoverview Provides output services for ChromeVox.
7 */ 7 */
8 8
9 goog.provide('Output'); 9 goog.provide('Output');
10 goog.provide('Output.EventType'); 10 goog.provide('Output.EventType');
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 inherits: 'abstractContainer' 223 inherits: 'abstractContainer'
224 }, 224 },
225 menu: { 225 menu: {
226 msgId: 'role_menu', 226 msgId: 'role_menu',
227 earconId: 'LISTBOX', 227 earconId: 'LISTBOX',
228 }, 228 },
229 menuBar: { 229 menuBar: {
230 msgId: 'role_menubar', 230 msgId: 'role_menubar',
231 }, 231 },
232 menuItem: { 232 menuItem: {
233 msgId: 'role_menuitem', 233 msgId: 'role_menuitem'
234 earconId: 'BUTTON'
dmazzoni 2016/06/15 19:15:06 This looks like part of a previous patch?
235 }, 234 },
236 menuItemCheckBox: { 235 menuItemCheckBox: {
237 msgId: 'role_menuitemcheckbox', 236 msgId: 'role_menuitemcheckbox',
238 earconId: 'BUTTON' 237 earconId: 'BUTTON'
239 }, 238 },
240 menuItemRadio: { 239 menuItemRadio: {
241 msgId: 'role_menuitemradio', 240 msgId: 'role_menuitemradio',
242 earconId: 'BUTTON' 241 earconId: 'BUTTON'
243 }, 242 },
244 menuListOption: { 243 menuListOption: {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 'url': 'input_type_url', 396 'url': 'input_type_url',
398 }; 397 };
399 398
400 /** 399 /**
401 * Rules specifying format of AutomationNodes for output. 400 * Rules specifying format of AutomationNodes for output.
402 * @type {!Object<Object<Object<string>>>} 401 * @type {!Object<Object<Object<string>>>}
403 */ 402 */
404 Output.RULES = { 403 Output.RULES = {
405 navigate: { 404 navigate: {
406 'default': { 405 'default': {
407 speak: '$name $value $role $description', 406 speak: '$name $value $activeDescendant $role $description',
408 braille: '' 407 braille: ''
409 }, 408 },
410 abstractContainer: { 409 abstractContainer: {
411 enter: '$nameFromNode $role $description', 410 enter: '$nameFromNode $role $description',
412 leave: '@exited_container($role)' 411 leave: '@exited_container($role)'
413 }, 412 },
414 alert: { 413 alert: {
415 speak: '!doNotInterrupt $role $descendants' 414 speak: '!doNotInterrupt $role $descendants'
416 }, 415 },
417 alertDialog: { 416 alertDialog: {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 }, 456 },
458 listBoxOption: { 457 listBoxOption: {
459 speak: '$name $role @describe_index($indexInParent, $parentChildCount) ' + 458 speak: '$name $role @describe_index($indexInParent, $parentChildCount) ' +
460 '$description' 459 '$description'
461 }, 460 },
462 listItem: { 461 listItem: {
463 enter: '$role' 462 enter: '$role'
464 }, 463 },
465 menu: { 464 menu: {
466 enter: '$name $role', 465 enter: '$name $role',
467 speak: '$name $role @@list_with_items($countChildren(menuItem))' 466 speak: '$name $activeDescendant ' +
467 '$role @@list_with_items($countChildren(menuItem))'
468 }, 468 },
469 menuItem: { 469 menuItem: {
470 speak: '$name $role $if($haspopup, @has_submenu) ' + 470 speak: '$name $role $if($haspopup, @has_submenu) ' +
471 '@describe_index($indexInParent, $parentChildCount) ' + 471 '@describe_index($indexInParent, $parentChildCount) ' +
472 '$description' 472 '$description'
473 }, 473 },
474 menuItemCheckBox: {
475 speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' +
476 '$name $role $checked $description'
477 },
474 menuListOption: { 478 menuListOption: {
475 speak: '$name @role_menuitem ' + 479 speak: '$name @role_menuitem ' +
476 '@describe_index($indexInParent, $parentChildCount) $description' 480 '@describe_index($indexInParent, $parentChildCount) $description'
477 }, 481 },
478 paragraph: { 482 paragraph: {
479 speak: '$descendants' 483 speak: '$descendants'
480 }, 484 },
481 popUpButton: { 485 popUpButton: {
482 speak: '$value $name $role @aria_has_popup ' + 486 speak: '$value $name $activeDescendant $role @aria_has_popup ' +
483 '$if($collapsed, @aria_expanded_false, @aria_expanded_true) ' + 487 '$if($collapsed, @aria_expanded_false, @aria_expanded_true) ' +
484 '$description' 488 '$description'
485 }, 489 },
486 radioButton: { 490 radioButton: {
487 speak: '$if($checked, @describe_radio_selected($name), ' + 491 speak: '$if($checked, @describe_radio_selected($name), ' +
488 '@describe_radio_unselected($name)) $description' 492 '@describe_radio_unselected($name)) $description'
489 }, 493 },
490 radioGroup: { 494 radioGroup: {
491 enter: '$name $role $description' 495 enter: '$name $role $description'
492 }, 496 },
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 this.append_(buff, String(node.indexInParent + 1)); 1039 this.append_(buff, String(node.indexInParent + 1));
1036 } else if (token == 'parentChildCount') { 1040 } else if (token == 'parentChildCount') {
1037 options.annotation.push(token); 1041 options.annotation.push(token);
1038 if (node.parent) 1042 if (node.parent)
1039 this.append_(buff, String(node.parent.children.length)); 1043 this.append_(buff, String(node.parent.children.length));
1040 } else if (token == 'state') { 1044 } else if (token == 'state') {
1041 options.annotation.push(token); 1045 options.annotation.push(token);
1042 Object.getOwnPropertyNames(node.state).forEach(function(s) { 1046 Object.getOwnPropertyNames(node.state).forEach(function(s) {
1043 this.append_(buff, s, options); 1047 this.append_(buff, s, options);
1044 }.bind(this)); 1048 }.bind(this));
1049 } else if (token == 'activeDescendant') {
1050 if (node.activeDescendant) {
1051 var prev = opt_prevNode || node.activeDescendant;
1052 this.node_(node.activeDescendant, prev,
1053 Output.EventType.NAVIGATE, buff);
1054 }
1045 } else if (token == 'find') { 1055 } else if (token == 'find') {
1046 // Find takes two arguments: JSON query string and format string. 1056 // Find takes two arguments: JSON query string and format string.
1047 if (tree.firstChild) { 1057 if (tree.firstChild) {
1048 var jsonQuery = tree.firstChild.value; 1058 var jsonQuery = tree.firstChild.value;
1049 node = node.find( 1059 node = node.find(
1050 /** @type {Object}*/(JSON.parse(jsonQuery))); 1060 /** @type {Object}*/(JSON.parse(jsonQuery)));
1051 var formatString = tree.firstChild.nextSibling; 1061 var formatString = tree.firstChild.nextSibling;
1052 if (node) 1062 if (node)
1053 this.format_(node, formatString, buff); 1063 this.format_(node, formatString, buff);
1054 } 1064 }
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 break; 1619 break;
1610 } 1620 }
1611 earconFinder = earconFinder.parent; 1621 earconFinder = earconFinder.parent;
1612 } 1622 }
1613 } 1623 }
1614 return null; 1624 return null;
1615 } 1625 }
1616 }; 1626 };
1617 1627
1618 }); // goog.scope 1628 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698