Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 1589623002: Keep track of accessibility focus across windows. (Closed)

Created:
4 years, 11 months ago by dmazzoni
Modified:
4 years, 10 months ago
Reviewers:
David Tseng, jam, dcheng
CC:
aboxhall+watch_chromium.org, aboxhall, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, eae+blinkwatch, extensions-reviews_chromium.org, je_julie, kalyank, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nektar+watch_chromium.org, nektarios, plundblad+watch_chromium.org, rwlbuis, sadrul, sof, tfarina, yuzo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Keep track of accessibility focus across windows. Previously we never kept track of accessibility focus; when a web element or view got focus we'd fire an accessibility focus event and leave it up to the client to keep track. This worked fine when focus is only changing within a single window. However, this led to lots of subtle bugs and race conditions across windows, for example: 1. If a View in a non-activatable window tried to get focus, we'd fire a focus event even though the View didn't actually get keyboard focus. 2. If the active element in a non-focused frame changed, we'd fire a focus event even though that frame's window did not have focus. 3. Tabbing into or out of a cross-process iframe or <webview> element could fire a focus event on both the outer and inner frame, another race condition. To solve this, we this change makes the following changes: 1. Within a single accessibility tree, the focused node is now part of the tree data, rather than a state flag on a node. That guarantees only one node within a tree can be focused at once. This affects both the web accessibility tree and the views accessibility tree. 2. Whenever we get an accessibility focus event, we start at the root and figure out what node has focus, globally. Then we only fire the accessibility focus event on that new node if focus has changed. As an example, suppose we open a Chrome app that embeds a <webview> that loads the google.com homepage, which focuses the input element. Initially the app window itself does not have focus, so we don't fire any focus events. Later the app window gets activated. We now follow the focus chain to the <webview> element and to the focused input element, and fire a focus event on the input element directly. BUG=581910 Committed: https://crrev.com/965ba000de4c91156005af7e23235574f8c2cc93 Cr-Commit-Position: refs/heads/master@{#376339}

Patch Set 1 #

Patch Set 2 : Ready for review #

Patch Set 3 : git cl format #

Total comments: 23

Patch Set 4 : Fix accessibility unittests #

Patch Set 5 : Fix chromeos-only test #

Patch Set 6 : Fix some Blink tests #

Patch Set 7 : Try to fix Win and Mac compile #

Patch Set 8 : Fix Android compile #

Patch Set 9 : Address most feedback #

Patch Set 10 : More compile fixes #

Patch Set 11 : Fix Win & Mac compile again #

Patch Set 12 : Rebase, fix GetActiveDescendant loop affecting content_browsertests #

Patch Set 13 : Compiles and passes content tests on Windows #

Patch Set 14 : All automation browser_tests should pass now #

Patch Set 15 : Fix more tests #

Patch Set 16 : Fixed WebViewTest too, ready for another look #

Total comments: 2

Patch Set 17 : Rebase #

Patch Set 18 : Update Mac expectations #

Total comments: 4

Patch Set 19 : Make getFocus async #

Patch Set 20 : Fixed anonymous function bindings in calls to getFocus #

