| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return nextSel; | 46 return nextSel; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 | 49 |
| 50 /** | 50 /** |
| 51 * @override | 51 * @override |
| 52 */ | 52 */ |
| 53 cvox.TableShifter.prototype.sync = function(sel) { | 53 cvox.TableShifter.prototype.sync = function(sel) { |
| 54 if (sel.start.node.tagName == 'TABLE') { | 54 if (sel.start.node.tagName == 'TABLE') { |
| 55 return sel.isReversed() ? this.currentWalker_.goToLastCell(sel) : | 55 return sel.isReversed() ? this.currentWalker_.goToLastCell(sel) : |
| 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 Msgs.getMsg('table_shifter'); | 66 return Msgs.getMsg('table_shifter'); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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: 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: '', annotation: Msgs.getMsg('spanned')})); |
| 98 annotation: Msgs.getMsg('spanned') | |
| 99 })); | |
| 100 } | 98 } |
| 101 this.begin_ = false; | 99 this.begin_ = false; |
| 102 } | 100 } |
| 103 } | 101 } |
| 104 return descs; | 102 return descs; |
| 105 }; | 103 }; |
| 106 | 104 |
| 107 | 105 |
| 108 /** | 106 /** |
| 109 * @override | 107 * @override |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 * @override | 141 * @override |
| 144 */ | 142 */ |
| 145 cvox.TableShifter.create = function(sel) { | 143 cvox.TableShifter.create = function(sel) { |
| 146 var ancestors = cvox.DomUtil.getAncestors(sel.start.node); | 144 var ancestors = cvox.DomUtil.getAncestors(sel.start.node); |
| 147 if (cvox.DomPredicates.tablePredicate(ancestors) && | 145 if (cvox.DomPredicates.tablePredicate(ancestors) && |
| 148 !cvox.DomPredicates.captionPredicate(ancestors)) { | 146 !cvox.DomPredicates.captionPredicate(ancestors)) { |
| 149 return new cvox.TableShifter(); | 147 return new cvox.TableShifter(); |
| 150 } | 148 } |
| 151 return null; | 149 return null; |
| 152 }; | 150 }; |
| OLD | NEW |