Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js |
| index e3c8e7f454e4cd8ec81ebc51eb829339ac6f8ea5..f8583a86e272df25c665044605507a97b94eb109 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js |
| @@ -75,6 +75,27 @@ var Unit = cursors.Unit; |
| * is pointed to and covers the case where the accessible text is empty. |
| */ |
| cursors.Cursor = function(node, index) { |
| + // Compensate for specific issues in Blink. |
| + if (node.role == RoleType.STATIC_TEXT && node.name.length == index) { |
| + // Re-interpret this case as the beginning of the next node. |
| + var nextNode = AutomationUtil.findNextNode( |
| + node, Dir.FORWARD, AutomationPredicate.leafOrStaticText); |
| + |
| + // The exception is when a user types at the end of a line. In that case, |
| + // staying on the current node is appropriate. |
| + if (nextNode && nextNode.nextOnLine) { |
| + node = nextNode; |
| + index = 0; |
| + } |
| + } else if (node.role == RoleType. |
| + DIV && node.state.richlyEditable && |
|
dmazzoni
2017/05/25 21:00:37
nit: very weird wrapping of DIV
Also, there's pro
David Tseng
2017/05/25 21:39:20
Done.
|
| + (node.firstChild && |
| + (node.firstChild.role == RoleType.LINE_BREAK || |
| + node.firstChild.role == RoleType.STATIC_TEXT))) { |
| + // Re-interpret this case as pointing to the text under the div. |
| + node = node.find({ role: RoleType.INLINE_TEXT_BOX }) || node; |
| + } |
| + |
| /** @type {number} @private */ |
| this.index_ = index; |
| /** @type {Array<AutomationNode>} @private */ |