Patch Set 21 : Final suggestions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+628 lines, -337 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/automation/automation_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +25 lines, -0 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/common/chrome_extension_externs.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +21 lines, -0 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/base_automation_handler.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/aura/accessibility/automation_manager_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/aura/accessibility/ax_tree_source_aura.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/automation.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/common/extensions/chrome_extension_messages.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/automation_internal_custom_bindings.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +8 lines, -40 lines 0 comments Download
M chrome/renderer/extensions/automation_internal_custom_bindings.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +108 lines, -16 lines 0 comments Download
M chrome/renderer/resources/extensions/automation_custom_bindings.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +53 lines, -6 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/sites/desktop.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/desktop/actions.js View 1 1 chunk +0 lines, -12 lines 0 comments Download
A + chrome/test/data/extensions/api_test/automation/tests/desktop/focus_views.html View 1 1 chunk +2 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/tests/desktop/focus_views.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +20 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/automation/tests/desktop/focus_web.html View 1 4 1 chunk +2 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/tests/desktop/focus_web.js View 1 2 3 4 5 6 7 8 1 chunk +54 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/automation/tests/desktop/initial_focus.html View 1 1 chunk +2 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/tests/desktop/initial_focus.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +25 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M components/test_runner/accessibility_controller.h View 1 2 3 4 5 2 chunks +0 lines, -4 lines 0 comments Download
M components/test_runner/accessibility_controller.cc View 1 2 3 4 5 4 chunks +15 lines, -17 lines 0 comments Download
M components/test_runner/web_test_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/accessibility/accessibility_ipc_error_browsertest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/accessibility/browser_accessibility_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/browser/accessibility/browser_accessibility_auralinux.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_cocoa.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +5 lines, -3 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +11 lines, -14 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +29 lines, -57 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +4 lines, -4 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager_mac.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/accessibility/browser_accessibility_manager_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +5 lines, -7 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +12 lines, -30 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_manager_win.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/browser/accessibility/browser_accessibility_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +3 lines, -7 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +13 lines, -18 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/common/accessibility_messages.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/accessibility/blink_ax_enum_conversion.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -3 lines 0 comments Download
M content/renderer/accessibility/blink_ax_tree_source.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M content/test/data/accessibility/event/listbox-focus-expected-mac.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M content/test/data/accessibility/event/listbox-next-expected-mac.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M content/test/data/accessibility/event/menulist-next-expected-win.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/accessibility/listbox-enabled-states.html View 1 2 3 4 5 1 chunk +7 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/accessibility/listbox-enabled-states-expected.txt View 1 2 3 4 5 1 chunk +6 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/accessibility/selection-states.html View 1 2 3 4 5 1 chunk +8 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/accessibility/selection-states-expected.txt View 1 2 3 4 5 1 chunk +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/AXObjectCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +22 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/WebDocument.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/resources/calendarPicker.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/web/WebDocument.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M ui/accessibility/ax_enums.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -1 line 0 comments Download
M ui/accessibility/ax_node_data.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M ui/accessibility/ax_tree_data.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/accessibility/ax_tree_data.cc View 1 3 chunks +5 lines, -0 lines 0 comments Download
M ui/accessibility/ax_tree_unittest.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M ui/accessibility/platform/ax_platform_node_auralinux.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M ui/accessibility/platform/ax_platform_node_win.cc View 1 2 3 4 5 6 2 chunks +9 lines, -2 lines 0 comments Download
M ui/app_list/views/search_result_actions_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/accessibility/ax_aura_obj_cache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +18 lines, -2 lines 0 comments Download
M ui/views/accessibility/ax_aura_obj_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +54 lines, -1 line 0 comments Download
M ui/views/accessibility/ax_view_obj_wrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -2 lines 0 comments Download
M ui/views/accessibility/native_view_accessibility.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M ui/views/controls/menu/menu_scroll_view_container.cc View 1 chunk +0 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 24 (8 generated)
dmazzoni
Ready for an initial look!
4 years, 11 months ago (2016-01-28 00:34:41 UTC) #4
David Tseng
https://codereview.chromium.org/1589623002/diff/40001/chrome/browser/extensions/api/automation/automation_apitest.cc File chrome/browser/extensions/api/automation/automation_apitest.cc (right): https://codereview.chromium.org/1589623002/diff/40001/chrome/browser/extensions/api/automation/automation_apitest.cc#newcode168 chrome/browser/extensions/api/automation/automation_apitest.cc:168: IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusWeb) { Should this work on all platforms? ...
4 years, 11 months ago (2016-01-28 02:00:56 UTC) #5
dmazzoni
https://codereview.chromium.org/1589623002/diff/40001/chrome/browser/extensions/api/automation/automation_apitest.cc File chrome/browser/extensions/api/automation/automation_apitest.cc (right): https://codereview.chromium.org/1589623002/diff/40001/chrome/browser/extensions/api/automation/automation_apitest.cc#newcode168 chrome/browser/extensions/api/automation/automation_apitest.cc:168: IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusWeb) { On 2016/01/28 02:00:56, David Tseng wrote: ...
4 years, 10 months ago (2016-01-30 00:02:41 UTC) #6
David Tseng
lgtm
4 years, 10 months ago (2016-01-30 00:19:19 UTC) #7
dmazzoni
+jam for: chrome/browser/apps/guest_view/web_view_browsertest.cc chrome/browser/extensions/api/automation/automation_apitest.cc content/browser/renderer_host/render_widget_host_view_mac.mm +dcheng for: chrome/common/extensions/chrome_extension_messages.h content/common/accessibility_messages.h third_party/WebKit/Source/core/dom/AXObjectCache.h third_party/WebKit/Source/web/WebDocument.cpp third_party/WebKit/Source/web/resources/calendarPicker.js third_party/WebKit/public/web/WebDocument.h Ready for ...
4 years, 10 months ago (2016-02-12 23:12:34 UTC) #9
jam
lgtm
4 years, 10 months ago (2016-02-12 23:33:18 UTC) #10
dcheng
https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp File third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp (right): https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp#newcode161 third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp:161: if (!page->focusController().focusedOrMainFrame()->isLocalFrame()) Why focusedOrMainFrame()? Is it because we have ...
4 years, 10 months ago (2016-02-13 02:29:31 UTC) #11
dmazzoni
https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp File third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp (right): https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp#newcode161 third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp:161: if (!page->focusController().focusedOrMainFrame()->isLocalFrame()) On 2016/02/13 02:29:31, dcheng wrote: > Why ...
4 years, 10 months ago (2016-02-16 18:54:54 UTC) #12
David Tseng
lgtm https://codereview.chromium.org/1589623002/diff/340001/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js File chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js (right): https://codereview.chromium.org/1589623002/diff/340001/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js#newcode52 chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js:52: No need for the load complete logic above ...
4 years, 10 months ago (2016-02-17 23:55:56 UTC) #13
dcheng
On 2016/02/16 at 18:54:54, dmazzoni wrote: > https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp > File third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp (right): > > https://codereview.chromium.org/1589623002/diff/300001/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp#newcode161 ...
4 years, 10 months ago (2016-02-18 19:36:20 UTC) #14
dmazzoni
> > On 2016/02/13 02:29:31, dcheng wrote: > Two questions before I l-g-t-m: > 1) ...
4 years, 10 months ago (2016-02-18 19:53:37 UTC) #15
dcheng
lgtm
4 years, 10 months ago (2016-02-18 19:54:57 UTC) #16
dmazzoni
https://codereview.chromium.org/1589623002/diff/340001/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js File chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js (right): https://codereview.chromium.org/1589623002/diff/340001/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js#newcode52 chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js:52: On 2016/02/17 23:55:56, David Tseng wrote: > No need ...
4 years, 10 months ago (2016-02-18 23:56:37 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1589623002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1589623002/400001
4 years, 10 months ago (2016-02-19 00:07:32 UTC) #20
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years, 10 months ago (2016-02-19 01:43:35 UTC) #22
commit-bot: I haz the power
4 years, 10 months ago (2016-02-19 01:44:36 UTC) #24
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/965ba000de4c91156005af7e23235574f8c2cc93
Cr-Commit-Position: refs/heads/master@{#376339}

Powered by Google App Engine
This is Rietveld 408576698