Commit 8f254643 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Fix automation event listeners in Select-to-speak

Fixes a regression caused by http://crrev.com/c/2424854 ("Refactor
chrome.automation.EventType"), it could have manifested as
select-to-speak not updating when the page scrolls.

See http://crrev.com/c/2450663 for more context.

Bug: 1110367, 1135248
Change-Id: I12e62a18093a0fc2837ec0be312d4f7261c5dc42
AX-Relnotes: none because this just fixes a regression
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454633Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814738}
parent 74ee9cfe
......@@ -366,12 +366,22 @@ class SelectToSpeak {
// If the user wants a certain scroll position we will respect that.
this.scrollToSpokenNode_ = false;
// Now remove this event listener, we no longer need it.
// Now remove these event listeners, we no longer need them.
root.removeEventListener(
EventType.SCROLL_POSITION_CHANGED, listener, false);
root.removeEventListener(
EventType.SCROLL_HORIZONTAL_POSITION_CHANGED, listener, false);
root.removeEventListener(
EventType.SCROLL_VERTICAL_POSITION_CHANGED, listener, false);
}
};
// ARC++ fires the first event, Views/Web fire the horizontal/vertical
// scroll position changed events via AXEventGenerator.
root.addEventListener(EventType.SCROLL_POSITION_CHANGED, listener, false);
root.addEventListener(
EventType.SCROLL_HORIZONTAL_POSITION_CHANGED, listener, false);
root.addEventListener(
EventType.SCROLL_VERTICAL_POSITION_CHANGED, listener, false);
}
/**
......
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