tree: cb8147401ca17cb4e2fbaf35e476a28b8e43fa2c [path history] [tgz]
  1. accessibility_action_browsertest.cc
  2. accessibility_auralinux_browsertest.cc
  3. accessibility_browsertest.cc
  4. accessibility_browsertest.h
  5. accessibility_content_browsertest.cc
  6. accessibility_content_browsertest.h
  7. accessibility_ipc_error_browsertest.cc
  8. accessibility_metrics_browsertest.cc
  9. accessibility_mode_browsertest.cc
  10. accessibility_tree_formatter_android.cc
  11. accessibility_tree_formatter_android.h
  12. accessibility_tree_formatter_android_external.cc
  13. accessibility_tree_formatter_android_external.h
  14. accessibility_tree_formatter_blink.cc
  15. accessibility_tree_formatter_blink.h
  16. accessibility_tree_formatter_fuchsia.cc
  17. accessibility_tree_formatter_fuchsia.h
  18. accessibility_tree_snapshot_combiner.cc
  19. accessibility_tree_snapshot_combiner.h
  20. accessibility_win_browsertest.cc
  21. android_granularity_movement_browsertest.cc
  22. ax_platform_node_textprovider_win_browsertest.cc
  23. ax_platform_node_textrangeprovider_win_browsertest.cc
  24. ax_platform_node_win_browsertest.cc
  25. ax_style_data.cc
  26. ax_style_data.h
  27. ax_style_data_unittest.cc
  28. ax_tree_formatter_mac_browsertest.mm
  29. browser_accessibility_android.cc
  30. browser_accessibility_android.h
  31. browser_accessibility_android_unittest.cc
  32. browser_accessibility_cocoa_browsertest.mm
  33. browser_accessibility_manager_android.cc
  34. browser_accessibility_manager_android.h
  35. browser_accessibility_manager_unittest.cc
  36. browser_accessibility_state_impl.cc
  37. browser_accessibility_state_impl.h
  38. browser_accessibility_state_impl_android.cc
  39. browser_accessibility_state_impl_android.h
  40. browser_accessibility_state_impl_auralinux.cc
  41. browser_accessibility_state_impl_chromeos.cc
  42. browser_accessibility_state_impl_mac.mm
  43. browser_accessibility_state_impl_unittest.cc
  44. browser_accessibility_state_impl_win.cc
  45. browser_accessibility_unittest.cc
  46. BUILD.gn
  47. captioning_controller.cc
  48. captioning_controller.h
  49. cross_platform_accessibility_browsertest.cc
  50. DIR_METADATA
  51. dump_accessibility_browsertest_base.cc
  52. dump_accessibility_browsertest_base.h
  53. dump_accessibility_events_browsertest.cc
  54. dump_accessibility_node_browsertest.cc
  55. dump_accessibility_scripts_browsertest.cc
  56. dump_accessibility_tree_browsertest.cc
  57. dump_accessibility_tree_browsertest.h
  58. fullscreen_browsertest.cc
  59. hit_testing_browsertest.cc
  60. hit_testing_browsertest.h
  61. hit_testing_mac_browsertest.mm
  62. hit_testing_win_browsertest.cc
  63. line_layout_browsertest.cc
  64. one_shot_accessibility_tree_search_unittest.cc
  65. OWNERS
  66. progressive_accessibility_browsertest.cc
  67. README.md
  68. render_accessibility_host.cc
  69. render_accessibility_host.h
  70. scoped_accessibility_mode_browsertest.cc
  71. scoped_mode_collection.cc
  72. scoped_mode_collection.h
  73. scoped_mode_collection_unittest.cc
  74. site_per_process_accessibility_browsertest.cc
  75. snapshot_ax_tree_browsertest.cc
  76. text_formatting_metrics_android.cc
  77. text_formatting_metrics_android.h
  78. text_formatting_metrics_android_unittest.cc
  79. touch_accessibility_aura_browsertest.cc
  80. web_contents_accessibility.h
  81. web_contents_accessibility_android.cc
  82. web_contents_accessibility_android.h
content/browser/accessibility/README.md

Content Accessibility Support

An overview of key concepts and features of accessibility (AX) support for a //content browser.

AXMode flags

AXMode is a bitfield that specifies how much AX data the browser needs from renderers. The browser's own UI becomes accessible when the kNativeAPIs bit is set (this is typically called “native accessibility”). The pages displayed in WebContents become accessible when the kWebContents bit is set (typically called “web accessibility”). Additional mode flags increase the information from pages that are made available to an AX tool (AT). Some mode flags may enable other features in web content (e.g., image labeling).

Mode flag relevance

A renderer produces AX data according to the mode flags that it is given by its WebContents. This may contain flags not present in the process-wide mode (BrowserAccessibilityState::GetAccessibilityMode()) due to targeting (see Targeted accessibility).

Enabling process-wide accessibility

Typically, AX processing is enabled for the browser when it detects the presence of an AT. This is done via platform-specific mechanisms, which may involve heuristics. A distinction is made between an AT that is definitively a screen reader vs. some other tool (e.g., a form filler). When a screen reader is detected, kExtendedProperties is added to the browser's AXMode. This may be used as a signal for other components of the browser that need special behavior when a screen reader is in use.

AX processing is enabled by creation of a ScopedAccessibilityMode (SAM) instance, and stays active throughout the lifetime of said instance. AX processing is enabled for the entire browser process via creation of a SAM with one or more mode flags; see BrowserAccessibilityState::CreateScopedModeForProcess. In this case, all WebContents in the process receive the new mode flags (see Progressive Accessibility for more details). A process-wide SAM is the only way to enable native accessibility, as native accessibility applies to all native UI components (i.e., Views) in the process.

Targeted accessibility

A component that requires AX data from a specific WebContents uses BrowserAccessibilityState::CreateScopedModeForWebContents to create a SAM targeting that one WebContents (with at least the kWebContents mode flag).

A SAM can target all WebContents belonging to a particular BrowserContext (a “Profile” in Chrome terms) with BrowserAccessibilityState::CreateScopedModeForBrowserContext. This is most useful for enabling mode flags associated with a user preference (e.g., image labeling). Due to filtering performed by BrowserAccessibilityState, a component may speculatively enable mode flags that depend on more fundamental flags. For example, kLabelImages is filtered out if kExtendedProperties is not also present.

Data flow

A WebContents tells its RenderFrames that it wants AX data (e.g., trees and updates) by sending a set of AXMode flags to its blink::mojom::RenderAccessibility interface. These mode flags tell the renderer how much AX data the browser needs. As explained above, the bare minimum mode for web AX data is kWebContents.

A RenderFrame sends AX data to its RenderFrameHost in the browser by way of RenderAccessibilityHost. The frame's WebContents and its observers are given an opportunity to view/modify the AX data before it is given to the BrowserAccessibilityManager for merging into the WebContents's existing tree.

Progressive Accessibility

Mode flag changes are not distributed immediately to WebContents that are hidden. Such changes are held by the WebContents and only sent to its renderers when it is unhidden (becomes visible or occluded). One implication of this is that WebContents::GetAccessibilityMode() on an instance that has never been drawn will return an empty set.

See also