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

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

Issue 2443603002: Revert of 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');
13 goog.require('EarconEngine'); 12 goog.require('EarconEngine');
14 goog.require('Spannable'); 13 goog.require('Spannable');
15 goog.require('Stubs'); 14 goog.require('Stubs');
16 goog.require('constants'); 15 goog.require('constants');
17 goog.require('cursors.Cursor'); 16 goog.require('cursors.Cursor');
18 goog.require('cursors.Range'); 17 goog.require('cursors.Range');
19 goog.require('cursors.Unit'); 18 goog.require('cursors.Unit');
20 goog.require('cvox.AbstractEarcons'); 19 goog.require('cvox.AbstractEarcons');
21 goog.require('cvox.ChromeVox'); 20 goog.require('cvox.ChromeVox');
22 goog.require('cvox.NavBraille'); 21 goog.require('cvox.NavBraille');
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 speak: '$name' 440 speak: '$name'
442 }, 441 },
443 date: { 442 date: {
444 enter: '$nameFromNode $role $description' 443 enter: '$nameFromNode $role $description'
445 }, 444 },
446 dialog: { 445 dialog: {
447 enter: '$nameFromNode $role $description' 446 enter: '$nameFromNode $role $description'
448 }, 447 },
449 div: { 448 div: {
450 enter: '$nameFromNode', 449 enter: '$nameFromNode',
451 speak: '$nameOrTextContent $description' 450 speak: '$name $description $descendants'
452 }, 451 },
453 embeddedObject: { 452 embeddedObject: {
454 speak: '$name' 453 speak: '$name'
455 }, 454 },
456 grid: { 455 grid: {
457 enter: '$nameFromNode $role $description' 456 enter: '$nameFromNode $role $description'
458 }, 457 },
459 group: { 458 group: {
460 enter: '$nameFromNode $state $description', 459 enter: '$nameFromNode $state $description',
461 speak: '$nameOrDescendants $value $state $description', 460 speak: '$nameOrDescendants $value $state $description',
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 '@describe_radio_unselected($name)) $description' 530 '@describe_radio_unselected($name)) $description'
532 }, 531 },
533 radioGroup: { 532 radioGroup: {
534 enter: '$name $role $description' 533 enter: '$name $role $description'
535 }, 534 },
536 rootWebArea: { 535 rootWebArea: {
537 enter: '$name', 536 enter: '$name',
538 speak: '$if($name, $name, $docUrl)' 537 speak: '$if($name, $name, $docUrl)'
539 }, 538 },
540 region: { 539 region: {
541 speak: '$nameOrTextContent' 540 speak: '$descendants'
542 }, 541 },
543 row: { 542 row: {
544 enter: '$node(tableRowHeader)' 543 enter: '$node(tableRowHeader)'
545 }, 544 },
546 rowHeader: { 545 rowHeader: {
547 speak: '$descendants $state' 546 speak: '$descendants $state'
548 }, 547 },
549 slider: { 548 slider: {
550 speak: '$earcon(SLIDER) @describe_slider($value, $name) $description ' + 549 speak: '$earcon(SLIDER) @describe_slider($value, $name) $description ' +
551 '$state' 550 '$state'
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 if (value == undefined) 1192 if (value == undefined)
1194 return; 1193 return;
1195 value = String(value + 1); 1194 value = String(value + 1);
1196 options.annotation.push(token); 1195 options.annotation.push(token);
1197 this.append_(buff, value, options); 1196 this.append_(buff, value, options);
1198 } else if (token == 'node') { 1197 } else if (token == 'node') {
1199 if (!tree.firstChild || !node[tree.firstChild.value]) 1198 if (!tree.firstChild || !node[tree.firstChild.value])
1200 return; 1199 return;
1201 var related = node[tree.firstChild.value]; 1200 var related = node[tree.firstChild.value];
1202 this.node_(related, related, Output.EventType.NAVIGATE, buff); 1201 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 }
1217 } else if (node[token] !== undefined) { 1202 } else if (node[token] !== undefined) {
1218 options.annotation.push(token); 1203 options.annotation.push(token);
1219 var value = node[token]; 1204 var value = node[token];
1220 if (typeof value == 'number') 1205 if (typeof value == 'number')
1221 value = String(value); 1206 value = String(value);
1222 this.append_(buff, value, options); 1207 this.append_(buff, value, options);
1223 } else if (Output.STATE_INFO_[token]) { 1208 } else if (Output.STATE_INFO_[token]) {
1224 options.annotation.push('state'); 1209 options.annotation.push('state');
1225 var stateInfo = Output.STATE_INFO_[token]; 1210 var stateInfo = Output.STATE_INFO_[token];
1226 var resolvedInfo = {}; 1211 var resolvedInfo = {};
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 /** 1754 /**
1770 * Gets the output buffer for braille. 1755 * Gets the output buffer for braille.
1771 * @return {!Spannable} 1756 * @return {!Spannable}
1772 */ 1757 */
1773 get brailleOutputForTest() { 1758 get brailleOutputForTest() {
1774 return this.createBrailleOutput_(); 1759 return this.createBrailleOutput_();
1775 } 1760 }
1776 }; 1761 };
1777 1762
1778 }); // goog.scope 1763 }); // 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