Commit ac87317c authored by David Tseng's avatar David Tseng Committed by Commit Bot

Move initialization of text edit handler

Correct sequence on focus:
- focus changes
- range updates
- create text edit handler if needed

The last check (to create text edit handler) depends on the ChromeVox range
having previously been updated.

character doesn't get read prior to patch and does get read post patch.

Test: manually tab to the question text field in Classroom. Verify that initial
Bug: 785283
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id0a4bd8ad17fc2895b802961e739db8e415b9026
Reviewed-on: https://chromium-review.googlesource.com/777900
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517903}
parent b664d9d7
...@@ -302,8 +302,6 @@ DesktopAutomationHandler.prototype = { ...@@ -302,8 +302,6 @@ DesktopAutomationHandler.prototype = {
if (node.role == RoleType.EMBEDDED_OBJECT || node.role == RoleType.WEB_VIEW) if (node.role == RoleType.EMBEDDED_OBJECT || node.role == RoleType.WEB_VIEW)
return; return;
this.createTextEditHandlerIfNeeded_(evt.target);
// Category flush speech triggered by events with no source. This includes // Category flush speech triggered by events with no source. This includes
// views. // views.
if (evt.eventFrom == '') if (evt.eventFrom == '')
...@@ -329,6 +327,9 @@ DesktopAutomationHandler.prototype = { ...@@ -329,6 +327,9 @@ DesktopAutomationHandler.prototype = {
} }
var event = new CustomAutomationEvent(EventType.FOCUS, node, evt.eventFrom); var event = new CustomAutomationEvent(EventType.FOCUS, node, evt.eventFrom);
this.onEventDefault(event); this.onEventDefault(event);
// Refresh the handler, if needed, now that ChromeVox focus is up to date.
this.createTextEditHandlerIfNeeded_(node);
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment