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

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

Issue 2331163002: Refine output of containers when focused (Closed)
Patch Set: Fix code to match test expectations; remove most descendant output. Created 4 years, 3 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');
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 * @type {!Object<Object<Object<string>>>} 414 * @type {!Object<Object<Object<string>>>}
415 */ 415 */
416 Output.RULES = { 416 Output.RULES = {
417 navigate: { 417 navigate: {
418 'default': { 418 'default': {
419 speak: '$name $value $state $role $description', 419 speak: '$name $value $state $role $description',
420 braille: '' 420 braille: ''
421 }, 421 },
422 abstractContainer: { 422 abstractContainer: {
423 enter: '$nameFromNode $role $state $description', 423 enter: '$nameFromNode $role $state $description',
424 speak: '$descendants $name $value $state $role $description', 424 speak: '$name $value $state $role $description',
425 leave: '@exited_container($role)' 425 leave: '@exited_container($role)'
426 }, 426 },
427 alert: { 427 alert: {
428 speak: '!doNotInterrupt $role $descendants' 428 speak: '!doNotInterrupt $role $descendants'
429 }, 429 },
430 alertDialog: { 430 alertDialog: {
431 enter: '$nameFromNode $role $description', 431 enter: '$nameFromNode $role $description',
432 speak: '$name $role $descendants' 432 speak: '$name $role $descendants'
433 }, 433 },
434 cell: { 434 cell: {
(...skipping 15 matching lines...) Expand all
450 }, 450 },
451 div: { 451 div: {
452 enter: '$nameFromNode', 452 enter: '$nameFromNode',
453 speak: '$name $description $descendants' 453 speak: '$name $description $descendants'
454 }, 454 },
455 grid: { 455 grid: {
456 enter: '$nameFromNode $role $description' 456 enter: '$nameFromNode $role $description'
457 }, 457 },
458 group: { 458 group: {
459 enter: '$nameFromNode $state $description', 459 enter: '$nameFromNode $state $description',
460 speak: '$descendants $name $value $state $description', 460 speak: '$nameOrDescendants $value $state $description',
461 leave: '' 461 leave: ''
462 }, 462 },
463 heading: { 463 heading: {
464 enter: '!relativePitch(hierarchicalLevel) ' + 464 enter: '!relativePitch(hierarchicalLevel) ' +
465 '$nameFromNode= @tag_h+$hierarchicalLevel', 465 '$nameFromNode= @tag_h+$hierarchicalLevel',
466 speak: '!relativePitch(hierarchicalLevel)' + 466 speak: '!relativePitch(hierarchicalLevel)' +
467 ' $nameOrDescendants= @tag_h+$hierarchicalLevel' 467 ' $nameOrDescendants= @tag_h+$hierarchicalLevel'
468 }, 468 },
469 inlineTextBox: { 469 inlineTextBox: {
470 speak: '$name=' 470 speak: '$name='
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 for (var j = uniqueAncestors.length - 2, hashNode; 1428 for (var j = uniqueAncestors.length - 2, hashNode;
1429 (hashNode = uniqueAncestors[j]); 1429 (hashNode = uniqueAncestors[j]);
1430 j--) 1430 j--)
1431 enteredRoleSet[hashNode.role] = true; 1431 enteredRoleSet[hashNode.role] = true;
1432 1432
1433 for (var i = 0, formatPrevNode; 1433 for (var i = 0, formatPrevNode;
1434 (formatPrevNode = prevUniqueAncestors[i]); 1434 (formatPrevNode = prevUniqueAncestors[i]);
1435 i++) { 1435 i++) {
1436 // This prevents very repetitive announcements. 1436 // This prevents very repetitive announcements.
1437 if (enteredRoleSet[formatPrevNode.role] || 1437 if (enteredRoleSet[formatPrevNode.role] ||
1438 node.role == formatPrevNode.role ||
1438 localStorage['useVerboseMode'] == 'false') 1439 localStorage['useVerboseMode'] == 'false')
1439 continue; 1440 continue;
1440 1441
1441 var roleBlock = getMergedRoleBlock(formatPrevNode.role); 1442 var roleBlock = getMergedRoleBlock(formatPrevNode.role);
1442 if (roleBlock.leave && localStorage['useVerboseMode'] == 'true') 1443 if (roleBlock.leave && localStorage['useVerboseMode'] == 'true')
1443 this.format_(formatPrevNode, roleBlock.leave, buff, prevNode); 1444 this.format_(formatPrevNode, roleBlock.leave, buff, prevNode);
1444 } 1445 }
1445 1446
1446 var enterOutputs = []; 1447 var enterOutputs = [];
1447 var enterRole = {}; 1448 var enterRole = {};
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 break; 1707 break;
1707 } 1708 }
1708 earconFinder = earconFinder.parent; 1709 earconFinder = earconFinder.parent;
1709 } 1710 }
1710 } 1711 }
1711 return null; 1712 return null;
1712 } 1713 }
1713 }; 1714 };
1714 1715
1715 }); // goog.scope 1716 }); // 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