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

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

Issue 2441033002: Reland: Further refine div output when a div receives focus (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
11 11
12 goog.require('AutomationTreeWalker');
12 goog.require('EarconEngine'); 13 goog.require('EarconEngine');
13 goog.require('Spannable'); 14 goog.require('Spannable');
14 goog.require('Stubs'); 15 goog.require('Stubs');
15 goog.require('constants'); 16 goog.require('constants');
16 goog.require('cursors.Cursor'); 17 goog.require('cursors.Cursor');
17 goog.require('cursors.Range'); 18 goog.require('cursors.Range');
18 goog.require('cursors.Unit'); 19 goog.require('cursors.Unit');
19 goog.require('cvox.AbstractEarcons'); 20 goog.require('cvox.AbstractEarcons');
20 goog.require('cvox.ChromeVox'); 21 goog.require('cvox.ChromeVox');
21 goog.require('cvox.NavBraille'); 22 goog.require('cvox.NavBraille');
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 speak: '$name' 441 speak: '$name'
441 }, 442 },
442 date: { 443 date: {
443 enter: '$nameFromNode $role $description' 444 enter: '$nameFromNode $role $description'
444 }, 445 },
445 dialog: { 446 dialog: {
446 enter: '$nameFromNode $role $description' 447 enter: '$nameFromNode $role $description'
447 }, 448 },
448 div: { 449 div: {
449 enter: '$nameFromNode', 450 enter: '$nameFromNode',
450 speak: '$name $description $descendants' 451 speak: '$nameOrTextContent $description'
451 }, 452 },
452 embeddedObject: { 453 embeddedObject: {
453 speak: '$name' 454 speak: '$name'
454 }, 455 },
455 grid: { 456 grid: {
456 enter: '$nameFromNode $role $description' 457 enter: '$nameFromNode $role $description'
457 }, 458 },
458 group: { 459 group: {
459 enter: '$nameFromNode $state $description', 460 enter: '$nameFromNode $state $description',
460 speak: '$nameOrDescendants $value $state $description', 461 speak: '$nameOrDescendants $value $state $description',
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 '@describe_radio_unselected($name)) $description' 531 '@describe_radio_unselected($name)) $description'
531 }, 532 },
532 radioGroup: { 533 radioGroup: {
533 enter: '$name $role $description' 534 enter: '$name $role $description'
534 }, 535 },
535 rootWebArea: { 536 rootWebArea: {
536 enter: '$name', 537 enter: '$name',
537 speak: '$if($name, $name, $docUrl)' 538 speak: '$if($name, $name, $docUrl)'
538 }, 539 },
539 region: { 540 region: {
540 speak: '$descendants' 541 speak: '$nameOrTextContent'
541 }, 542 },
542 row: { 543 row: {
543 enter: '$node(tableRowHeader)' 544 enter: '$node(tableRowHeader)'
544 }, 545 },
545 rowHeader: { 546 rowHeader: {
546 speak: '$descendants $state' 547 speak: '$descendants $state'
547 }, 548 },
548 slider: { 549 slider: {
549 speak: '$earcon(SLIDER) @describe_slider($value, $name) $description ' + 550 speak: '$earcon(SLIDER) @describe_slider($value, $name) $description ' +
550 '$state' 551 '$state'
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 if (value == undefined) 1193 if (value == undefined)
1193 return; 1194 return;
1194 value = String(value + 1); 1195 value = String(value + 1);
1195 options.annotation.push(token); 1196 options.annotation.push(token);
1196 this.append_(buff, value, options); 1197 this.append_(buff, value, options);
1197 } else if (token == 'node') { 1198 } else if (token == 'node') {
1198 if (!tree.firstChild || !node[tree.firstChild.value]) 1199 if (!tree.firstChild || !node[tree.firstChild.value])
1199 return; 1200 return;
1200 var related = node[tree.firstChild.value]; 1201 var related = node[tree.firstChild.value];
1201 this.node_(related, related, Output.EventType.NAVIGATE, buff); 1202 this.node_(related, related, Output.EventType.NAVIGATE, buff);
1203 } else if (token == 'nameOrTextContent') {
1204 if (node.name) {
1205 this.format_(node, '$name', buff);
1206 } else {
1207 var walker = new AutomationTreeWalker(node,
1208 Dir.FORWARD,
1209 {visit: AutomationPredicate.leafOrStaticText,
1210 leaf: AutomationPredicate.leafOrStaticText});
1211 while (walker.next().node &&
1212 walker.phase == AutomationTreeWalkerPhase.DESCENDANT) {
1213 if (walker.node.name)
1214 this.append_(buff, walker.node.name, options);
1215 }
1216 }
1202 } else if (node[token] !== undefined) { 1217 } else if (node[token] !== undefined) {
1203 options.annotation.push(token); 1218 options.annotation.push(token);
1204 var value = node[token]; 1219 var value = node[token];
1205 if (typeof value == 'number') 1220 if (typeof value == 'number')
1206 value = String(value); 1221 value = String(value);
1207 this.append_(buff, value, options); 1222 this.append_(buff, value, options);
1208 } else if (Output.STATE_INFO_[token]) { 1223 } else if (Output.STATE_INFO_[token]) {
1209 options.annotation.push('state'); 1224 options.annotation.push('state');
1210 var stateInfo = Output.STATE_INFO_[token]; 1225 var stateInfo = Output.STATE_INFO_[token];
1211 var resolvedInfo = {}; 1226 var resolvedInfo = {};
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 /** 1769 /**
1755 * Gets the output buffer for braille. 1770 * Gets the output buffer for braille.
1756 * @return {!Spannable} 1771 * @return {!Spannable}
1757 */ 1772 */
1758 get brailleOutputForTest() { 1773 get brailleOutputForTest() {
1759 return this.createBrailleOutput_(); 1774 return this.createBrailleOutput_();
1760 } 1775 }
1761 }; 1776 };
1762 1777
1763 }); // goog.scope 1778 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698