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

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

Issue 2799443002: Implemented ARIA colindex, rowindex, colcount and rowcount for Chromevox. (Closed)
Patch Set: Fixed automation test. Created 3 years, 8 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 '$name $role $description $state' 419 '$name $role $description $state'
420 }, 420 },
421 alert: { 421 alert: {
422 enter: '$name $role $state', 422 enter: '$name $role $state',
423 speak: '$earcon(ALERT_NONMODAL) $role $nameOrTextContent $state' 423 speak: '$earcon(ALERT_NONMODAL) $role $nameOrTextContent $state'
424 }, 424 },
425 alertDialog: { 425 alertDialog: {
426 enter: '$earcon(ALERT_MODAL) $name $state', 426 enter: '$earcon(ALERT_MODAL) $name $state',
427 speak: '$earcon(ALERT_MODAL) $name $nameOrTextContent $state $role' 427 speak: '$earcon(ALERT_MODAL) $name $nameOrTextContent $state $role'
428 }, 428 },
429 cell: { 429 cell: {
David Tseng 2017/04/11 03:48:09 Also, I think you also want to modify the output r
430 enter: '@cell_summary($tableCellRowIndex, $tableCellColumnIndex) ' + 430 enter: '@cell_summary($if($ariaCellRowIndex, $ariaCellRowIndex,' +
David Tseng 2017/04/11 03:40:55 Is the aria row index here possibly 0? $if would e
431 '$node(tableColumnHeader)', 431 '$tableCellRowIndex), $if($ariaCellColumnIndex, $ariaCellColumnIndex,' +
432 speak: '@cell_summary($tableCellRowIndex, $tableCellColumnIndex) ' + 432 '$tableCellColumnIndex)) $node(tableColumnHeader)',
433 '$node(tableColumnHeader) $state' 433 speak: '@cell_summary($if($ariaCellRowIndex, $ariaCellRowIndex,' +
434 '$tableCellRowIndex), $if($ariaCellColumnIndex, $ariaCellColumnIndex,' +
435 '$tableCellColumnIndex)) $node(tableColumnHeader) $state'
434 }, 436 },
435 checkBox: { 437 checkBox: {
436 speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + 438 speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' +
437 '$name $role $checked $description $state' 439 '$name $role $checked $description $state'
438 }, 440 },
439 client: { 441 client: {
440 speak: '$name' 442 speak: '$name'
441 }, 443 },
442 date: { 444 date: {
443 enter: '$nameFromNode $role $description' 445 enter: '$nameFromNode $role $description'
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 msgId = msgId + '_brl'; 1246 msgId = msgId + '_brl';
1245 this.append_(buff, Msgs.getMsg(msgId), options); 1247 this.append_(buff, Msgs.getMsg(msgId), options);
1246 } else if (token == 'tableCellRowIndex' || 1248 } else if (token == 'tableCellRowIndex' ||
1247 token == 'tableCellColumnIndex') { 1249 token == 'tableCellColumnIndex') {
1248 var value = node[token]; 1250 var value = node[token];
1249 if (value == undefined) 1251 if (value == undefined)
1250 return; 1252 return;
1251 value = String(value + 1); 1253 value = String(value + 1);
1252 options.annotation.push(token); 1254 options.annotation.push(token);
1253 this.append_(buff, value, options); 1255 this.append_(buff, value, options);
1256 } else if (token == 'ariaCellRowIndex' ||
David Tseng 2017/04/11 03:40:55 The $ prefix defaults to an attribute lookup so th
1257 token == 'ariaCellColumnIndex') {
1258 var value = node[token];
1259 if (value == undefined)
David Tseng 2017/04/11 03:40:55 You don't need this if you're already using $if ab
1260 return;
1261 options.annotation.push(token);
1262 this.append_(buff, value, options);
1254 } else if (token == 'node') { 1263 } else if (token == 'node') {
1255 if (!tree.firstChild || !node[tree.firstChild.value]) 1264 if (!tree.firstChild || !node[tree.firstChild.value])
1256 return; 1265 return;
1257 var related = node[tree.firstChild.value]; 1266 var related = node[tree.firstChild.value];
1258 this.node_(related, related, Output.EventType.NAVIGATE, buff); 1267 this.node_(related, related, Output.EventType.NAVIGATE, buff);
1259 } else if (token == 'nameOrTextContent') { 1268 } else if (token == 'nameOrTextContent') {
1260 if (node.name) { 1269 if (node.name) {
1261 this.format_(node, '$name', buff); 1270 this.format_(node, '$name', buff);
1262 } else { 1271 } else {
1263 var walker = new AutomationTreeWalker(node, 1272 var walker = new AutomationTreeWalker(node,
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 /** 1886 /**
1878 * Gets the output buffer for braille. 1887 * Gets the output buffer for braille.
1879 * @return {!Spannable} 1888 * @return {!Spannable}
1880 */ 1889 */
1881 get brailleOutputForTest() { 1890 get brailleOutputForTest() {
1882 return this.mergeBraille_(this.brailleBuffer_); 1891 return this.mergeBraille_(this.brailleBuffer_);
1883 } 1892 }
1884 }; 1893 };
1885 1894
1886 }); // goog.scope 1895 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/automation.idl » ('j') | chrome/common/extensions/api/automation.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698