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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return; | 98 return; |
99 } | 99 } |
100 | 100 |
101 var type = treeChange.type; | 101 var type = treeChange.type; |
102 var relevant = node.containerLiveRelevant; | 102 var relevant = node.containerLiveRelevant; |
103 var additions = relevant.indexOf('additions') >= 0; | 103 var additions = relevant.indexOf('additions') >= 0; |
104 var text = relevant.indexOf('text') >= 0; | 104 var text = relevant.indexOf('text') >= 0; |
105 var removals = relevant.indexOf('removals') >= 0; | 105 var removals = relevant.indexOf('removals') >= 0; |
106 var all = relevant.indexOf('all') >= 0; | 106 var all = relevant.indexOf('all') >= 0; |
107 | 107 |
108 if (all || (additions && | 108 if (all || |
109 (type == 'nodeCreated' || type == 'subtreeCreated'))) { | 109 (additions && (type == 'nodeCreated' || type == 'subtreeCreated'))) { |
110 this.outputLiveRegionChange_(node, null); | 110 this.outputLiveRegionChange_(node, null); |
111 } | 111 } |
112 | 112 |
113 if (all || (text && type == 'textChanged')) | 113 if (all || (text && type == 'textChanged')) |
114 this.outputLiveRegionChange_(node, null); | 114 this.outputLiveRegionChange_(node, null); |
115 | 115 |
116 if (all || (removals && type == 'nodeRemoved')) | 116 if (all || (removals && type == 'nodeRemoved')) |
117 this.outputLiveRegionChange_(node, '@live_regions_removed'); | 117 this.outputLiveRegionChange_(node, '@live_regions_removed'); |
118 }, | 118 }, |
119 | 119 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 else | 182 else |
183 output.withQueueMode(cvox.QueueMode.QUEUE); | 183 output.withQueueMode(cvox.QueueMode.QUEUE); |
184 | 184 |
185 this.liveRegionNodeSet_.add(node); | 185 this.liveRegionNodeSet_.add(node); |
186 output.go(); | 186 output.go(); |
187 this.lastLiveRegionTime_ = currentTime; | 187 this.lastLiveRegionTime_ = currentTime; |
188 }, | 188 }, |
189 }; | 189 }; |
190 | 190 |
191 }); // goog.scope | 191 }); // goog.scope |
OLD | NEW |