OLD | NEW |
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 Walkers to traverse a table. | 6 * @fileoverview Walkers to traverse a table. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 goog.provide('cvox.TableShifter'); | 10 goog.provide('cvox.TableShifter'); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 this.currentWalker_.goToFirstCell(sel); | 56 this.currentWalker_.goToFirstCell(sel); |
57 } | 57 } |
58 return this.currentWalker_.sync(sel); | 58 return this.currentWalker_.sync(sel); |
59 }; | 59 }; |
60 | 60 |
61 | 61 |
62 /** | 62 /** |
63 * @override | 63 * @override |
64 */ | 64 */ |
65 cvox.TableShifter.prototype.getName = function() { | 65 cvox.TableShifter.prototype.getName = function() { |
66 return cvox.ChromeVox.msgs.getMsg('table_shifter'); | 66 return Msgs.getMsg('table_shifter'); |
67 }; | 67 }; |
68 | 68 |
69 | 69 |
70 /** | 70 /** |
71 * @override | 71 * @override |
72 * @suppress {checkTypes} actual parameter 2 of | 72 * @suppress {checkTypes} actual parameter 2 of |
73 * cvox.Msgs.prototype.getMsg does not match formal parameter | 73 * Msgs.prototype.getMsg does not match formal parameter |
74 * found : Array<number> | 74 * found : Array<number> |
75 * required: (Array<string>|null|undefined) | 75 * required: (Array<string>|null|undefined) |
76 */ | 76 */ |
77 cvox.TableShifter.prototype.getDescription = function(prevSel, sel) { | 77 cvox.TableShifter.prototype.getDescription = function(prevSel, sel) { |
78 var descs = this.currentWalker_.getDescription(prevSel, sel); | 78 var descs = this.currentWalker_.getDescription(prevSel, sel); |
79 if (descs.length > 0) { | 79 if (descs.length > 0) { |
80 if (this.bumpedEdge_) { | 80 if (this.bumpedEdge_) { |
81 descs[0].pushEarcon(cvox.Earcon.WRAP_EDGE); | 81 descs[0].pushEarcon(cvox.Earcon.WRAP_EDGE); |
82 this.bumpedEdge_ = false; | 82 this.bumpedEdge_ = false; |
83 } | 83 } |
84 if (this.begin_) { | 84 if (this.begin_) { |
85 var len = descs.length; | 85 var len = descs.length; |
86 var summaryText = this.currentWalker_.tt.summaryText(); | 86 var summaryText = this.currentWalker_.tt.summaryText(); |
87 var locationInfo = this.currentWalker_.getLocationInfo(sel); | 87 var locationInfo = this.currentWalker_.getLocationInfo(sel); |
88 if (locationInfo != null) { | 88 if (locationInfo != null) { |
89 descs.push(new cvox.NavDescription({ | 89 descs.push(new cvox.NavDescription({ |
90 context: cvox.ChromeVox.msgs.getMsg('table_location', locationInfo), | 90 context: Msgs.getMsg('table_location', locationInfo), |
91 text: '', | 91 text: '', |
92 annotation: summaryText ? summaryText + ' ' : '' | 92 annotation: summaryText ? summaryText + ' ' : '' |
93 })); | 93 })); |
94 } | 94 } |
95 if (this.currentWalker_.tt.isSpanned()) { | 95 if (this.currentWalker_.tt.isSpanned()) { |
96 descs.push(new cvox.NavDescription({ | 96 descs.push(new cvox.NavDescription({ |
97 text: '', | 97 text: '', |
98 annotation: cvox.ChromeVox.msgs.getMsg('spanned') | 98 annotation: Msgs.getMsg('spanned') |
99 })); | 99 })); |
100 } | 100 } |
101 this.begin_ = false; | 101 this.begin_ = false; |
102 } | 102 } |
103 } | 103 } |
104 return descs; | 104 return descs; |
105 }; | 105 }; |
106 | 106 |
107 | 107 |
108 /** | 108 /** |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 * @override | 143 * @override |
144 */ | 144 */ |
145 cvox.TableShifter.create = function(sel) { | 145 cvox.TableShifter.create = function(sel) { |
146 var ancestors = cvox.DomUtil.getAncestors(sel.start.node); | 146 var ancestors = cvox.DomUtil.getAncestors(sel.start.node); |
147 if (cvox.DomPredicates.tablePredicate(ancestors) && | 147 if (cvox.DomPredicates.tablePredicate(ancestors) && |
148 !cvox.DomPredicates.captionPredicate(ancestors)) { | 148 !cvox.DomPredicates.captionPredicate(ancestors)) { |
149 return new cvox.TableShifter(); | 149 return new cvox.TableShifter(); |
150 } | 150 } |
151 return null; | 151 return null; |
152 }; | 152 }; |
OLD | NEW |