OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 Implements support for live regions in ChromeVox Next. | 6 * @fileoverview Implements support for live regions in ChromeVox Next. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('LiveRegions'); | 9 goog.provide('LiveRegions'); |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 var range = cursors.Range.fromNode(node); | 125 var range = cursors.Range.fromNode(node); |
126 var output = new Output(); | 126 var output = new Output(); |
127 if (opt_prependFormatStr) | 127 if (opt_prependFormatStr) |
128 output.format(opt_prependFormatStr); | 128 output.format(opt_prependFormatStr); |
129 output.withSpeech(range, range, Output.EventType.NAVIGATE); | 129 output.withSpeech(range, range, Output.EventType.NAVIGATE); |
130 | 130 |
131 if (!output.hasSpeech && node.liveAtomic) | 131 if (!output.hasSpeech && node.liveAtomic) |
132 output.format('$descendants', node); | 132 output.format('$joinedDescendants', node); |
133 | 133 |
134 output.withSpeechCategory(cvox.TtsCategory.LIVE); | 134 output.withSpeechCategory(cvox.TtsCategory.LIVE); |
135 | 135 |
136 if (!output.hasSpeech) | 136 if (!output.hasSpeech) |
137 return; | 137 return; |
138 | 138 |
139 // Enqueue live region updates that were received at approximately | 139 // Enqueue live region updates that were received at approximately |
140 // the same time, otherwise flush previous live region updates. | 140 // the same time, otherwise flush previous live region updates. |
141 var currentTime = new Date(); | 141 var currentTime = new Date(); |
142 var queueTime = LiveRegions.LIVE_REGION_QUEUE_TIME_MS; | 142 var queueTime = LiveRegions.LIVE_REGION_QUEUE_TIME_MS; |
(...skipping 11 matching lines...) Expand all Loading... |
154 return; | 154 return; |
155 parent = parent.parent; | 155 parent = parent.parent; |
156 } | 156 } |
157 | 157 |
158 this.liveRegionNodeSet_.add(node); | 158 this.liveRegionNodeSet_.add(node); |
159 output.go(); | 159 output.go(); |
160 }, | 160 }, |
161 }; | 161 }; |
162 | 162 |
163 }); // goog.scope | 163 }); // goog.scope |
OLD | NEW |