| 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 * TODO(stoarca): This class has become obsolete except for the shadow table. | 6 * TODO(stoarca): This class has become obsolete except for the shadow table. |
| 7 * Chop most of it away. | 7 * Chop most of it away. |
| 8 * @fileoverview A DOM traversal interface for navigating data in tables. | 8 * @fileoverview A DOM traversal interface for navigating data in tables. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Whether or not this cell is spanned by a colspan | 55 * Whether or not this cell is spanned by a colspan |
| 56 * @type {?boolean} | 56 * @type {?boolean} |
| 57 */ | 57 */ |
| 58 ShadowTableNode.prototype.colSpan; | 58 ShadowTableNode.prototype.colSpan; |
| 59 | 59 |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * The row index of the corresponding active table cell | 62 * The row index of the corresponding active table cell |
| 63 * @type {?number} | 63 * @type {number} |
| 64 */ | 64 */ |
| 65 ShadowTableNode.prototype.i; | 65 ShadowTableNode.prototype.i = -1; |
| 66 | 66 |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * The column index of the corresponding active table cell | 69 * The column index of the corresponding active table cell |
| 70 * @type {?number} | 70 * @type {number} |
| 71 */ | 71 */ |
| 72 ShadowTableNode.prototype.j; | 72 ShadowTableNode.prototype.j = -1; |
| 73 | 73 |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * The corresponding <TD> or <TH> node in the active table. | 76 * The corresponding <TD> or <TH> node in the active table. |
| 77 * @type {?Node} | 77 * @type {?Node} |
| 78 */ | 78 */ |
| 79 ShadowTableNode.prototype.activeCell; | 79 ShadowTableNode.prototype.activeCell; |
| 80 | 80 |
| 81 | 81 |
| 82 /** | 82 /** |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (this.getCell() == null) { | 254 if (this.getCell() == null) { |
| 255 this.attachCursorToNearestCell_(); | 255 this.attachCursorToNearestCell_(); |
| 256 } | 256 } |
| 257 }, this), false); | 257 }, this), false); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 | 260 |
| 261 /** | 261 /** |
| 262 * Finds the cell cursor containing the specified node within the table. | 262 * Finds the cell cursor containing the specified node within the table. |
| 263 * Returns null if there is no close cell. | 263 * Returns null if there is no close cell. |
| 264 * @param {!Node} node The node for which to find the cursor. | 264 * @param {Node} node The node for which to find the cursor. |
| 265 * @return {Array<number>} The table index for the node. | 265 * @return {Array<number>} The table index for the node. |
| 266 */ | 266 */ |
| 267 cvox.TraverseTable.prototype.findNearestCursor = function(node) { | 267 cvox.TraverseTable.prototype.findNearestCursor = function(node) { |
| 268 if (!node) { |
| 269 return null; |
| 270 } |
| 268 // TODO (stoarca): The current structure for representing the | 271 // TODO (stoarca): The current structure for representing the |
| 269 // shadow table is not optimal for this query, but it's not urgent | 272 // shadow table is not optimal for this query, but it's not urgent |
| 270 // since this only gets executed at most once per user action. | 273 // since this only gets executed at most once per user action. |
| 271 | 274 |
| 272 // In case node is in a table but above any individual cell, we go down as | 275 // In case node is in a table but above any individual cell, we go down as |
| 273 // deep as we can, being careful to avoid going into nested tables. | 276 // deep as we can, being careful to avoid going into nested tables. |
| 274 var n = node; | 277 var n = node; |
| 275 | 278 |
| 276 while (n.firstElementChild && | 279 while (n.firstElementChild && |
| 277 !(n.firstElementChild.tagName == 'TABLE' || | 280 !(n.firstElementChild.tagName == 'TABLE' || |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 }; | 1303 }; |
| 1301 | 1304 |
| 1302 | 1305 |
| 1303 /** | 1306 /** |
| 1304 * Resets the table cursors. | 1307 * Resets the table cursors. |
| 1305 * | 1308 * |
| 1306 */ | 1309 */ |
| 1307 cvox.TraverseTable.prototype.resetCursor = function() { | 1310 cvox.TraverseTable.prototype.resetCursor = function() { |
| 1308 this.currentCellCursor = null; | 1311 this.currentCellCursor = null; |
| 1309 }; | 1312 }; |
| OLD | NEW |