| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 var type = treeChange.type; | 92 var type = treeChange.type; |
| 93 var relevant = node.containerLiveRelevant; | 93 var relevant = node.containerLiveRelevant; |
| 94 if (relevant.indexOf('additions') >= 0 && | 94 if (relevant.indexOf('additions') >= 0 && |
| 95 (type == 'nodeCreated' || type == 'subtreeCreated')) { | 95 (type == 'nodeCreated' || type == 'subtreeCreated')) { |
| 96 this.outputLiveRegionChange_(node, null); | 96 this.outputLiveRegionChange_(node, null); |
| 97 } | 97 } |
| 98 | 98 |
| 99 if (relevant.indexOf('text') >= 0 && type == 'nodeChanged') | 99 if (relevant.indexOf('text') >= 0 && type == 'textChanged') |
| 100 this.outputLiveRegionChange_(node, null); | 100 this.outputLiveRegionChange_(node, null); |
| 101 | 101 |
| 102 if (relevant.indexOf('removals') >= 0 && type == 'nodeRemoved') | 102 if (relevant.indexOf('removals') >= 0 && type == 'nodeRemoved') |
| 103 this.outputLiveRegionChange_(node, '@live_regions_removed'); | 103 this.outputLiveRegionChange_(node, '@live_regions_removed'); |
| 104 }, | 104 }, |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * Given a node that needs to be spoken as part of a live region | 107 * Given a node that needs to be spoken as part of a live region |
| 108 * change and an additional optional format string, output the | 108 * change and an additional optional format string, output the |
| 109 * live region description. | 109 * live region description. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |