Fire focus and blur events before all others in automation
ChromeVox recently began to "stutter" or duplicate output. This occurs most frequently when navigating by headings. The underlying issue. ChromeVox requests focus whenever it navigates. This, in turn, triggers actions in Blink. This correctly emits a focus event, along with the correct event from action annotation. Once it finally arrives in automation, we dispatch the event in js. In js, we suppress focus events in favor of tracking the focus computation given by AutomationInternalCustomBindings. Unfortunately, if, within the same event bundle, there is an event immediately before the focus event (either generated or not), the event triggers a synthesized focus event, before the actual focus event. In the end, the incorrect event from value is associated with the synthesized focus event. This has enormous impact on users as we unpredictably flood users with duplicate feedback. This seems worse on some devices (depending on the event bundle's contents and ordering). Technical details. What's happening: we receive events (in order) like: 1. layout complete (event from page) 2. blur (event from action) 3. focus (event from action) in the same event bundle. Before any of these get fired, we unserialize all of the tree data, so the focused node is already updated as far as the tree data is concerned. After this, we proceed to fire events. The first one, is the layout complete. This translates into a *focus* event js-side, along with event from page, because that's what the layout complete event had set. If we honored the actual focus event first, then we would pick up on the right event from action value. Bug: 881495 Change-Id: I73b1afc3f1b224ade0cef29a89e00c179438a575 Reviewed-on: https://chromium-review.googlesource.com/1211106Reviewed-by:Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: David Tseng <dtseng@chromium.org> Cr-Commit-Position: refs/heads/master@{#589987}
Showing
Please register or sign in to comment