| 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 A JavaScript class for walking lines. | 6 * @fileoverview A JavaScript class for walking lines. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 goog.provide('cvox.StructuralLineWalker'); | 10 goog.provide('cvox.StructuralLineWalker'); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 cvox.StructuralLineWalker.prototype.getGranularityMsg = function() { | 30 cvox.StructuralLineWalker.prototype.getGranularityMsg = function() { |
| 31 return Msgs.getMsg('structural_line'); | 31 return Msgs.getMsg('structural_line'); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @override | 36 * @override |
| 37 */ | 37 */ |
| 38 cvox.StructuralLineWalker.prototype.getDescription = function(prevSel, sel) { | 38 cvox.StructuralLineWalker.prototype.getDescription = function(prevSel, sel) { |
| 39 var desc = goog.base(this, 'getDescription', prevSel, sel); | 39 var desc = goog.base(this, 'getDescription', prevSel, sel); |
| 40 desc[0].text = cvox.DomUtil.getPrefixText( | 40 desc[0].text = |
| 41 sel.absStart().node, sel.absStart().index) + desc[0].text; | 41 cvox.DomUtil.getPrefixText(sel.absStart().node, sel.absStart().index) + |
| 42 desc[0].text; |
| 42 return desc; | 43 return desc; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 | 46 |
| 46 /** | 47 /** |
| 47 * @override | 48 * @override |
| 48 */ | 49 */ |
| 49 cvox.StructuralLineWalker.prototype.getBraille = function(prevSel, sel) { | 50 cvox.StructuralLineWalker.prototype.getBraille = function(prevSel, sel) { |
| 50 var braille = goog.base(this, 'getBraille', prevSel, sel); | 51 var braille = goog.base(this, 'getBraille', prevSel, sel); |
| 51 | 52 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 var spannable = | 70 var spannable = |
| 70 cvox.BrailleUtil.getTemplated(prevNode, objNode, {name: name}); | 71 cvox.BrailleUtil.getTemplated(prevNode, objNode, {name: name}); |
| 71 spannable.setSpan(objNode, 0, spannable.length); | 72 spannable.setSpan(objNode, 0, spannable.length); |
| 72 braille.text = spannable; | 73 braille.text = spannable; |
| 73 | 74 |
| 74 // Remove any selections. | 75 // Remove any selections. |
| 75 braille.startIndex = 0; | 76 braille.startIndex = 0; |
| 76 braille.endIndex = 0; | 77 braille.endIndex = 0; |
| 77 return braille; | 78 return braille; |
| 78 }; | 79 }; |
| OLD | NEW |