OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 Handles automation from a desktop automation node. | 6 * @fileoverview Handles automation from a desktop automation node. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('DesktopAutomationHandler'); | 9 goog.provide('DesktopAutomationHandler'); |
10 | 10 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 this.onEditableChanged_(evt); | 389 this.onEditableChanged_(evt); |
390 }, | 390 }, |
391 | 391 |
392 /** | 392 /** |
393 * Provides all feedback once a change event in a text field fires. | 393 * Provides all feedback once a change event in a text field fires. |
394 * @param {!AutomationEvent} evt | 394 * @param {!AutomationEvent} evt |
395 * @private | 395 * @private |
396 */ | 396 */ |
397 onEditableChanged_: function(evt) { | 397 onEditableChanged_: function(evt) { |
398 var topRoot = AutomationUtil.getTopLevelRoot(evt.target); | 398 var topRoot = AutomationUtil.getTopLevelRoot(evt.target); |
399 if (!evt.target.state.focused || | 399 if (topRoot && topRoot.parent && !topRoot.parent.state.focused) |
400 (topRoot && | 400 return; |
401 topRoot.parent && | 401 |
402 !topRoot.parent.state.focused)) | 402 // Only process editable text events if either system or ChromeVox focus is |
dmazzoni
2017/03/17 03:22:37
I think this might break contenteditable if the se
David Tseng
2017/03/17 15:38:32
Yeah, I think you're right. The issue is that on A
| |
403 // on the target. | |
404 if (!evt.target.state.focused && | |
405 (!ChromeVoxState.instance.currentRange || | |
406 ChromeVoxState.instance.currentRange.start.node != evt.target)) | |
403 return; | 407 return; |
404 | 408 |
405 if (!ChromeVoxState.instance.currentRange) { | 409 if (!ChromeVoxState.instance.currentRange) { |
406 this.onEventDefault(evt); | 410 this.onEventDefault(evt); |
407 ChromeVoxState.instance.setCurrentRange( | 411 ChromeVoxState.instance.setCurrentRange( |
408 cursors.Range.fromNode(evt.target)); | 412 cursors.Range.fromNode(evt.target)); |
409 } | 413 } |
410 | 414 |
411 this.createTextEditHandlerIfNeeded_(evt.target); | 415 this.createTextEditHandlerIfNeeded_(evt.target); |
412 | 416 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
562 DesktopAutomationHandler.init_ = function() { | 566 DesktopAutomationHandler.init_ = function() { |
563 chrome.automation.getDesktop(function(desktop) { | 567 chrome.automation.getDesktop(function(desktop) { |
564 ChromeVoxState.desktopAutomationHandler = | 568 ChromeVoxState.desktopAutomationHandler = |
565 new DesktopAutomationHandler(desktop); | 569 new DesktopAutomationHandler(desktop); |
566 }); | 570 }); |
567 }; | 571 }; |
568 | 572 |
569 DesktopAutomationHandler.init_(); | 573 DesktopAutomationHandler.init_(); |
570 | 574 |
571 }); // goog.scope | 575 }); // goog.scope |
OLD | NEW |