Commit 433f8e20 authored by dtseng's avatar dtseng Committed by Commit bot

Use children changed events to monitor active descendant changes.

While the backing Blink implementation gets further fleshed out, loosen ChromeVox's output of active descendants by reading it on children change events.

The change makes it so that active descendants are read out when:
- the focused node (node with state focused), has an active descendant
- the incoming event is either children changed or active descendant changed

TEST=drive.google.com; tab to one of the popup buttons; up/down arrow reads options.

Review-Url: https://codereview.chromium.org/2273133002
Cr-Commit-Position: refs/heads/master@{#414242}
parent 420512c4
......@@ -47,6 +47,7 @@ DesktopAutomationHandler = function(node) {
this.addListener_(e.alert, this.onAlert);
this.addListener_(e.ariaAttributeChanged, this.onEventIfInRange);
this.addListener_(e.checkedStateChanged, this.onCheckedStateChanged);
this.addListener_(e.childrenChanged, this.onActiveDescendantChanged);
this.addListener_(e.focus, this.onFocus);
this.addListener_(e.hover, this.onHover);
this.addListener_(e.loadComplete, this.onLoadComplete);
......@@ -178,7 +179,7 @@ DesktopAutomationHandler.prototype = {
* @param {!AutomationEvent} evt
*/
onActiveDescendantChanged: function(evt) {
if (!evt.target.activeDescendant)
if (!evt.target.activeDescendant || !evt.target.state.focused)
return;
this.onEventDefault(new chrome.automation.AutomationEvent(
EventType.focus, evt.target.activeDescendant));
......
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