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

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

Issue 1801363003: Add a $joinedDescendants output specifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 9 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 if (!leftmost || !rightmost) 1036 if (!leftmost || !rightmost)
1037 return; 1037 return;
1038 1038
1039 var subrange = new cursors.Range( 1039 var subrange = new cursors.Range(
1040 new cursors.Cursor(leftmost, 0), 1040 new cursors.Cursor(leftmost, 0),
1041 new cursors.Cursor(rightmost, 0)); 1041 new cursors.Cursor(rightmost, 0));
1042 var prev = null; 1042 var prev = null;
1043 if (node) 1043 if (node)
1044 prev = cursors.Range.fromNode(node); 1044 prev = cursors.Range.fromNode(node);
1045 this.range_(subrange, prev, Output.EventType.NAVIGATE, buff); 1045 this.range_(subrange, prev, Output.EventType.NAVIGATE, buff);
1046 } else if (token == 'joinedDescendants') {
1047 var unjoined = [];
1048 this.format_(node, '$descendants', unjoined);
1049 this.append_(buff, unjoined.join(' '), options);
1046 } else if (token == 'role') { 1050 } else if (token == 'role') {
1047 if (localStorage['useVerboseMode'] == 'false') 1051 if (localStorage['useVerboseMode'] == 'false')
1048 return; 1052 return;
1049 1053
1050 if (this.formatOptions_.auralStyle) { 1054 if (this.formatOptions_.auralStyle) {
1051 speechProps = new Output.SpeechProperties(); 1055 speechProps = new Output.SpeechProperties();
1052 speechProps['relativePitch'] = -0.3; 1056 speechProps['relativePitch'] = -0.3;
1053 } 1057 }
1054 options.annotation.push(token); 1058 options.annotation.push(token);
1055 var msg = node.role; 1059 var msg = node.role;
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 elem.end); 1542 elem.end);
1539 }); 1543 });
1540 spansToRemove.forEach(result.removeSpan.bind(result)); 1544 spansToRemove.forEach(result.removeSpan.bind(result));
1541 separator = Output.SPACE; 1545 separator = Output.SPACE;
1542 }); 1546 });
1543 return result; 1547 return result;
1544 } 1548 }
1545 }; 1549 };
1546 1550
1547 }); // goog.scope 1551 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698