| 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 consisting of one or more | 6 * @fileoverview A JavaScript class for walking lines consisting of one or more |
| 7 * clickable nodes. | 7 * clickable nodes. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 rRect = rSel.start.node.getBoundingClientRect(); | 165 rRect = rSel.start.node.getBoundingClientRect(); |
| 166 } | 166 } |
| 167 return lRect.bottom != rRect.bottom; | 167 return lRect.bottom != rRect.bottom; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 | 170 |
| 171 /** | 171 /** |
| 172 * Determines if node should force a line break. | 172 * Determines if node should force a line break. |
| 173 * This is used for elements with unusual semantics, such as multi-line | 173 * This is used for elements with unusual semantics, such as multi-line |
| 174 * text fields, where the behaviour would otherwise be confusing. | 174 * text fields, where the behaviour would otherwise be confusing. |
| 175 * @param {!Node} node Node. | 175 * @param {Node} node Node. |
| 176 * @return {boolean} True if the node should appear next to a line break. | 176 * @return {boolean} True if the node should appear next to a line break. |
| 177 * @private | 177 * @private |
| 178 */ | 178 */ |
| 179 cvox.LayoutLineWalker.prototype.wantsOwnLine_ = function(node) { | 179 cvox.LayoutLineWalker.prototype.wantsOwnLine_ = function(node) { |
| 180 if (!node) { |
| 181 return false; |
| 182 } |
| 180 return node instanceof HTMLTextAreaElement || | 183 return node instanceof HTMLTextAreaElement || |
| 181 node.parentNode instanceof HTMLTextAreaElement; | 184 node.parentNode instanceof HTMLTextAreaElement; |
| 182 }; | 185 }; |
| 183 | 186 |
| 184 | 187 |
| 185 /** | 188 /** |
| 186 * Extends a given cursor selection up to the next visual line break. | 189 * Extends a given cursor selection up to the next visual line break. |
| 187 * @param {!cvox.CursorSelection} start The selection. | 190 * @param {!cvox.CursorSelection} start The selection. |
| 188 * @return {!cvox.CursorSelection} The resulting selection. | 191 * @return {!cvox.CursorSelection} The resulting selection. |
| 189 * @private | 192 * @private |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (sel && cur.absEquals(sel)) { | 239 if (sel && cur.absEquals(sel)) { |
| 237 if (valueSelectionSpan) { | 240 if (valueSelectionSpan) { |
| 238 braille.startIndex = nodeStart + item.getSpanStart(valueSelectionSpan); | 241 braille.startIndex = nodeStart + item.getSpanStart(valueSelectionSpan); |
| 239 braille.endIndex = nodeStart + item.getSpanEnd(valueSelectionSpan); | 242 braille.endIndex = nodeStart + item.getSpanEnd(valueSelectionSpan); |
| 240 } else { | 243 } else { |
| 241 braille.startIndex = nodeStart; | 244 braille.startIndex = nodeStart; |
| 242 braille.endIndex = nodeStart + 1; | 245 braille.endIndex = nodeStart + 1; |
| 243 } | 246 } |
| 244 } | 247 } |
| 245 }; | 248 }; |
| OLD | NEW |