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

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

Issue 2479593007: Expose images to accessibility (Closed)
Patch Set: A few more tests rebaselined. Created 4 years, 1 month 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 leave: '' 439 leave: ''
440 }, 440 },
441 heading: { 441 heading: {
442 enter: '!relativePitch(hierarchicalLevel) ' + 442 enter: '!relativePitch(hierarchicalLevel) ' +
443 '$nameFromNode= ' + 443 '$nameFromNode= ' +
444 '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state', 444 '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state',
445 speak: '!relativePitch(hierarchicalLevel) ' + 445 speak: '!relativePitch(hierarchicalLevel) ' +
446 '$nameOrDescendants= ' + 446 '$nameOrDescendants= ' +
447 '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state' 447 '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state'
448 }, 448 },
449 image: {
450 speak: '$if($name, $name, $urlFilename) ' +
451 '$value $state $role $description',
452 },
449 inlineTextBox: { 453 inlineTextBox: {
450 speak: '$name=' 454 speak: '$name='
451 }, 455 },
452 inputTime: { 456 inputTime: {
453 enter: '$nameFromNode $role $description' 457 enter: '$nameFromNode $role $description'
454 }, 458 },
455 link: { 459 link: {
456 enter: '$nameFromNode= $role $state' 460 enter: '$nameFromNode= $role $state'
457 }, 461 },
458 list: { 462 list: {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 this.append_(buff, Msgs.getMsg('selected'), options); 1065 this.append_(buff, Msgs.getMsg('selected'), options);
1062 } else { 1066 } else {
1063 this.append_(buff, text, options); 1067 this.append_(buff, text, options);
1064 } 1068 }
1065 } else if (token == 'name') { 1069 } else if (token == 'name') {
1066 options.annotation.push(token); 1070 options.annotation.push(token);
1067 var earcon = node ? this.findEarcon_(node, opt_prevNode) : null; 1071 var earcon = node ? this.findEarcon_(node, opt_prevNode) : null;
1068 if (earcon) 1072 if (earcon)
1069 options.annotation.push(earcon); 1073 options.annotation.push(earcon);
1070 this.append_(buff, node.name, options); 1074 this.append_(buff, node.name, options);
1075 } else if (token == 'urlFilename') {
1076 options.annotation.push('name');
1077 var url = node.url;
1078 var filename = '';
1079 if (url.substring(0, 4) != 'data') {
1080 filename =
1081 url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
1082
1083 // Hack to not speak the filename if it's ridiculously long.
1084 if (filename.length >= 30)
1085 filename = filename.substring(0, 16) + '...';
1086 }
1087 this.append_(buff, filename, options);
1071 } else if (token == 'nameFromNode') { 1088 } else if (token == 'nameFromNode') {
1072 if (chrome.automation.NameFromType[node.nameFrom] == 1089 if (chrome.automation.NameFromType[node.nameFrom] ==
1073 'contents') 1090 'contents')
1074 return; 1091 return;
1075 1092
1076 options.annotation.push('name'); 1093 options.annotation.push('name');
1077 this.append_(buff, node.name, options); 1094 this.append_(buff, node.name, options);
1078 } else if (token == 'nameOrDescendants') { 1095 } else if (token == 'nameOrDescendants') {
1079 options.annotation.push(token); 1096 options.annotation.push(token);
1080 if (node.name) 1097 if (node.name)
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 /** 1788 /**
1772 * Gets the output buffer for braille. 1789 * Gets the output buffer for braille.
1773 * @return {!Spannable} 1790 * @return {!Spannable}
1774 */ 1791 */
1775 get brailleOutputForTest() { 1792 get brailleOutputForTest() {
1776 return this.createBrailleOutput_(); 1793 return this.createBrailleOutput_();
1777 } 1794 }
1778 }; 1795 };
1779 1796
1780 }); // goog.scope 1797 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698