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 The entry point for all ChromeVox2 related code for the | 6 * @fileoverview The entry point for all ChromeVox2 related code for the |
7 * background page. | 7 * background page. |
8 */ | 8 */ |
9 | 9 |
10 goog.provide('Background'); | 10 goog.provide('Background'); |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } | 493 } |
494 return false; | 494 return false; |
495 } | 495 } |
496 } | 496 } |
497 | 497 |
498 if (current) { | 498 if (current) { |
499 // TODO(dtseng): Figure out what it means to focus a range. | 499 // TODO(dtseng): Figure out what it means to focus a range. |
500 var actionNode = current.start.node; | 500 var actionNode = current.start.node; |
501 if (actionNode.role == RoleType.inlineTextBox) | 501 if (actionNode.role == RoleType.inlineTextBox) |
502 actionNode = actionNode.parent; | 502 actionNode = actionNode.parent; |
503 actionNode.focus(); | 503 |
| 504 // Iframes, when focused, causes the child webArea to fire focus event. |
| 505 // This can result in getting stuck when navigating backward. |
| 506 if (actionNode.role != RoleType.iframe && !actionNode.state.focused) |
| 507 actionNode.focus(); |
504 | 508 |
505 var prevRange = this.currentRange_; | 509 var prevRange = this.currentRange_; |
506 this.setCurrentRange(current); | 510 this.setCurrentRange(current); |
507 | 511 |
508 new Output().withSpeechAndBraille( | 512 new Output().withSpeechAndBraille( |
509 this.currentRange_, prevRange, Output.EventType.NAVIGATE) | 513 this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
510 .withQueueMode(cvox.QueueMode.FLUSH) | 514 .withQueueMode(cvox.QueueMode.FLUSH) |
511 .go(); | 515 .go(); |
512 } | 516 } |
513 | 517 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 694 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
691 .replace(/\*/g, '.*') | 695 .replace(/\*/g, '.*') |
692 .replace(/\?/g, '.'); | 696 .replace(/\?/g, '.'); |
693 }).join('|') + ')$'); | 697 }).join('|') + ')$'); |
694 }; | 698 }; |
695 | 699 |
696 /** @type {Background} */ | 700 /** @type {Background} */ |
697 global.backgroundObj = new Background(); | 701 global.backgroundObj = new Background(); |
698 | 702 |
699 }); // goog.scope | 703 }); // goog.scope |
OLD | NEW |