From 51f6c2793adab2d864b3d2b360000ef8db1d3e92 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Dec 2018 16:19:40 +0100 Subject: BASELINE: Update Chromium to 71.0.3578.93 Change-Id: I6a32086c33670e1b033f8b10e6bf1fd4da1d105d Reviewed-by: Alexandru Croitor --- .../third_party/blink/renderer/modules/BUILD.gn | 22 +- .../blink/renderer/modules/accessibility/BUILD.gn | 4 + .../blink/renderer/modules/accessibility/DEPS | 1 + .../accessibility_object_model_test.cc | 33 +- .../renderer/modules/accessibility/ax_enums.cc | 237 --- .../renderer/modules/accessibility/ax_enums.h | 295 +--- .../modules/accessibility/ax_image_map_link.cc | 4 +- .../modules/accessibility/ax_image_map_link.h | 2 +- .../modules/accessibility/ax_inline_text_box.cc | 14 +- .../modules/accessibility/ax_inline_text_box.h | 8 +- .../modules/accessibility/ax_layout_object.cc | 364 ++-- .../modules/accessibility/ax_layout_object.h | 21 +- .../renderer/modules/accessibility/ax_list.cc | 6 +- .../blink/renderer/modules/accessibility/ax_list.h | 2 +- .../renderer/modules/accessibility/ax_list_box.cc | 10 +- .../renderer/modules/accessibility/ax_list_box.h | 2 +- .../modules/accessibility/ax_list_box_option.cc | 12 +- .../modules/accessibility/ax_list_box_option.h | 4 +- .../modules/accessibility/ax_media_controls.cc | 131 +- .../modules/accessibility/ax_media_controls.h | 52 +- .../renderer/modules/accessibility/ax_menu_list.cc | 13 +- .../renderer/modules/accessibility/ax_menu_list.h | 5 +- .../modules/accessibility/ax_menu_list_option.cc | 16 +- .../modules/accessibility/ax_menu_list_option.h | 4 +- .../modules/accessibility/ax_menu_list_popup.cc | 22 +- .../modules/accessibility/ax_menu_list_popup.h | 4 +- .../modules/accessibility/ax_node_object.cc | 788 +++++---- .../modules/accessibility/ax_node_object.h | 32 +- .../renderer/modules/accessibility/ax_object.cc | 1772 ++++++++++---------- .../renderer/modules/accessibility/ax_object.h | 147 +- .../modules/accessibility/ax_object_cache_impl.cc | 223 +-- .../modules/accessibility/ax_object_cache_impl.h | 51 +- .../modules/accessibility/ax_object_test.cc | 23 +- .../renderer/modules/accessibility/ax_position.h | 2 +- .../modules/accessibility/ax_position_test.cc | 126 +- .../modules/accessibility/ax_progress_indicator.cc | 6 +- .../modules/accessibility/ax_progress_indicator.h | 2 +- .../modules/accessibility/ax_radio_input.cc | 2 +- .../renderer/modules/accessibility/ax_range.h | 2 +- .../modules/accessibility/ax_range_test.cc | 6 +- .../modules/accessibility/ax_relation_cache.cc | 12 +- .../renderer/modules/accessibility/ax_selection.h | 2 +- .../renderer/modules/accessibility/ax_slider.cc | 10 +- .../renderer/modules/accessibility/ax_slider.h | 6 +- .../accessibility/ax_sparse_attribute_setter.cc | 10 +- .../renderer/modules/accessibility/ax_svg_root.cc | 8 +- .../renderer/modules/accessibility/ax_svg_root.h | 2 +- .../modules/accessibility/ax_virtual_object.cc | 4 +- .../modules/accessibility/ax_virtual_object.h | 2 +- .../accessibility/inspector_accessibility_agent.cc | 161 +- .../accessibility/inspector_accessibility_agent.h | 9 +- .../accessibility/inspector_type_builder_helper.cc | 23 +- .../renderer/modules/animationworklet/BUILD.gn | 4 +- .../modules/animationworklet/animation_worklet.cc | 7 +- .../modules/animationworklet/animation_worklet.h | 2 +- .../animation_worklet_global_scope.cc | 40 +- .../animation_worklet_global_scope.h | 9 +- .../animation_worklet_global_scope_test.cc | 30 +- .../animation_worklet_messaging_proxy.h | 2 +- .../animation_worklet_proxy_client.cc | 149 ++ .../animation_worklet_proxy_client.h | 85 + .../animation_worklet_proxy_client_impl.cc | 109 -- .../animation_worklet_proxy_client_impl.h | 67 - .../animationworklet/animation_worklet_thread.cc | 16 +- .../animationworklet/animation_worklet_thread.h | 7 - .../animation_worklet_thread_test.cc | 27 +- .../renderer/modules/animationworklet/animator.cc | 13 +- .../renderer/modules/animationworklet/animator.h | 11 +- .../modules/animationworklet/worklet_animation.cc | 255 ++- .../modules/animationworklet/worklet_animation.h | 39 +- .../modules/animationworklet/worklet_animation.idl | 2 +- .../animationworklet/worklet_animation_test.cc | 8 +- .../app_banner/before_install_prompt_event.cc | 6 +- .../audio_output_device_client.cc | 11 +- .../audio_output_device_client.h | 6 +- .../audio_output_device_client_impl.cc | 7 +- .../audio_output_device_client_impl.h | 2 +- .../html_media_element_audio_output_device.cc | 8 +- .../audio_output_devices/set_sink_id_callbacks.h | 2 +- .../background_fetch/background_fetch_bridge.cc | 5 +- .../background_fetch/background_fetch_bridge.h | 3 +- .../background_fetch/background_fetch_event.idl | 2 +- .../background_fetch/background_fetch_fetch.idl | 2 +- .../background_fetch_icon_loader.cc | 46 +- .../background_fetch_icon_loader.h | 10 +- .../background_fetch_icon_loader_test.cc | 42 +- .../background_fetch/background_fetch_manager.cc | 209 +-- .../background_fetch/background_fetch_manager.h | 10 +- .../background_fetch/background_fetch_manager.idl | 8 +- .../background_fetch_manager_test.cc | 49 +- .../background_fetch/background_fetch_record.idl | 2 +- .../background_fetch_registration.cc | 75 +- .../background_fetch_registration.h | 13 +- .../background_fetch_registration.idl | 15 +- .../background_fetch_settled_fetch.idl | 2 +- .../background_fetch_type_converters.cc | 2 +- .../background_fetch_update_ui_event.cc | 12 +- .../background_fetch_update_ui_event.h | 3 +- .../background_fetch_update_ui_event.idl | 2 +- ...ervice_worker_global_scope_background_fetch.idl | 2 +- ...ervice_worker_registration_background_fetch.idl | 2 +- .../blink/renderer/modules/badging/BUILD.gn | 12 + .../blink/renderer/modules/badging/OWNERS | 5 + .../blink/renderer/modules/badging/README.md | 24 + .../blink/renderer/modules/badging/badge.cc | 84 + .../blink/renderer/modules/badging/badge.h | 51 + .../blink/renderer/modules/badging/badge.idl | 16 + .../renderer/modules/battery/battery_dispatcher.cc | 4 +- .../renderer/modules/battery/battery_manager.cc | 4 +- .../renderer/modules/battery/navigator_battery.cc | 4 +- .../blink/renderer/modules/bluetooth/bluetooth.cc | 12 +- .../blink/renderer/modules/cache_storage/cache.cc | 20 +- .../renderer/modules/cache_storage/cache_test.cc | 14 +- .../cache_storage/inspector_cache_storage_agent.cc | 10 +- .../blink/renderer/modules/canvas/OWNERS | 4 +- .../canvas/canvas2d/base_rendering_context_2d.cc | 16 +- .../canvas/canvas2d/base_rendering_context_2d.h | 2 +- .../canvas/canvas2d/canvas_rendering_context_2d.cc | 7 +- .../canvas/canvas2d/canvas_rendering_context_2d.h | 4 +- .../canvas2d/canvas_rendering_context_2d.idl | 4 +- .../canvas_rendering_context_2d_settings.idl | 2 +- .../canvas2d/canvas_rendering_context_2d_state.cc | 4 +- .../canvas2d/canvas_rendering_context_2d_test.cc | 398 +++-- .../canvas_context_creation_attributes_module.idl | 4 +- .../htmlcanvas/html_canvas_element_module.cc | 5 +- .../htmlcanvas/html_canvas_element_module_test.cc | 116 +- .../offscreencanvas/offscreen_canvas_test.cc | 124 +- .../offscreen_canvas_rendering_context_2d.cc | 6 +- .../offscreen_canvas_rendering_context_2d.idl | 2 +- .../modules/clipboard/clipboard_promise.cc | 7 +- .../renderer/modules/cookie_store/cookie_store.cc | 8 +- .../authenticator_attestation_response.cc | 24 +- .../authenticator_attestation_response.h | 15 +- .../authenticator_attestation_response.idl | 1 + .../credentialmanager/credential_manager_proxy.cc | 11 +- .../credentialmanager/credential_manager_proxy.h | 4 +- .../credential_manager_type_converters.cc | 20 + .../credential_manager_type_converters.h | 5 + .../credentialmanager/credentials_container.cc | 9 +- .../credentials_container_test.cc | 2 +- .../blink/renderer/modules/crypto/crypto_key.cc | 6 +- .../renderer/modules/crypto/normalize_algorithm.cc | 11 +- .../modules/csspaint/css_paint_definition.cc | 12 +- .../modules/csspaint/css_paint_definition.h | 2 +- .../csspaint/paint_rendering_context_2d.idl | 2 +- .../renderer/modules/csspaint/paint_worklet.cc | 2 +- .../modules/csspaint/paint_worklet_global_scope.cc | 9 +- .../modules/csspaint/paint_worklet_global_scope.h | 5 +- .../csspaint/paint_worklet_global_scope_proxy.cc | 2 +- .../modules/csspaint/paint_worklet_test.cc | 9 +- .../device_orientation/device_motion_controller.cc | 4 +- .../device_orientation/device_motion_event_pump.cc | 27 +- .../device_orientation/device_motion_event_pump.h | 19 +- .../device_motion_event_pump_unittest.cc | 6 +- .../device_orientation_controller.cc | 2 +- .../device_orientation_event_pump.cc | 1 + .../device_orientation_inspector_agent.cc | 4 +- .../document_metadata/copyless_paste_extractor.cc | 8 +- .../blink/renderer/modules/encoding/BUILD.gn | 4 + .../modules/encoding/text_decoder_stream.cc | 202 +++ .../modules/encoding/text_decoder_stream.h | 64 + .../modules/encoding/text_decoder_stream.idl | 19 + .../renderer/modules/encoding/text_encoder.cc | 4 +- .../modules/encoding/text_encoder_stream.cc | 200 +++ .../modules/encoding/text_encoder_stream.h | 51 + .../modules/encoding/text_encoder_stream.idl | 17 + .../encryptedmedia/media_keys_controller.cc | 2 +- .../navigator_request_media_key_system_access.cc | 8 +- .../modules/event_target_modules_names.json5 | 4 + .../renderer/modules/eventsource/event_source.cc | 12 +- .../modules/eventsource/event_source_parser.cc | 17 +- .../modules/eventsource/event_source_parser.h | 4 +- .../eventsource/event_source_parser_test.cc | 5 +- .../renderer/modules/exported/web_ax_object.cc | 202 +-- .../modules/exported/web_dom_file_system.cc | 12 +- .../modules/exported/web_embedded_worker_impl.cc | 109 +- .../modules/exported/web_embedded_worker_impl.h | 7 +- .../blink/renderer/modules/exported/web_idb_key.cc | 5 +- .../blink/renderer/modules/filesystem/BUILD.gn | 9 + .../blink/renderer/modules/filesystem/DEPS | 1 + .../blink/renderer/modules/filesystem/OWNERS | 1 + .../blink/renderer/modules/filesystem/README.md | 74 + .../choose_file_system_entries_options.idl | 14 + .../choose_file_system_entries_options_accepts.idl | 10 + .../modules/filesystem/directory_reader.cc | 8 +- .../renderer/modules/filesystem/directory_reader.h | 4 +- .../modules/filesystem/directory_reader_sync.cc | 9 +- .../modules/filesystem/directory_reader_sync.h | 4 +- .../renderer/modules/filesystem/dom_file_path.cc | 23 +- .../renderer/modules/filesystem/dom_file_system.cc | 26 +- .../renderer/modules/filesystem/dom_file_system.h | 4 +- .../modules/filesystem/dom_file_system_base.cc | 197 +-- .../modules/filesystem/dom_file_system_base.h | 17 +- .../modules/filesystem/dom_file_system_sync.cc | 28 +- .../modules/filesystem/dom_file_system_sync.h | 2 +- .../modules/filesystem/dom_window_file_system.cc | 120 +- .../modules/filesystem/dom_window_file_system.h | 6 +- .../modules/filesystem/file_system_base_handle.cc | 32 + .../modules/filesystem/file_system_base_handle.h | 8 + .../modules/filesystem/file_system_base_handle.idl | 9 +- .../modules/filesystem/file_system_callbacks.cc | 54 +- .../modules/filesystem/file_system_callbacks.h | 31 +- .../filesystem/file_system_directory_handle.cc | 76 +- .../filesystem/file_system_directory_handle.h | 18 +- .../filesystem/file_system_directory_handle.idl | 13 +- .../filesystem/file_system_directory_iterator.cc | 110 ++ .../filesystem/file_system_directory_iterator.h | 42 + .../filesystem/file_system_directory_iterator.idl | 14 + .../file_system_directory_iterator_entry.idl | 11 + .../modules/filesystem/file_system_dispatcher.cc | 585 +++++++ .../modules/filesystem/file_system_dispatcher.h | 203 +++ .../modules/filesystem/file_system_file_handle.cc | 63 +- .../modules/filesystem/file_system_file_handle.idl | 2 +- .../file_system_get_directory_options.idl | 8 + .../filesystem/file_system_get_file_options.idl | 8 + .../modules/filesystem/file_system_writer.cc | 141 +- .../modules/filesystem/file_system_writer.h | 18 +- .../modules/filesystem/file_system_writer.idl | 7 +- .../renderer/modules/filesystem/file_writer.cc | 69 +- .../renderer/modules/filesystem/file_writer.h | 20 +- .../modules/filesystem/file_writer_base.cc | 139 +- .../renderer/modules/filesystem/file_writer_base.h | 51 +- .../modules/filesystem/file_writer_sync.cc | 55 +- .../renderer/modules/filesystem/file_writer_sync.h | 26 +- .../modules/filesystem/file_writer_test.cc | 353 ++++ .../filesystem/get_system_directory_options.idl | 13 + .../modules/filesystem/local_file_system.cc | 133 +- .../modules/filesystem/local_file_system.h | 21 +- .../modules/filesystem/local_file_system_client.cc | 8 +- .../modules/filesystem/sync_callback_helper.h | 8 +- .../modules/filesystem/window_file_system.idl | 10 +- .../filesystem/worker_global_scope_file_system.cc | 25 +- .../renderer/modules/gamepad/gamepad_dispatcher.cc | 4 +- .../gamepad/gamepad_shared_memory_reader.cc | 2 +- .../renderer/modules/gamepad/navigator_gamepad.cc | 20 +- .../renderer/modules/geolocation/geolocation.cc | 18 +- .../renderer/modules/imagecapture/image_capture.cc | 45 + .../blink/renderer/modules/indexeddb/README.md | 12 +- .../renderer/modules/indexeddb/idb_database.cc | 4 +- .../modules/indexeddb/idb_event_dispatcher.cc | 7 +- .../renderer/modules/indexeddb/idb_factory.cc | 6 +- .../blink/renderer/modules/indexeddb/idb_key.cc | 9 +- .../renderer/modules/indexeddb/idb_key_path.cc | 20 +- .../modules/indexeddb/idb_key_path_test.cc | 2 +- .../renderer/modules/indexeddb/idb_object_store.cc | 40 +- .../renderer/modules/indexeddb/idb_request.cc | 4 +- .../modules/indexeddb/idb_request_queue_item.h | 2 +- .../renderer/modules/indexeddb/idb_test_helper.cc | 4 +- .../modules/indexeddb/idb_transaction_test.cc | 76 +- .../blink/renderer/modules/indexeddb/idb_value.cc | 3 +- .../modules/indexeddb/idb_value_wrapping.cc | 6 +- .../modules/indexeddb/idb_value_wrapping_test.cc | 15 +- .../modules/indexeddb/indexed_db_client.cc | 8 +- .../indexeddb/inspector_indexed_db_agent.cc | 8 +- .../modules/indexeddb/mock_web_idb_database.h | 10 +- .../modules/indexeddb/web_idb_callbacks_impl.cc | 3 +- .../modules/keyboard/keyboard_layout_map.h | 2 +- .../media_capabilities/media_capabilities.cc | 2 +- .../blink/renderer/modules/media_controls/BUILD.gn | 2 + ...dia_control_animated_arrow_container_element.cc | 124 ++ ...edia_control_animated_arrow_container_element.h | 75 + ...ontrol_animated_arrow_container_element_test.cc | 83 + ...isplay_cutout_fullscreen_button_element_test.cc | 2 +- .../media_control_download_button_element.cc | 2 +- .../elements/media_control_element_type.h | 1 + .../elements/media_control_elements_helper.cc | 10 + .../elements/media_control_elements_helper.h | 1 + .../elements/media_control_mute_button_element.cc | 12 + .../media_control_overlay_play_button_element.cc | 231 +-- .../media_control_overlay_play_button_element.h | 53 - ...dia_control_overlay_play_button_element_test.cc | 130 -- .../elements/media_control_panel_element.cc | 12 +- .../elements/media_control_panel_element.h | 1 + .../elements/media_control_panel_element_test.cc | 9 + .../elements/media_control_popup_menu_element.cc | 6 + .../elements/media_control_popup_menu_element.h | 1 + .../media_control_volume_slider_element.cc | 29 + .../elements/media_control_volume_slider_element.h | 3 + .../media_controls_display_cutout_delegate_test.cc | 2 +- .../modules/media_controls/media_controls_impl.cc | 271 ++- .../modules/media_controls/media_controls_impl.h | 26 +- .../media_controls/media_controls_impl_test.cc | 30 +- .../media_controls_orientation_lock_delegate.cc | 2 +- ...edia_controls_orientation_lock_delegate_test.cc | 4 +- .../media_controls_resource_loader.cc | 4 +- .../media_controls_resource_loader.h | 4 +- ...media_controls_rotate_to_fullscreen_delegate.cc | 8 +- ..._controls_rotate_to_fullscreen_delegate_test.cc | 60 +- .../resources/media_controls_resources.grd | 2 +- .../resources/modernMediaControls.css | 249 ++- .../modernMediaControls_animated_arrow.css | 39 + .../resources/modernMediaControls_loading.css | 10 - .../resources/modernMediaControls_overlay_play.css | 38 - .../html_media_element_capture.cc | 4 +- .../modules/mediarecorder/media_recorder.cc | 7 +- .../modules/mediasession/media_metadata.cc | 2 +- .../renderer/modules/mediasession/media_session.cc | 10 +- .../renderer/modules/mediasource/media_source.cc | 18 +- .../modules/mediasource/media_source_registry.cc | 15 +- .../modules/mediasource/media_source_registry.h | 3 +- .../renderer/modules/mediasource/source_buffer.cc | 11 +- .../blink/renderer/modules/mediastream/BUILD.gn | 2 - .../modules/mediastream/media_constraints_impl.cc | 29 +- .../renderer/modules/mediastream/media_devices.cc | 8 +- .../modules/mediastream/media_devices_test.cc | 10 +- .../renderer/modules/mediastream/media_stream.cc | 3 - .../modules/mediastream/media_stream_registry.cc | 14 +- .../modules/mediastream/media_stream_registry.h | 3 +- .../modules/mediastream/media_stream_track.cc | 48 +- .../mediastream/media_track_capabilities.idl | 2 + .../mediastream/media_track_constraint_set.idl | 2 + .../modules/mediastream/media_track_settings.idl | 8 + .../media_track_supported_constraints.idl | 2 + .../modules/mediastream/url_media_stream.cc | 55 - .../modules/mediastream/url_media_stream.h | 51 - .../modules/mediastream/url_media_stream.idl | 41 - .../modules/mediastream/user_media_client.cc | 7 + .../modules/mediastream/user_media_client.h | 1 + .../modules/mediastream/user_media_request.cc | 21 +- .../modules/mediastream/window_media_stream.idl | 4 +- .../blink/renderer/modules/modules_idl_files.gni | 89 +- .../blink/renderer/modules/modules_initializer.cc | 6 +- .../navigator_content_utils.cc | 1 + .../modules/netinfo/network_information.cc | 103 +- .../renderer/modules/netinfo/network_information.h | 13 +- .../third_party/blink/renderer/modules/nfc/OWNERS | 3 +- .../third_party/blink/renderer/modules/nfc/nfc.cc | 13 +- .../third_party/blink/renderer/modules/nfc/nfc.h | 2 +- .../renderer/modules/notifications/notification.cc | 35 +- .../modules/notifications/notification_data.cc | 3 +- .../modules/notifications/notification_data.h | 2 +- .../notifications/notification_data_test.cc | 6 +- .../notifications/notification_image_loader.cc | 3 +- .../modules/notifications/notification_manager.cc | 6 +- .../notifications/notification_resources_loader.cc | 1 + .../notifications/notification_resources_loader.h | 2 +- .../service_worker_registration_notifications.h | 2 +- .../blink/renderer/modules/payments/BUILD.gn | 2 + .../modules/payments/can_make_payment_event.cc | 1 - .../modules/payments/on_payment_response_test.cc | 59 +- .../modules/payments/payer_error_fields.idl | 11 - .../renderer/modules/payments/payer_errors.idl | 11 + .../renderer/modules/payments/payment_address.idl | 2 +- .../modules/payments/payment_details_update.idl | 1 + .../modules/payments/payment_instruments.cc | 5 +- .../payments/payment_method_change_event.cc | 43 + .../modules/payments/payment_method_change_event.h | 47 + .../payments/payment_method_change_event.idl | 16 + .../payments/payment_method_change_event_init.idl | 10 + .../renderer/modules/payments/payment_request.cc | 88 +- .../renderer/modules/payments/payment_request.h | 2 + .../renderer/modules/payments/payment_request.idl | 1 + .../modules/payments/payment_request_event.cc | 3 +- .../payments/payment_request_update_event.h | 7 +- .../renderer/modules/payments/payment_response.cc | 80 +- .../renderer/modules/payments/payment_response.h | 40 +- .../renderer/modules/payments/payment_response.idl | 9 +- .../modules/payments/payment_response_test.cc | 64 +- .../modules/payments/payment_test_helper.cc | 1 + .../modules/payments/payment_validation_errors.idl | 2 +- .../modules/payments/payments_validators.cc | 109 +- .../modules/payments/payments_validators.h | 13 +- .../modules/payments/payments_validators_test.cc | 2 +- .../blink/renderer/modules/peerconnection/BUILD.gn | 24 + .../blink/renderer/modules/peerconnection/DEPS | 4 + .../adapters/ice_transport_adapter.h | 89 + .../ice_transport_adapter_cross_thread_factory.h | 32 + .../adapters/ice_transport_adapter_impl.cc | 218 +++ .../adapters/ice_transport_adapter_impl.h | 59 + .../peerconnection/adapters/ice_transport_host.cc | 128 +- .../peerconnection/adapters/ice_transport_host.h | 57 +- .../peerconnection/adapters/ice_transport_proxy.cc | 94 +- .../peerconnection/adapters/ice_transport_proxy.h | 46 +- .../adapters/p2p_quic_packet_transport.h | 69 + .../peerconnection/adapters/p2p_quic_stream.h | 65 + .../adapters/p2p_quic_stream_impl.cc | 66 + .../peerconnection/adapters/p2p_quic_stream_impl.h | 57 + .../peerconnection/adapters/p2p_quic_transport.h | 77 + .../adapters/p2p_quic_transport_factory.h | 73 + .../adapters/p2p_quic_transport_factory_impl.cc | 194 +++ .../adapters/p2p_quic_transport_factory_impl.h | 43 + .../adapters/p2p_quic_transport_impl.cc | 355 ++++ .../adapters/p2p_quic_transport_impl.h | 180 ++ .../adapters/p2p_quic_transport_test.cc | 1177 +++++++++++++ .../peerconnection/adapters/quic_stream_host.cc | 88 + .../peerconnection/adapters/quic_stream_host.h | 86 + .../peerconnection/adapters/quic_stream_proxy.cc | 91 + .../peerconnection/adapters/quic_stream_proxy.h | 98 ++ .../peerconnection/adapters/quic_transport_host.cc | 139 ++ .../peerconnection/adapters/quic_transport_host.h | 90 + .../adapters/quic_transport_proxy.cc | 151 ++ .../peerconnection/adapters/quic_transport_proxy.h | 110 ++ .../adapters/web_rtc_cross_thread_copier.h | 36 + .../modules/peerconnection/rtc_certificate.idl | 2 +- .../modules/peerconnection/rtc_dtmf_sender.cc | 90 +- .../modules/peerconnection/rtc_dtmf_sender.h | 11 +- .../modules/peerconnection/rtc_ice_candidate.h | 3 +- .../modules/peerconnection/rtc_ice_transport.cc | 165 +- .../modules/peerconnection/rtc_ice_transport.h | 39 +- .../modules/peerconnection/rtc_ice_transport.idl | 2 +- .../peerconnection/rtc_ice_transport_test.cc | 573 +++++++ .../peerconnection/rtc_ice_transport_test.h | 68 + .../modules/peerconnection/rtc_peer_connection.cc | 125 +- .../modules/peerconnection/rtc_peer_connection.h | 15 + .../peerconnection/rtc_peer_connection_ice_event.h | 2 +- .../peerconnection/rtc_peer_connection_test.cc | 412 ++++- .../modules/peerconnection/rtc_quic_stream.cc | 75 +- .../modules/peerconnection/rtc_quic_stream.h | 35 +- .../modules/peerconnection/rtc_quic_stream.idl | 7 +- .../peerconnection/rtc_quic_stream_event.cc | 45 + .../modules/peerconnection/rtc_quic_stream_event.h | 44 + .../peerconnection/rtc_quic_stream_event.idl | 12 + .../peerconnection/rtc_quic_stream_event_init.idl | 8 + .../modules/peerconnection/rtc_quic_transport.cc | 241 ++- .../modules/peerconnection/rtc_quic_transport.h | 68 +- .../modules/peerconnection/rtc_quic_transport.idl | 11 +- .../peerconnection/rtc_quic_transport_test.cc | 235 +++ .../peerconnection/rtc_quic_transport_test.h | 40 + .../modules/peerconnection/rtc_rtp_transceiver.cc | 6 +- .../modules/permissions/permission_descriptor.idl | 12 +- .../renderer/modules/permissions/permissions.cc | 22 +- .../document_picture_in_picture.cc | 2 +- .../html_video_element_picture_in_picture.cc | 10 +- .../picture_in_picture_controller_impl.cc | 12 +- .../presentation/presentation_availability.cc | 4 +- .../presentation_availability_state.cc | 2 +- .../presentation_availability_state_test.cc | 2 +- .../presentation/presentation_connection.cc | 89 +- .../modules/presentation/presentation_connection.h | 33 +- .../presentation_connection_callbacks.h | 2 +- .../presentation/presentation_connection_list.cc | 2 +- .../presentation/presentation_controller.cc | 3 +- .../modules/presentation/presentation_request.cc | 16 +- .../modules/push_messaging/push_manager.cc | 15 +- .../modules/push_messaging/push_message_data.cc | 2 +- .../push_messaging/push_subscription_callbacks.h | 2 +- .../modules/quota/deprecated_storage_quota.cc | 11 +- .../renderer/modules/quota/storage_manager.cc | 5 +- .../remoteplayback/availability_callback_wrapper.h | 2 +- .../modules/remoteplayback/remote_playback.cc | 20 +- .../modules/remoteplayback/remote_playback.h | 8 +- .../modules/remoteplayback/remote_playback_test.cc | 25 +- .../screen_orientation/lock_orientation_callback.h | 2 +- .../screen_orientation_dispatcher.cc | 4 +- .../blink/renderer/modules/sensor/OWNERS | 1 - .../blink/renderer/modules/sensor/sensor.cc | 16 +- .../modules/sensor/sensor_inspector_agent.cc | 19 +- .../modules/sensor/sensor_inspector_agent.h | 5 +- .../modules/sensor/sensor_provider_proxy.cc | 18 +- .../modules/sensor/sensor_provider_proxy.h | 8 +- .../blink/renderer/modules/sensor/sensor_proxy.cc | 6 +- .../renderer/modules/sensor/sensor_proxy_impl.h | 1 + .../modules/sensor/sensor_proxy_inspector_impl.cc | 2 +- .../blink/renderer/modules/serial/BUILD.gn | 18 + .../renderer/modules/serial/navigator_serial.cc | 42 + .../renderer/modules/serial/navigator_serial.h | 38 + .../renderer/modules/serial/navigator_serial.idl | 13 + .../blink/renderer/modules/serial/serial.cc | 43 + .../blink/renderer/modules/serial/serial.h | 46 + .../blink/renderer/modules/serial/serial.idl | 19 + .../renderer/modules/serial/serial_options.idl | 20 + .../blink/renderer/modules/serial/serial_port.cc | 29 + .../blink/renderer/modules/serial/serial_port.h | 30 + .../blink/renderer/modules/serial/serial_port.idl | 22 + .../modules/serial/serial_port_request_options.idl | 8 + .../modules/serial/worker_navigator_serial.cc | 49 + .../modules/serial/worker_navigator_serial.h | 40 + .../modules/serial/worker_navigator_serial.idl | 14 + .../blink/renderer/modules/service_worker/BUILD.gn | 8 +- .../blink/renderer/modules/service_worker/DEPS | 10 + .../renderer/modules/service_worker/fetch_event.cc | 24 +- .../renderer/modules/service_worker/fetch_event.h | 5 +- .../service_worker/fetch_respond_with_observer.cc | 118 +- .../service_worker/fetch_respond_with_observer.h | 6 +- .../service_worker/registration_options.idl | 1 + .../service_worker/respond_with_observer.cc | 2 +- .../modules/service_worker/respond_with_observer.h | 2 +- .../modules/service_worker/service_worker.cc | 78 +- .../modules/service_worker/service_worker.h | 37 +- .../service_worker/service_worker_client.cc | 32 +- .../modules/service_worker/service_worker_client.h | 10 +- .../service_worker/service_worker_clients.cc | 139 +- .../service_worker/service_worker_container.cc | 55 +- .../service_worker/service_worker_container.h | 5 +- .../service_worker_container_client.cc | 42 +- .../service_worker_container_client.h | 37 +- .../service_worker_container_test.cc | 37 + .../modules/service_worker/service_worker_error.cc | 8 + .../modules/service_worker/service_worker_error.h | 7 + .../service_worker/service_worker_global_scope.cc | 152 +- .../service_worker/service_worker_global_scope.h | 24 +- .../service_worker_global_scope_client.cc | 191 ++- .../service_worker_global_scope_client.h | 134 +- .../service_worker_global_scope_proxy.cc | 56 +- .../service_worker_global_scope_proxy.h | 22 +- .../service_worker_installed_scripts_manager.cc | 302 +++- .../service_worker_installed_scripts_manager.h | 34 +- ...ervice_worker_installed_scripts_manager_test.cc | 428 +++++ .../service_worker/service_worker_registration.cc | 28 +- .../service_worker/service_worker_registration.h | 7 +- .../service_worker/service_worker_registration.idl | 6 +- .../service_worker/service_worker_thread.cc | 4 +- .../service_worker/service_worker_window_client.cc | 45 +- .../service_worker/service_worker_window_client.h | 12 +- .../service_worker_window_client_callback.cc | 43 - .../service_worker_window_client_callback.h | 31 - .../service_worker/thread_safe_script_container.cc | 108 ++ .../service_worker/thread_safe_script_container.h | 138 ++ .../thread_safe_script_container_test.cc | 217 +++ .../modules/service_worker/wait_until_observer.cc | 23 +- .../modules/service_worker/wait_until_observer.h | 2 +- .../web_embedded_worker_impl_test.cc | 108 +- .../modules/shapedetection/detected_barcode.cc | 16 + .../modules/shapedetection/detected_barcode.h | 3 + .../modules/shapedetection/detected_barcode.idl | 3 + .../modules/shapedetection/detected_face.cc | 22 + .../modules/shapedetection/detected_face.h | 2 + .../modules/shapedetection/detected_face.idl | 3 + .../modules/shapedetection/detected_text.cc | 16 + .../modules/shapedetection/detected_text.h | 3 + .../modules/shapedetection/detected_text.idl | 3 + .../blink/renderer/modules/speech/BUILD.gn | 2 + .../renderer/modules/speech/speech_grammar.cc | 2 +- .../renderer/modules/speech/speech_grammar_list.cc | 2 +- .../renderer/modules/speech/speech_recognition.cc | 9 +- .../renderer/modules/speech/speech_recognition.h | 2 +- .../speech/speech_recognition_controller.cc | 2 +- .../modules/speech/speech_recognition_controller.h | 2 +- .../modules/speech/speech_recognition_event.cc | 4 +- .../modules/speech/speech_recognition_event.h | 8 +- .../renderer/modules/speech/speech_synthesis.cc | 56 +- .../renderer/modules/speech/speech_synthesis.h | 6 +- .../modules/speech/speech_synthesis_error_event.cc | 26 + .../modules/speech/speech_synthesis_error_event.h | 33 + .../speech/speech_synthesis_error_event.idl | 28 + .../speech/speech_synthesis_error_event_init.idl | 8 + .../modules/speech/speech_synthesis_event.cc | 15 +- .../modules/speech/speech_synthesis_event.h | 13 +- .../modules/speech/speech_synthesis_event.idl | 6 +- .../modules/speech/speech_synthesis_event_init.idl | 11 + .../blink/renderer/modules/storage/BUILD.gn | 6 +- .../blink/renderer/modules/storage/README.md | 110 +- .../modules/storage/cached_storage_area.cc | 109 +- .../renderer/modules/storage/cached_storage_area.h | 36 +- .../modules/storage/cached_storage_area_test.cc | 12 +- .../renderer/modules/storage/docs/ownership.png | Bin 0 -> 44260 bytes .../renderer/modules/storage/dom_window_storage.cc | 12 +- .../modules/storage/inspector_dom_storage_agent.cc | 40 +- .../blink/renderer/modules/storage/storage_area.cc | 39 +- .../renderer/modules/storage/storage_controller.cc | 170 ++ .../renderer/modules/storage/storage_controller.h | 110 ++ .../modules/storage/storage_controller_test.cc | 176 ++ .../renderer/modules/storage/storage_namespace.cc | 159 +- .../renderer/modules/storage/storage_namespace.h | 101 +- .../storage/storage_namespace_controller.cc | 70 - .../modules/storage/storage_namespace_controller.h | 58 - .../modules/storage/storage_namespace_test.cc | 96 ++ .../modules/storage/testing/fake_area_source.h | 3 +- .../time_zone_monitor/time_zone_monitor_client.cc | 16 +- .../modules/vibration/navigator_vibration.cc | 23 - .../blink/renderer/modules/vr/navigator_vr.cc | 5 +- .../blink/renderer/modules/vr/vr_display.cc | 27 +- .../blink/renderer/modules/vr/vr_display.h | 15 +- .../blink/renderer/modules/wake_lock/DEPS | 1 + .../modules/wake_lock/navigator_wake_lock.cc | 6 +- .../modules/wake_lock/navigator_wake_lock.h | 1 + .../blink/renderer/modules/wake_lock/wake_lock.cc | 28 +- .../blink/renderer/modules/wake_lock/wake_lock.h | 2 + .../renderer/modules/webaudio/analyser_node.cc | 2 +- .../modules/webaudio/async_audio_decoder.cc | 14 +- .../modules/webaudio/async_audio_decoder.h | 7 +- .../modules/webaudio/audio_buffer_source_node.cc | 20 +- .../renderer/modules/webaudio/audio_context.cc | 46 +- .../renderer/modules/webaudio/audio_context.h | 16 +- .../renderer/modules/webaudio/audio_context.idl | 11 +- .../webaudio/audio_context_autoplay_test.cc | 53 +- .../modules/webaudio/audio_context_test.cc | 7 +- .../blink/renderer/modules/webaudio/audio_node.cc | 2 +- .../blink/renderer/modules/webaudio/audio_param.cc | 34 +- .../blink/renderer/modules/webaudio/audio_param.h | 3 + .../modules/webaudio/audio_param_timeline.cc | 48 +- .../renderer/modules/webaudio/audio_worklet.cc | 3 +- .../modules/webaudio/audio_worklet_global_scope.cc | 14 +- .../modules/webaudio/audio_worklet_global_scope.h | 7 +- .../webaudio/audio_worklet_global_scope_test.cc | 2 +- .../modules/webaudio/audio_worklet_node.cc | 19 +- .../renderer/modules/webaudio/audio_worklet_node.h | 3 + .../modules/webaudio/audio_worklet_thread.cc | 35 +- .../modules/webaudio/audio_worklet_thread.h | 10 - .../modules/webaudio/audio_worklet_thread_test.cc | 2 +- .../modules/webaudio/base_audio_context.cc | 71 +- .../renderer/modules/webaudio/base_audio_context.h | 52 +- .../modules/webaudio/base_audio_context.idl | 9 - .../renderer/modules/webaudio/convolver_node.cc | 13 +- .../renderer/modules/webaudio/convolver_node.h | 5 +- .../cross_thread_audio_worklet_processor_info.h | 4 +- .../webaudio/default_audio_destination_node.cc | 101 +- .../webaudio/default_audio_destination_node.h | 10 +- .../modules/webaudio/deferred_task_handler.cc | 55 +- .../modules/webaudio/deferred_task_handler.h | 35 +- .../webaudio/media_element_audio_source_node.cc | 22 +- .../webaudio/media_element_audio_source_node.h | 13 +- .../webaudio/media_element_audio_source_node.idl | 3 +- .../media_stream_audio_destination_node.cc | 14 +- .../webaudio/media_stream_audio_destination_node.h | 8 +- .../media_stream_audio_destination_node.idl | 2 +- .../webaudio/media_stream_audio_source_node.cc | 15 +- .../webaudio/media_stream_audio_source_node.h | 12 +- .../webaudio/media_stream_audio_source_node.idl | 2 +- .../modules/webaudio/offline_audio_context.cc | 13 +- .../modules/webaudio/offline_audio_context.h | 6 +- .../modules/webaudio/offline_audio_context.idl | 1 + .../webaudio/offline_audio_destination_node.cc | 2 +- .../webaudio/offline_audio_destination_node.h | 4 +- .../renderer/modules/webaudio/oscillator_node.cc | 50 +- .../blink/renderer/modules/webaudio/panner_node.cc | 26 +- .../blink/renderer/modules/webaudio/panner_node.h | 4 +- .../renderer/modules/webaudio/panner_node.idl | 4 +- .../modules/webaudio/script_processor_node.cc | 22 +- .../modules/webaudio/script_processor_node.h | 5 +- .../modules/webaudio/script_processor_node_test.cc | 8 +- .../modules/webdatabase/database_authorizer.cc | 2 +- .../modules/webdatabase/database_client.cc | 4 +- .../modules/webdatabase/database_context.cc | 2 +- .../modules/webdatabase/database_manager.cc | 10 +- .../modules/webdatabase/database_manager.h | 9 +- .../modules/webdatabase/database_thread.cc | 6 +- .../modules/webdatabase/database_tracker.cc | 4 +- .../modules/webdatabase/database_tracker.h | 2 +- .../webdatabase/sql_transaction_coordinator.h | 3 +- .../modules/webdatabase/sqlite/sql_value.h | 2 +- .../modules/webdatabase/sqlite/sqlite_database.h | 2 +- .../webdatabase/sqlite/sqlite_file_system.cc | 7 +- .../blink/renderer/modules/webgl/BUILD.gn | 2 + .../blink/renderer/modules/webgl/OWNERS | 1 + .../modules/webgl/khr_parallel_shader_compile.cc | 69 + .../modules/webgl/khr_parallel_shader_compile.h | 51 + .../modules/webgl/khr_parallel_shader_compile.idl | 36 + .../webgl/webgl2_compute_rendering_context_base.cc | 26 + .../webgl/webgl2_compute_rendering_context_base.h | 1 + .../modules/webgl/webgl2_rendering_context.cc | 4 + .../modules/webgl/webgl2_rendering_context.h | 2 + .../webgl/webgl_context_attribute_helpers.cc | 1 + .../modules/webgl/webgl_context_attributes.idl | 2 + .../renderer/modules/webgl/webgl_extension_name.h | 1 + .../blink/renderer/modules/webgl/webgl_program.cc | 8 + .../blink/renderer/modules/webgl/webgl_program.h | 2 + .../modules/webgl/webgl_rendering_context.cc | 4 + .../modules/webgl/webgl_rendering_context.h | 2 + .../modules/webgl/webgl_rendering_context_base.cc | 70 +- .../modules/webgl/webgl_rendering_context_base.h | 7 +- .../blink/renderer/modules/webmidi/midi_access.cc | 9 +- .../modules/webmidi/midi_access_initializer.cc | 4 +- .../modules/webmidi/midi_access_initializer.h | 2 +- .../blink/renderer/modules/webmidi/midi_input.cc | 2 +- .../blink/renderer/modules/webmidi/midi_output.cc | 2 +- .../blink/renderer/modules/webmidi/midi_port.cc | 2 +- .../blink/renderer/modules/webmidi/midi_port_map.h | 2 +- .../renderer/modules/webmidi/navigator_web_midi.cc | 7 +- .../renderer/modules/webshare/navigator_share.cc | 5 +- .../renderer/modules/websockets/dom_websocket.cc | 64 +- .../renderer/modules/websockets/dom_websocket.h | 2 + .../modules/websockets/dom_websocket_test.cc | 23 + .../websockets/inspector_websocket_events.cc | 16 +- .../modules/websockets/websocket_channel_impl.cc | 9 +- .../modules/websockets/websocket_channel_impl.h | 5 +- .../websockets/websocket_channel_impl_test.cc | 6 +- .../renderer/modules/websockets/websocket_handle.h | 3 +- .../modules/websockets/websocket_handle_impl.cc | 2 +- .../modules/websockets/websocket_handle_impl.h | 3 +- .../blink/renderer/modules/webusb/usb.cc | 76 +- .../blink/renderer/modules/webusb/usb.h | 5 +- .../modules/webusb/usb_alternate_interface.cc | 10 +- .../modules/webusb/usb_alternate_interface.h | 8 +- .../renderer/modules/webusb/usb_configuration.cc | 12 +- .../renderer/modules/webusb/usb_configuration.h | 11 +- .../blink/renderer/modules/webusb/usb_device.cc | 106 +- .../blink/renderer/modules/webusb/usb_device.h | 36 +- .../blink/renderer/modules/webusb/usb_endpoint.cc | 8 +- .../blink/renderer/modules/webusb/usb_endpoint.h | 8 +- .../blink/renderer/modules/webusb/usb_interface.cc | 12 +- .../blink/renderer/modules/webusb/usb_interface.h | 13 +- .../third_party/blink/renderer/modules/xr/xr.cc | 8 +- .../renderer/modules/xr/xr_coordinate_system.cc | 10 + .../renderer/modules/xr/xr_coordinate_system.h | 9 +- .../renderer/modules/xr/xr_coordinate_system.idl | 2 +- .../blink/renderer/modules/xr/xr_device.cc | 4 +- .../blink/renderer/modules/xr/xr_frame_provider.cc | 23 +- .../blink/renderer/modules/xr/xr_layer.cc | 2 + .../blink/renderer/modules/xr/xr_layer.h | 4 + .../blink/renderer/modules/xr/xr_session.cc | 12 +- .../blink/renderer/modules/xr/xr_webgl_layer.cc | 6 + .../blink/renderer/modules/xr/xr_webgl_layer.h | 8 +- 693 files changed, 20298 insertions(+), 7624 deletions(-) create mode 100644 chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.cc create mode 100644 chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client.h delete mode 100644 chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc delete mode 100644 chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.h create mode 100644 chromium/third_party/blink/renderer/modules/badging/BUILD.gn create mode 100644 chromium/third_party/blink/renderer/modules/badging/OWNERS create mode 100644 chromium/third_party/blink/renderer/modules/badging/README.md create mode 100644 chromium/third_party/blink/renderer/modules/badging/badge.cc create mode 100644 chromium/third_party/blink/renderer/modules/badging/badge.h create mode 100644 chromium/third_party/blink/renderer/modules/badging/badge.idl create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_decoder_stream.cc create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_decoder_stream.h create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_decoder_stream.idl create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.h create mode 100644 chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/README.md create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/choose_file_system_entries_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/choose_file_system_entries_options_accepts.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_directory_iterator.cc create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_directory_iterator.h create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_directory_iterator.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_directory_iterator_entry.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.cc create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.h create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_get_directory_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_system_get_file_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/file_writer_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/filesystem/get_system_directory_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/media_controls/elements/media_control_animated_arrow_container_element.cc create mode 100644 chromium/third_party/blink/renderer/modules/media_controls/elements/media_control_animated_arrow_container_element.h create mode 100644 chromium/third_party/blink/renderer/modules/media_controls/elements/media_control_animated_arrow_container_element_test.cc delete mode 100644 chromium/third_party/blink/renderer/modules/media_controls/elements/media_control_overlay_play_button_element_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls_animated_arrow.css delete mode 100644 chromium/third_party/blink/renderer/modules/media_controls/resources/modernMediaControls_overlay_play.css delete mode 100644 chromium/third_party/blink/renderer/modules/mediastream/url_media_stream.cc delete mode 100644 chromium/third_party/blink/renderer/modules/mediastream/url_media_stream.h delete mode 100644 chromium/third_party/blink/renderer/modules/mediastream/url_media_stream.idl delete mode 100644 chromium/third_party/blink/renderer/modules/payments/payer_error_fields.idl create mode 100644 chromium/third_party/blink/renderer/modules/payments/payer_errors.idl create mode 100644 chromium/third_party/blink/renderer/modules/payments/payment_method_change_event.cc create mode 100644 chromium/third_party/blink/renderer/modules/payments/payment_method_change_event.h create mode 100644 chromium/third_party/blink/renderer/modules/payments/payment_method_change_event.idl create mode 100644 chromium/third_party/blink/renderer/modules/payments/payment_method_change_event_init.idl create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter_cross_thread_factory.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter_impl.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter_impl.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_packet_transport.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_stream.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_stream_impl.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_stream_impl.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_factory.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_factory_impl.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_factory_impl.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_impl.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_impl.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/p2p_quic_transport_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_host.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_stream_proxy.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_host.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/adapters/quic_transport_proxy.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport_test.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream_event.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream_event.h create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream_event.idl create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream_event_init.idl create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport_test.h create mode 100644 chromium/third_party/blink/renderer/modules/serial/BUILD.gn create mode 100644 chromium/third_party/blink/renderer/modules/serial/navigator_serial.cc create mode 100644 chromium/third_party/blink/renderer/modules/serial/navigator_serial.h create mode 100644 chromium/third_party/blink/renderer/modules/serial/navigator_serial.idl create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial.cc create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial.h create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial.idl create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial_port.cc create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial_port.h create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial_port.idl create mode 100644 chromium/third_party/blink/renderer/modules/serial/serial_port_request_options.idl create mode 100644 chromium/third_party/blink/renderer/modules/serial/worker_navigator_serial.cc create mode 100644 chromium/third_party/blink/renderer/modules/serial/worker_navigator_serial.h create mode 100644 chromium/third_party/blink/renderer/modules/serial/worker_navigator_serial.idl create mode 100644 chromium/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc delete mode 100644 chromium/third_party/blink/renderer/modules/service_worker/service_worker_window_client_callback.cc delete mode 100644 chromium/third_party/blink/renderer/modules/service_worker/service_worker_window_client_callback.h create mode 100644 chromium/third_party/blink/renderer/modules/service_worker/thread_safe_script_container.cc create mode 100644 chromium/third_party/blink/renderer/modules/service_worker/thread_safe_script_container.h create mode 100644 chromium/third_party/blink/renderer/modules/service_worker/thread_safe_script_container_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/speech/speech_synthesis_error_event.cc create mode 100644 chromium/third_party/blink/renderer/modules/speech/speech_synthesis_error_event.h create mode 100644 chromium/third_party/blink/renderer/modules/speech/speech_synthesis_error_event.idl create mode 100644 chromium/third_party/blink/renderer/modules/speech/speech_synthesis_error_event_init.idl create mode 100644 chromium/third_party/blink/renderer/modules/speech/speech_synthesis_event_init.idl create mode 100644 chromium/third_party/blink/renderer/modules/storage/docs/ownership.png create mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_controller.cc create mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_controller.h create mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_controller_test.cc delete mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_namespace_controller.cc delete mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_namespace_controller.h create mode 100644 chromium/third_party/blink/renderer/modules/storage/storage_namespace_test.cc create mode 100644 chromium/third_party/blink/renderer/modules/webgl/khr_parallel_shader_compile.cc create mode 100644 chromium/third_party/blink/renderer/modules/webgl/khr_parallel_shader_compile.h create mode 100644 chromium/third_party/blink/renderer/modules/webgl/khr_parallel_shader_compile.idl (limited to 'chromium/third_party/blink/renderer/modules') diff --git a/chromium/third_party/blink/renderer/modules/BUILD.gn b/chromium/third_party/blink/renderer/modules/BUILD.gn index 6f94a382cec..7af1d24e4be 100644 --- a/chromium/third_party/blink/renderer/modules/BUILD.gn +++ b/chromium/third_party/blink/renderer/modules/BUILD.gn @@ -83,6 +83,7 @@ target("jumbo_" + modules_target_type, "modules") { deps = [ ":make_modules_generated", ":module_names", + "//net:net", "//third_party/blink/renderer/bindings/modules:generated", "//third_party/blink/renderer/bindings/modules/v8:bindings_modules_impl", "//third_party/blink/renderer/bindings/modules/v8:bindings_modules_origin_trial_features", @@ -93,6 +94,7 @@ target("jumbo_" + modules_target_type, "modules") { "//third_party/blink/renderer/modules/audio_output_devices", "//third_party/blink/renderer/modules/background_fetch", "//third_party/blink/renderer/modules/background_sync", + "//third_party/blink/renderer/modules/badging", "//third_party/blink/renderer/modules/battery", "//third_party/blink/renderer/modules/beacon", "//third_party/blink/renderer/modules/bluetooth", @@ -143,6 +145,7 @@ target("jumbo_" + modules_target_type, "modules") { "//third_party/blink/renderer/modules/remoteplayback", "//third_party/blink/renderer/modules/screen_orientation", "//third_party/blink/renderer/modules/sensor", + "//third_party/blink/renderer/modules/serial", "//third_party/blink/renderer/modules/service_worker", "//third_party/blink/renderer/modules/shapedetection", "//third_party/blink/renderer/modules/speech", @@ -163,6 +166,7 @@ target("jumbo_" + modules_target_type, "modules") { "//third_party/blink/renderer/modules/xr", "//third_party/icu", "//third_party/webrtc/pc:libjingle_peerconnection", + "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc_overrides:init_webrtc", "//third_party/zlib", ] @@ -187,6 +191,11 @@ jumbo_source_set("modules_testing") { "navigatorcontentutils/testing/internals_navigator_content_utils.h", "navigatorcontentutils/testing/navigator_content_utils_client_mock.cc", "navigatorcontentutils/testing/navigator_content_utils_client_mock.h", + "peerconnection/adapters/test/mock_ice_transport_adapter.h", + "peerconnection/adapters/test/mock_ice_transport_adapter_cross_thread_factory.h", + "peerconnection/adapters/test/mock_p2p_quic_packet_transport.h", + "peerconnection/adapters/test/mock_p2p_quic_transport.h", + "peerconnection/adapters/test/mock_p2p_quic_transport_factory.h", "peerconnection/testing/internals_rtc_certificate.cc", "peerconnection/testing/internals_rtc_certificate.h", "peerconnection/testing/internals_rtc_peer_connection.cc", @@ -256,6 +265,7 @@ jumbo_source_set("unit_tests") { "document_metadata/copyless_paste_extractor_test.cc", "eventsource/event_source_parser_test.cc", "filesystem/dom_file_system_base_test.cc", + "filesystem/file_writer_test.cc", "indexeddb/idb_key_path_test.cc", "indexeddb/idb_request_test.cc", "indexeddb/idb_test_helper.cc", @@ -264,10 +274,10 @@ jumbo_source_set("unit_tests") { "indexeddb/mock_web_idb_database.cc", "indexeddb/mock_web_idb_database.h", "manifest/image_resource_type_converters_test.cc", + "media_controls/elements/media_control_animated_arrow_container_element_test.cc", "media_controls/elements/media_control_display_cutout_fullscreen_button_element_test.cc", "media_controls/elements/media_control_input_element_test.cc", "media_controls/elements/media_control_loading_panel_element_test.cc", - "media_controls/elements/media_control_overlay_play_button_element_test.cc", "media_controls/elements/media_control_panel_element_test.cc", "media_controls/elements/media_control_scrubbing_message_element_test.cc", "media_controls/elements/media_control_timeline_element_test.cc", @@ -294,8 +304,13 @@ jumbo_source_set("unit_tests") { "payments/payment_test_helper.cc", "payments/payment_test_helper.h", "payments/payments_validators_test.cc", + "peerconnection/adapters/p2p_quic_transport_test.cc", "peerconnection/rtc_data_channel_test.cc", + "peerconnection/rtc_ice_transport_test.cc", + "peerconnection/rtc_ice_transport_test.h", "peerconnection/rtc_peer_connection_test.cc", + "peerconnection/rtc_quic_transport_test.cc", + "peerconnection/rtc_quic_transport_test.h", "picture_in_picture/html_video_element_picture_in_picture_test.cc", "presentation/mock_presentation_service.h", "presentation/presentation_availability_state_test.cc", @@ -308,6 +323,8 @@ jumbo_source_set("unit_tests") { "remoteplayback/remote_playback_test.cc", "screen_orientation/screen_orientation_controller_impl_test.cc", "service_worker/service_worker_container_test.cc", + "service_worker/service_worker_installed_scripts_manager_test.cc", + "service_worker/thread_safe_script_container_test.cc", "service_worker/web_embedded_worker_impl_test.cc", "wake_lock/screen_wake_lock_test.cc", "webaudio/audio_basic_processor_handler_test.cc", @@ -333,7 +350,9 @@ jumbo_source_set("unit_tests") { deps = [ ":modules", ":modules_testing", + "//net:quic_test_tools", "//services/device/public/cpp/test:test_support", + "//services/viz/public/interfaces:interfaces_blink", "//skia", "//testing/gmock", "//testing/gtest", @@ -342,6 +361,7 @@ jumbo_source_set("unit_tests") { "//third_party/blink/renderer/modules/storage:unit_tests", "//third_party/blink/renderer/platform", "//third_party/blink/renderer/platform/wtf", + "//third_party/webrtc/rtc_base:rtc_base", "//v8", ] } diff --git a/chromium/third_party/blink/renderer/modules/accessibility/BUILD.gn b/chromium/third_party/blink/renderer/modules/accessibility/BUILD.gn index 3aadcb08e2c..c4478a9d087 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/BUILD.gn +++ b/chromium/third_party/blink/renderer/modules/accessibility/BUILD.gn @@ -62,6 +62,10 @@ blink_modules_sources("accessibility") { "inspector_type_builder_helper.h", ] + deps = [ + "//ui/accessibility:ax_enums_mojo_blink", + ] + # The modules/accessibility/ depends closely on core/ -- # include the core pch for faster Windows compilation times. configs += [ "//third_party/blink/renderer/core:blink_core_pch" ] diff --git a/chromium/third_party/blink/renderer/modules/accessibility/DEPS b/chromium/third_party/blink/renderer/modules/accessibility/DEPS index ec3df5f6ed4..44011c4a0c6 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/DEPS +++ b/chromium/third_party/blink/renderer/modules/accessibility/DEPS @@ -1,5 +1,6 @@ include_rules = [ "+mojo/public/cpp/bindings/binding.h", + "+ui/accessibility/ax_enums.mojom-blink.h", "-third_party/blink/renderer/modules", "+third_party/blink/renderer/modules/accessibility", "+third_party/blink/renderer/modules/media_controls", diff --git a/chromium/third_party/blink/renderer/modules/accessibility/accessibility_object_model_test.cc b/chromium/third_party/blink/renderer/modules/accessibility/accessibility_object_model_test.cc index cac291e66d8..b5cbf790b05 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/accessibility_object_model_test.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/accessibility_object_model_test.cc @@ -55,13 +55,13 @@ TEST_F(AccessibilityObjectModelTest, SetAccessibleNodeRole) { ASSERT_NE(nullptr, button); auto* axButton = cache->GetOrCreate(button); - EXPECT_EQ(kButtonRole, axButton->RoleValue()); + EXPECT_EQ(ax::mojom::Role::kButton, axButton->RoleValue()); button->accessibleNode()->setRole("slider"); EXPECT_EQ("slider", button->accessibleNode()->role()); axButton = cache->GetOrCreate(button); - EXPECT_EQ(kSliderRole, axButton->RoleValue()); + EXPECT_EQ(ax::mojom::Role::kSlider, axButton->RoleValue()); } TEST_F(AccessibilityObjectModelTest, AOMDoesNotReflectARIA) { @@ -81,8 +81,8 @@ TEST_F(AccessibilityObjectModelTest, AOMDoesNotReflectARIA) { auto* cache = AXObjectCache(); ASSERT_NE(nullptr, cache); auto* axTextBox = cache->GetOrCreate(textbox); - EXPECT_EQ(kTextFieldWithComboBoxRole, axTextBox->RoleValue()); - AXNameFrom name_from; + EXPECT_EQ(ax::mojom::Role::kTextFieldWithComboBox, axTextBox->RoleValue()); + ax::mojom::NameFrom name_from; AXObject::AXObjectVector name_objects; EXPECT_EQ("Combo", axTextBox->GetName(name_from, &name_objects)); EXPECT_EQ(axTextBox->Restriction(), kDisabled); @@ -112,8 +112,8 @@ TEST_F(AccessibilityObjectModelTest, AOMPropertiesCanBeCleared) { auto* cache = AXObjectCache(); ASSERT_NE(nullptr, cache); auto* axButton = cache->GetOrCreate(button); - EXPECT_EQ(kCheckBoxRole, axButton->RoleValue()); - AXNameFrom name_from; + EXPECT_EQ(ax::mojom::Role::kCheckBox, axButton->RoleValue()); + ax::mojom::NameFrom name_from; AXObject::AXObjectVector name_objects; EXPECT_EQ("Check", axButton->GetName(name_from, &name_objects)); EXPECT_EQ(axButton->Restriction(), kDisabled); @@ -125,7 +125,7 @@ TEST_F(AccessibilityObjectModelTest, AOMPropertiesCanBeCleared) { // Assert that the AX object was affected by AOM properties. axButton = cache->GetOrCreate(button); - EXPECT_EQ(kRadioButtonRole, axButton->RoleValue()); + EXPECT_EQ(ax::mojom::Role::kRadioButton, axButton->RoleValue()); EXPECT_EQ("Radio", axButton->GetName(name_from, &name_objects)); EXPECT_EQ(axButton->Restriction(), kNone); @@ -136,7 +136,7 @@ TEST_F(AccessibilityObjectModelTest, AOMPropertiesCanBeCleared) { // The AX Object should now revert to ARIA. axButton = cache->GetOrCreate(button); - EXPECT_EQ(kCheckBoxRole, axButton->RoleValue()); + EXPECT_EQ(ax::mojom::Role::kCheckBox, axButton->RoleValue()); EXPECT_EQ("Check", axButton->GetName(name_from, &name_objects)); EXPECT_EQ(axButton->Restriction(), kDisabled); } @@ -316,16 +316,16 @@ TEST_F(AccessibilityObjectModelTest, SparseAttributes) { ASSERT_EQ("Widget", sparse_attributes .string_attributes[AXStringAttribute::kAriaRoleDescription]); - ASSERT_EQ(kListBoxOptionRole, + ASSERT_EQ(ax::mojom::Role::kListBoxOption, sparse_attributes .object_attributes[AXObjectAttribute::kAriaActiveDescendant] ->RoleValue()); ASSERT_EQ( - kContentInfoRole, + ax::mojom::Role::kContentInfo, sparse_attributes.object_attributes[AXObjectAttribute::kAriaDetails] ->RoleValue()); ASSERT_EQ( - kArticleRole, + ax::mojom::Role::kArticle, sparse_attributes.object_attributes[AXObjectAttribute::kAriaErrorMessage] ->RoleValue()); @@ -347,14 +347,15 @@ TEST_F(AccessibilityObjectModelTest, SparseAttributes) { ASSERT_EQ("Object", sparse_attributes2 .string_attributes[AXStringAttribute::kAriaRoleDescription]); - ASSERT_EQ(kCellRole, + ASSERT_EQ(ax::mojom::Role::kCell, sparse_attributes2 .object_attributes[AXObjectAttribute::kAriaActiveDescendant] ->RoleValue()); - ASSERT_EQ(kFormRole, sparse_attributes2 - .object_attributes[AXObjectAttribute::kAriaDetails] - ->RoleValue()); - ASSERT_EQ(kBannerRole, + ASSERT_EQ( + ax::mojom::Role::kForm, + sparse_attributes2.object_attributes[AXObjectAttribute::kAriaDetails] + ->RoleValue()); + ASSERT_EQ(ax::mojom::Role::kBanner, sparse_attributes2 .object_attributes[AXObjectAttribute::kAriaErrorMessage] ->RoleValue()); diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.cc index a674868b4d7..7b1d31b4173 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.cc @@ -12,201 +12,6 @@ namespace blink { -STATIC_ASSERT_ENUM(kWebAXRoleAbbr, kAbbrRole); -STATIC_ASSERT_ENUM(kWebAXRoleAlertDialog, kAlertDialogRole); -STATIC_ASSERT_ENUM(kWebAXRoleAlert, kAlertRole); -STATIC_ASSERT_ENUM(kWebAXRoleAnchor, kAnchorRole); -STATIC_ASSERT_ENUM(kWebAXRoleAnnotation, kAnnotationRole); -STATIC_ASSERT_ENUM(kWebAXRoleApplication, kApplicationRole); -STATIC_ASSERT_ENUM(kWebAXRoleArticle, kArticleRole); -STATIC_ASSERT_ENUM(kWebAXRoleAudio, kAudioRole); -STATIC_ASSERT_ENUM(kWebAXRoleBanner, kBannerRole); -STATIC_ASSERT_ENUM(kWebAXRoleBlockquote, kBlockquoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleButton, kButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleCanvas, kCanvasRole); -STATIC_ASSERT_ENUM(kWebAXRoleCaption, kCaptionRole); -STATIC_ASSERT_ENUM(kWebAXRoleCell, kCellRole); -STATIC_ASSERT_ENUM(kWebAXRoleCheckBox, kCheckBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleColorWell, kColorWellRole); -STATIC_ASSERT_ENUM(kWebAXRoleColumnHeader, kColumnHeaderRole); -STATIC_ASSERT_ENUM(kWebAXRoleColumn, kColumnRole); -STATIC_ASSERT_ENUM(kWebAXRoleComboBoxGrouping, kComboBoxGroupingRole); -STATIC_ASSERT_ENUM(kWebAXRoleComboBoxMenuButton, kComboBoxMenuButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleComplementary, kComplementaryRole); -STATIC_ASSERT_ENUM(kWebAXRoleContentDeletion, kContentDeletionRole); -STATIC_ASSERT_ENUM(kWebAXRoleContentInsertion, kContentInsertionRole); -STATIC_ASSERT_ENUM(kWebAXRoleContentInfo, kContentInfoRole); -STATIC_ASSERT_ENUM(kWebAXRoleDate, kDateRole); -STATIC_ASSERT_ENUM(kWebAXRoleDateTime, kDateTimeRole); -STATIC_ASSERT_ENUM(kWebAXRoleDefinition, kDefinitionRole); -STATIC_ASSERT_ENUM(kWebAXRoleDescriptionListDetail, kDescriptionListDetailRole); -STATIC_ASSERT_ENUM(kWebAXRoleDescriptionList, kDescriptionListRole); -STATIC_ASSERT_ENUM(kWebAXRoleDescriptionListTerm, kDescriptionListTermRole); -STATIC_ASSERT_ENUM(kWebAXRoleDetails, kDetailsRole); -STATIC_ASSERT_ENUM(kWebAXRoleDialog, kDialogRole); -STATIC_ASSERT_ENUM(kWebAXRoleDirectory, kDirectoryRole); -STATIC_ASSERT_ENUM(kWebAXRoleDisclosureTriangle, kDisclosureTriangleRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocAbstract, kDocAbstractRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocAcknowledgments, kDocAcknowledgmentsRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocAfterword, kDocAfterwordRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocAppendix, kDocAppendixRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocBackLink, kDocBackLinkRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocBiblioEntry, kDocBiblioEntryRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocBibliography, kDocBibliographyRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocBiblioRef, kDocBiblioRefRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocChapter, kDocChapterRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocColophon, kDocColophonRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocConclusion, kDocConclusionRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocCover, kDocCoverRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocCredit, kDocCreditRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocCredits, kDocCreditsRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocDedication, kDocDedicationRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocEndnote, kDocEndnoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocEndnotes, kDocEndnotesRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocEpigraph, kDocEpigraphRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocEpilogue, kDocEpilogueRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocErrata, kDocErrataRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocExample, kDocExampleRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocFootnote, kDocFootnoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocForeword, kDocForewordRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocGlossary, kDocGlossaryRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocGlossRef, kDocGlossRefRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocIndex, kDocIndexRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocIntroduction, kDocIntroductionRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocNoteRef, kDocNoteRefRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocNotice, kDocNoticeRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPageBreak, kDocPageBreakRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPageList, kDocPageListRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPart, kDocPartRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPreface, kDocPrefaceRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPrologue, kDocPrologueRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocPullquote, kDocPullquoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocQna, kDocQnaRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocSubtitle, kDocSubtitleRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocTip, kDocTipRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocToc, kDocTocRole); -STATIC_ASSERT_ENUM(kWebAXRoleDocument, kDocumentRole); -STATIC_ASSERT_ENUM(kWebAXRoleEmbeddedObject, kEmbeddedObjectRole); -STATIC_ASSERT_ENUM(kWebAXRoleFeed, kFeedRole); -STATIC_ASSERT_ENUM(kWebAXRoleFigcaption, kFigcaptionRole); -STATIC_ASSERT_ENUM(kWebAXRoleFigure, kFigureRole); -STATIC_ASSERT_ENUM(kWebAXRoleFooter, kFooterRole); -STATIC_ASSERT_ENUM(kWebAXRoleForm, kFormRole); -STATIC_ASSERT_ENUM(kWebAXRoleGenericContainer, kGenericContainerRole); -STATIC_ASSERT_ENUM(kWebAXRoleGraphicsDocument, kGraphicsDocumentRole); -STATIC_ASSERT_ENUM(kWebAXRoleGraphicsObject, kGraphicsObjectRole); -STATIC_ASSERT_ENUM(kWebAXRoleGraphicsSymbol, kGraphicsSymbolRole); -STATIC_ASSERT_ENUM(kWebAXRoleGrid, kGridRole); -STATIC_ASSERT_ENUM(kWebAXRoleGroup, kGroupRole); -STATIC_ASSERT_ENUM(kWebAXRoleHeading, kHeadingRole); -STATIC_ASSERT_ENUM(kWebAXRoleIframe, kIframeRole); -STATIC_ASSERT_ENUM(kWebAXRoleIframePresentational, kIframePresentationalRole); -STATIC_ASSERT_ENUM(kWebAXRoleIgnored, kIgnoredRole); -STATIC_ASSERT_ENUM(kWebAXRoleImageMap, kImageMapRole); -STATIC_ASSERT_ENUM(kWebAXRoleImage, kImageRole); -STATIC_ASSERT_ENUM(kWebAXRoleInlineTextBox, kInlineTextBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleInputTime, kInputTimeRole); -STATIC_ASSERT_ENUM(kWebAXRoleLabel, kLabelRole); -STATIC_ASSERT_ENUM(kWebAXRoleLayoutTable, kLayoutTableRole); -STATIC_ASSERT_ENUM(kWebAXRoleLayoutTableCell, kLayoutTableCellRole); -STATIC_ASSERT_ENUM(kWebAXRoleLayoutTableColumn, kLayoutTableColumnRole); -STATIC_ASSERT_ENUM(kWebAXRoleLayoutTableRow, kLayoutTableRowRole); -STATIC_ASSERT_ENUM(kWebAXRoleLegend, kLegendRole); -STATIC_ASSERT_ENUM(kWebAXRoleLineBreak, kLineBreakRole); -STATIC_ASSERT_ENUM(kWebAXRoleLink, kLinkRole); -STATIC_ASSERT_ENUM(kWebAXRoleListBoxOption, kListBoxOptionRole); -STATIC_ASSERT_ENUM(kWebAXRoleListBox, kListBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleListItem, kListItemRole); -STATIC_ASSERT_ENUM(kWebAXRoleListMarker, kListMarkerRole); -STATIC_ASSERT_ENUM(kWebAXRoleList, kListRole); -STATIC_ASSERT_ENUM(kWebAXRoleLog, kLogRole); -STATIC_ASSERT_ENUM(kWebAXRoleMain, kMainRole); -STATIC_ASSERT_ENUM(kWebAXRoleMark, kMarkRole); -STATIC_ASSERT_ENUM(kWebAXRoleMarquee, kMarqueeRole); -STATIC_ASSERT_ENUM(kWebAXRoleMath, kMathRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuBar, kMenuBarRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuButton, kMenuButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuItem, kMenuItemRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuItemCheckBox, kMenuItemCheckBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuItemRadio, kMenuItemRadioRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuListOption, kMenuListOptionRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenuListPopup, kMenuListPopupRole); -STATIC_ASSERT_ENUM(kWebAXRoleMenu, kMenuRole); -STATIC_ASSERT_ENUM(kWebAXRoleMeter, kMeterRole); -STATIC_ASSERT_ENUM(kWebAXRoleNavigation, kNavigationRole); -STATIC_ASSERT_ENUM(kWebAXRoleNone, kNoneRole); -STATIC_ASSERT_ENUM(kWebAXRoleNote, kNoteRole); -STATIC_ASSERT_ENUM(kWebAXRoleParagraph, kParagraphRole); -STATIC_ASSERT_ENUM(kWebAXRolePopUpButton, kPopUpButtonRole); -STATIC_ASSERT_ENUM(kWebAXRolePre, kPreRole); -STATIC_ASSERT_ENUM(kWebAXRolePresentational, kPresentationalRole); -STATIC_ASSERT_ENUM(kWebAXRoleProgressIndicator, kProgressIndicatorRole); -STATIC_ASSERT_ENUM(kWebAXRoleRadioButton, kRadioButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleRadioGroup, kRadioGroupRole); -STATIC_ASSERT_ENUM(kWebAXRoleRegion, kRegionRole); -STATIC_ASSERT_ENUM(kWebAXRoleRowHeader, kRowHeaderRole); -STATIC_ASSERT_ENUM(kWebAXRoleRow, kRowRole); -STATIC_ASSERT_ENUM(kWebAXRoleRuby, kRubyRole); -STATIC_ASSERT_ENUM(kWebAXRoleSVGRoot, kSVGRootRole); -STATIC_ASSERT_ENUM(kWebAXRoleScrollBar, kScrollBarRole); -STATIC_ASSERT_ENUM(kWebAXRoleSearch, kSearchRole); -STATIC_ASSERT_ENUM(kWebAXRoleSearchBox, kSearchBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleSlider, kSliderRole); -STATIC_ASSERT_ENUM(kWebAXRoleSliderThumb, kSliderThumbRole); -STATIC_ASSERT_ENUM(kWebAXRoleSpinButton, kSpinButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleSplitter, kSplitterRole); -STATIC_ASSERT_ENUM(kWebAXRoleStaticText, kStaticTextRole); -STATIC_ASSERT_ENUM(kWebAXRoleStatus, kStatusRole); -STATIC_ASSERT_ENUM(kWebAXRoleSwitch, kSwitchRole); -STATIC_ASSERT_ENUM(kWebAXRoleTabList, kTabListRole); -STATIC_ASSERT_ENUM(kWebAXRoleTabPanel, kTabPanelRole); -STATIC_ASSERT_ENUM(kWebAXRoleTab, kTabRole); -STATIC_ASSERT_ENUM(kWebAXRoleTableHeaderContainer, kTableHeaderContainerRole); -STATIC_ASSERT_ENUM(kWebAXRoleTable, kTableRole); -STATIC_ASSERT_ENUM(kWebAXRoleTerm, kTermRole); -STATIC_ASSERT_ENUM(kWebAXRoleTextField, kTextFieldRole); -STATIC_ASSERT_ENUM(kWebAXRoleTextFieldWithComboBox, kTextFieldWithComboBoxRole); -STATIC_ASSERT_ENUM(kWebAXRoleTime, kTimeRole); -STATIC_ASSERT_ENUM(kWebAXRoleTimer, kTimerRole); -STATIC_ASSERT_ENUM(kWebAXRoleToggleButton, kToggleButtonRole); -STATIC_ASSERT_ENUM(kWebAXRoleToolbar, kToolbarRole); -STATIC_ASSERT_ENUM(kWebAXRoleTreeGrid, kTreeGridRole); -STATIC_ASSERT_ENUM(kWebAXRoleTreeItem, kTreeItemRole); -STATIC_ASSERT_ENUM(kWebAXRoleTree, kTreeRole); -STATIC_ASSERT_ENUM(kWebAXRoleUnknown, kUnknownRole); -STATIC_ASSERT_ENUM(kWebAXRoleUserInterfaceTooltip, kUserInterfaceTooltipRole); -STATIC_ASSERT_ENUM(kWebAXRoleVideo, kVideoRole); -STATIC_ASSERT_ENUM(kWebAXRoleWebArea, kWebAreaRole); - -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kActivate, - AXDefaultActionVerb::kActivate); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kCheck, AXDefaultActionVerb::kCheck); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kClick, AXDefaultActionVerb::kClick); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kClickAncestor, - AXDefaultActionVerb::kClickAncestor); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kJump, AXDefaultActionVerb::kJump); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kOpen, AXDefaultActionVerb::kOpen); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kPress, AXDefaultActionVerb::kPress); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kSelect, - AXDefaultActionVerb::kSelect); -STATIC_ASSERT_ENUM(WebAXDefaultActionVerb::kUncheck, - AXDefaultActionVerb::kUncheck); - -STATIC_ASSERT_ENUM(kWebAXTextDirectionLR, kAccessibilityTextDirectionLTR); -STATIC_ASSERT_ENUM(kWebAXTextDirectionRL, kAccessibilityTextDirectionRTL); -STATIC_ASSERT_ENUM(kWebAXTextDirectionTB, kAccessibilityTextDirectionTTB); -STATIC_ASSERT_ENUM(kWebAXTextDirectionBT, kAccessibilityTextDirectionBTT); - -STATIC_ASSERT_ENUM(kWebAXTextPositionNone, kAXTextPositionNone); -STATIC_ASSERT_ENUM(kWebAXTextPositionSubscript, kAXTextPositionSubscript); -STATIC_ASSERT_ENUM(kWebAXTextPositionSuperscript, kAXTextPositionSuperscript); - -STATIC_ASSERT_ENUM(kWebAXSortDirectionUndefined, kSortDirectionUndefined); -STATIC_ASSERT_ENUM(kWebAXSortDirectionNone, kSortDirectionNone); -STATIC_ASSERT_ENUM(kWebAXSortDirectionAscending, kSortDirectionAscending); -STATIC_ASSERT_ENUM(kWebAXSortDirectionDescending, kSortDirectionDescending); -STATIC_ASSERT_ENUM(kWebAXSortDirectionOther, kSortDirectionOther); - STATIC_ASSERT_ENUM(kWebAXExpandedUndefined, kExpandedUndefined); STATIC_ASSERT_ENUM(kWebAXExpandedCollapsed, kExpandedCollapsed); STATIC_ASSERT_ENUM(kWebAXExpandedExpanded, kExpandedExpanded); @@ -218,54 +23,12 @@ STATIC_ASSERT_ENUM(kWebAXOrientationVertical, STATIC_ASSERT_ENUM(kWebAXOrientationHorizontal, kAccessibilityOrientationHorizontal); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateUndefined, kAriaCurrentStateUndefined); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateFalse, kAriaCurrentStateFalse); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateTrue, kAriaCurrentStateTrue); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStatePage, kAriaCurrentStatePage); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateStep, kAriaCurrentStateStep); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateLocation, kAriaCurrentStateLocation); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateDate, kAriaCurrentStateDate); -STATIC_ASSERT_ENUM(kWebAXAriaCurrentStateTime, kAriaCurrentStateTime); - -STATIC_ASSERT_ENUM(kWebAXHasPopupFalse, kAXHasPopupFalse); -STATIC_ASSERT_ENUM(kWebAXHasPopupTrue, kAXHasPopupTrue); -STATIC_ASSERT_ENUM(kWebAXHasPopupMenu, kAXHasPopupMenu); -STATIC_ASSERT_ENUM(kWebAXHasPopupListbox, kAXHasPopupListbox); -STATIC_ASSERT_ENUM(kWebAXHasPopupTree, kAXHasPopupTree); -STATIC_ASSERT_ENUM(kWebAXHasPopupGrid, kAXHasPopupGrid); -STATIC_ASSERT_ENUM(kWebAXHasPopupDialog, kAXHasPopupDialog); - -STATIC_ASSERT_ENUM(kWebAXInvalidStateUndefined, kInvalidStateUndefined); -STATIC_ASSERT_ENUM(kWebAXInvalidStateFalse, kInvalidStateFalse); -STATIC_ASSERT_ENUM(kWebAXInvalidStateTrue, kInvalidStateTrue); -STATIC_ASSERT_ENUM(kWebAXInvalidStateSpelling, kInvalidStateSpelling); -STATIC_ASSERT_ENUM(kWebAXInvalidStateGrammar, kInvalidStateGrammar); -STATIC_ASSERT_ENUM(kWebAXInvalidStateOther, kInvalidStateOther); - STATIC_ASSERT_ENUM(kWebAXTextStyleNone, kTextStyleNone); STATIC_ASSERT_ENUM(kWebAXTextStyleBold, kTextStyleBold); STATIC_ASSERT_ENUM(kWebAXTextStyleItalic, kTextStyleItalic); STATIC_ASSERT_ENUM(kWebAXTextStyleUnderline, kTextStyleUnderline); STATIC_ASSERT_ENUM(kWebAXTextStyleLineThrough, kTextStyleLineThrough); -STATIC_ASSERT_ENUM(kWebAXNameFromUninitialized, kAXNameFromUninitialized); -STATIC_ASSERT_ENUM(kWebAXNameFromAttribute, kAXNameFromAttribute); -STATIC_ASSERT_ENUM(kWebAXNameFromAttributeExplicitlyEmpty, - kAXNameFromAttributeExplicitlyEmpty); -STATIC_ASSERT_ENUM(kWebAXNameFromCaption, kAXNameFromCaption); -STATIC_ASSERT_ENUM(kWebAXNameFromContents, kAXNameFromContents); -STATIC_ASSERT_ENUM(kWebAXNameFromPlaceholder, kAXNameFromPlaceholder); -STATIC_ASSERT_ENUM(kWebAXNameFromRelatedElement, kAXNameFromRelatedElement); -STATIC_ASSERT_ENUM(kWebAXNameFromValue, kAXNameFromValue); -STATIC_ASSERT_ENUM(kWebAXNameFromTitle, kAXNameFromTitle); - -STATIC_ASSERT_ENUM(kWebAXDescriptionFromUninitialized, - kAXDescriptionFromUninitialized); -STATIC_ASSERT_ENUM(kWebAXDescriptionFromAttribute, kAXDescriptionFromAttribute); -STATIC_ASSERT_ENUM(kWebAXDescriptionFromContents, kAXDescriptionFromContents); -STATIC_ASSERT_ENUM(kWebAXDescriptionFromRelatedElement, - kAXDescriptionFromRelatedElement); - STATIC_ASSERT_ENUM(WebAXStringAttribute::kAriaKeyShortcuts, AXStringAttribute::kAriaKeyShortcuts); STATIC_ASSERT_ENUM(WebAXStringAttribute::kAriaRoleDescription, diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.h index 9bee8cacfae..1619d789722 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_enums.h @@ -9,210 +9,12 @@ namespace blink { -enum AccessibilityRole { - kUnknownRole = 0, // Not mapped in platform APIs, generally indicates a bug - kAbbrRole, // No mapping to ARIA role. - kAlertDialogRole, - kAlertRole, - kAnchorRole, // No mapping to ARIA role. - kAnnotationRole, // No mapping to ARIA role. - kApplicationRole, - kArticleRole, - kAudioRole, // No mapping to ARIA role. - kBannerRole, - kBlockquoteRole, // No mapping to ARIA role. - kButtonRole, - kCanvasRole, // No mapping to ARIA role. - kCaptionRole, // No mapping to ARIA role. - kCellRole, - kCheckBoxRole, - kColorWellRole, // No mapping to ARIA role. - kColumnHeaderRole, - kColumnRole, // No mapping to ARIA role. - kComboBoxGroupingRole, - kComboBoxMenuButtonRole, - kComplementaryRole, - kContentDeletionRole, // ARIA role mapping expected in ARIA v1.2. - kContentInsertionRole, // ARIA role mapping expected in ARIA v1.2. - kContentInfoRole, - kDateRole, // No mapping to ARIA role. - kDateTimeRole, // No mapping to ARIA role. - kDefinitionRole, - kDescriptionListDetailRole, // No mapping to ARIA role. - kDescriptionListRole, // No mapping to ARIA role. - kDescriptionListTermRole, // No mapping to ARIA role. - kDetailsRole, // No mapping to ARIA role. - kDialogRole, - kDirectoryRole, - kDisclosureTriangleRole, // No mapping to ARIA role. - kDocAbstractRole, - kDocAcknowledgmentsRole, - kDocAfterwordRole, - kDocAppendixRole, - // -------------------------------------------------------------- - // DPub Roles: - // https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table - kDocBackLinkRole, - kDocBiblioEntryRole, - kDocBibliographyRole, - kDocBiblioRefRole, - kDocChapterRole, - kDocColophonRole, - kDocConclusionRole, - kDocCoverRole, - kDocCreditRole, - kDocCreditsRole, - kDocDedicationRole, - kDocEndnoteRole, - kDocEndnotesRole, - kDocEpigraphRole, - kDocEpilogueRole, - kDocErrataRole, - kDocExampleRole, - kDocFootnoteRole, - kDocForewordRole, - kDocGlossaryRole, - kDocGlossRefRole, - kDocIndexRole, - kDocIntroductionRole, - kDocNoteRefRole, - kDocNoticeRole, - kDocPageBreakRole, - kDocPageListRole, - kDocPartRole, - kDocPrefaceRole, - kDocPrologueRole, - kDocPullquoteRole, - kDocQnaRole, - kDocSubtitleRole, - kDocTipRole, - kDocTocRole, - // End DPub roles. - // -------------------------------------------------------------- - kDocumentRole, - kEmbeddedObjectRole, // No mapping to ARIA role. - kFeedRole, - kFigcaptionRole, // No mapping to ARIA role. - kFigureRole, - kFooterRole, - kFormRole, - kGenericContainerRole, // No role was defined for this container - // -------------------------------------------------------------- - // ARIA Graphics module roles: - // https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table - kGraphicsDocumentRole, - kGraphicsObjectRole, - kGraphicsSymbolRole, - // End ARIA Graphics module roles. - // -------------------------------------------------------------- - kGridRole, - kGroupRole, - kHeadingRole, - kIframePresentationalRole, // No mapping to ARIA role. - kIframeRole, // No mapping to ARIA role. - kIgnoredRole, // No mapping to ARIA role. - kImageMapRole, // No mapping to ARIA role. - kImageRole, - kInlineTextBoxRole, // No mapping to ARIA role. - kInputTimeRole, // No mapping to ARIA role. - kLabelRole, - kLayoutTableRole, - kLayoutTableCellRole, - kLayoutTableColumnRole, - kLayoutTableRowRole, - kLegendRole, // No mapping to ARIA role. - kLineBreakRole, // No mapping to ARIA role. - kLinkRole, - kListBoxOptionRole, - kListBoxRole, - kListItemRole, - kListMarkerRole, // No mapping to ARIA role. - kListRole, - kLogRole, - kMainRole, - kMarkRole, // No mapping to ARIA role. - kMarqueeRole, - kMathRole, - kMenuBarRole, - kMenuButtonRole, - kMenuItemRole, - kMenuItemCheckBoxRole, - kMenuItemRadioRole, - kMenuListOptionRole, - kMenuListPopupRole, - kMenuRole, - kMeterRole, - kNavigationRole, - kNoneRole, // ARIA role of "none" - kNoteRole, - kParagraphRole, // No mapping to ARIA role. - kPopUpButtonRole, - kPreRole, // No mapping to ARIA role. - kPresentationalRole, - kProgressIndicatorRole, - kRadioButtonRole, - kRadioGroupRole, - kRegionRole, - kRowHeaderRole, - kRowRole, - kRubyRole, // No mapping to ARIA role. - kSVGRootRole, // No mapping to ARIA role. - kScrollBarRole, - kSearchRole, - kSearchBoxRole, - kSliderRole, - kSliderThumbRole, // No mapping to ARIA role. - kSpinButtonRole, - kSplitterRole, - kStaticTextRole, // No mapping to ARIA role. - kStatusRole, - kSwitchRole, - kTabListRole, - kTabPanelRole, - kTabRole, - kTableHeaderContainerRole, // No mapping to ARIA role. - kTableRole, - kTermRole, - kTextFieldRole, - kTextFieldWithComboBoxRole, - kTimeRole, // No mapping to ARIA role. - kTimerRole, - kToggleButtonRole, - kToolbarRole, - kTreeGridRole, - kTreeItemRole, - kTreeRole, - kUserInterfaceTooltipRole, - kVideoRole, // No mapping to ARIA role. - kWebAreaRole, // No mapping to ARIA role. - kNumRoles -}; - enum AccessibilityOrientation { kAccessibilityOrientationUndefined = 0, kAccessibilityOrientationVertical, kAccessibilityOrientationHorizontal, }; -enum class AXDefaultActionVerb { - kNone = 0, - kActivate, - kCheck, - kClick, - - // A click will be performed on one of the object's ancestors. - // This happens when the object itself is not clickable, but one of its - // ancestors has click handlers attached which are able to capture the click - // as it bubbles up. - kClickAncestor, - - kJump, - kOpen, - kPress, - kSelect, - kUncheck -}; - // The input restriction on an object. enum AXRestriction { kNone = 0, // An object that is not disabled. @@ -220,39 +22,6 @@ enum AXRestriction { kDisabled, }; -enum class AXSupportedAction { - kNone = 0, - kActivate, - kCheck, - kClick, - kJump, - kOpen, - kPress, - kSelect, - kUncheck -}; - -enum AccessibilityTextDirection { - kAccessibilityTextDirectionLTR, - kAccessibilityTextDirectionRTL, - kAccessibilityTextDirectionTTB, - kAccessibilityTextDirectionBTT -}; - -enum AXTextPosition { - kAXTextPositionNone = 0, - kAXTextPositionSubscript, - kAXTextPositionSuperscript -}; - -enum SortDirection { - kSortDirectionUndefined = 0, - kSortDirectionNone, - kSortDirectionAscending, - kSortDirectionDescending, - kSortDirectionOther -}; - enum AccessibilityExpanded { kExpandedUndefined = 0, kExpandedCollapsed, @@ -265,36 +34,6 @@ enum AccessibilitySelectedState { kSelectedStateTrue, }; -enum AriaCurrentState { - kAriaCurrentStateUndefined = 0, - kAriaCurrentStateFalse, - kAriaCurrentStateTrue, - kAriaCurrentStatePage, - kAriaCurrentStateStep, - kAriaCurrentStateLocation, - kAriaCurrentStateDate, - kAriaCurrentStateTime -}; - -enum AXHasPopup { - kAXHasPopupFalse = 0, - kAXHasPopupTrue, - kAXHasPopupMenu, - kAXHasPopupListbox, - kAXHasPopupTree, - kAXHasPopupGrid, - kAXHasPopupDialog -}; - -enum InvalidState { - kInvalidStateUndefined = 0, - kInvalidStateFalse, - kInvalidStateTrue, - kInvalidStateSpelling, - kInvalidStateGrammar, - kInvalidStateOther -}; - enum TextStyle { kTextStyleNone = 0, kTextStyleBold = 1 << 0, @@ -323,44 +62,12 @@ enum class AXObjectVectorAttribute { kAriaFlowTo, }; -// The source of the accessible name of an element. This is needed -// because on some platforms this determines how the accessible name -// is exposed. -enum AXNameFrom { - kAXNameFromUninitialized = -1, - kAXNameFromAttribute = 0, - kAXNameFromAttributeExplicitlyEmpty, - kAXNameFromCaption, - kAXNameFromContents, - kAXNameFromPlaceholder, - kAXNameFromRelatedElement, - kAXNameFromValue, - kAXNameFromTitle, -}; - -// The source of the accessible description of an element. This is needed -// because on some platforms this determines how the accessible description -// is exposed. -enum AXDescriptionFrom { - kAXDescriptionFromUninitialized = -1, - kAXDescriptionFromAttribute = 0, - kAXDescriptionFromContents, - kAXDescriptionFromRelatedElement, -}; - enum AXObjectInclusion { kIncludeObject, kIgnoreObject, kDefaultBehavior, }; -enum AccessibilityCheckedState { - kCheckedStateUndefined = 0, - kCheckedStateFalse, - kCheckedStateTrue, - kCheckedStateMixed -}; - enum AccessibilityOptionalBool { kOptionalBoolUndefined = 0, kOptionalBoolTrue, @@ -395,7 +102,7 @@ enum AXIgnoredReason { kAXLabelFor, kAXNotRendered, kAXNotVisible, - kAXPresentationalRole, + kAXPresentational, kAXProbablyPresentational, kAXStaticTextUsedAsNameFor, kAXUninteresting diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc index a3025d4e553..3a1dde79006 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc @@ -68,13 +68,13 @@ AXObject* AXImageMapLink::ComputeParent() const { return AXObjectCache().GetOrCreate(MapElement()->GetLayoutObject()); } -AccessibilityRole AXImageMapLink::RoleValue() const { +ax::mojom::Role AXImageMapLink::RoleValue() const { const AtomicString& aria_role = GetAOMPropertyOrARIAAttribute(AOMStringProperty::kRole); if (!aria_role.IsEmpty()) return AXObject::AriaRoleToWebCoreRole(aria_role); - return kLinkRole; + return ax::mojom::Role::kLink; } bool AXImageMapLink::ComputeAccessibilityIsIgnored( diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h index 75084f36967..0f6fe6d99b6 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h @@ -51,7 +51,7 @@ class AXImageMapLink final : public AXNodeObject { HTMLMapElement* MapElement() const; - AccessibilityRole RoleValue() const override; + ax::mojom::Role RoleValue() const override; bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; Element* AnchorElement() const override; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc index 2a3837fb577..cc2f3aaa45f 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc @@ -128,12 +128,12 @@ void AXInlineTextBox::GetWordBoundaries(Vector& words) const { } } -String AXInlineTextBox::GetName(AXNameFrom& name_from, +String AXInlineTextBox::GetName(ax::mojom::NameFrom& name_from, AXObject::AXObjectVector* name_objects) const { if (!inline_text_box_) return String(); - name_from = kAXNameFromContents; + name_from = ax::mojom::NameFrom::kContents; return inline_text_box_->GetText(); } @@ -149,19 +149,19 @@ AXObject* AXInlineTextBox::ComputeParent() const { // In addition to LTR and RTL direction, edit fields also support // top to bottom and bottom to top via the CSS writing-mode property. -AccessibilityTextDirection AXInlineTextBox::GetTextDirection() const { +ax::mojom::TextDirection AXInlineTextBox::GetTextDirection() const { if (!inline_text_box_) return AXObject::GetTextDirection(); switch (inline_text_box_->GetDirection()) { case AbstractInlineTextBox::kLeftToRight: - return kAccessibilityTextDirectionLTR; + return ax::mojom::TextDirection::kLtr; case AbstractInlineTextBox::kRightToLeft: - return kAccessibilityTextDirectionRTL; + return ax::mojom::TextDirection::kRtl; case AbstractInlineTextBox::kTopToBottom: - return kAccessibilityTextDirectionTTB; + return ax::mojom::TextDirection::kTtb; case AbstractInlineTextBox::kBottomToTop: - return kAccessibilityTextDirectionBTT; + return ax::mojom::TextDirection::kBtt; } return AXObject::GetTextDirection(); diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h index 7e39dc6ffb9..8d0dfdb5c68 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h @@ -53,8 +53,10 @@ class AXInlineTextBox final : public AXObject { bool IsAXInlineTextBox() const override { return true; } public: - AccessibilityRole RoleValue() const override { return kInlineTextBoxRole; } - String GetName(AXNameFrom&, + ax::mojom::Role RoleValue() const override { + return ax::mojom::Role::kInlineTextBox; + } + String GetName(ax::mojom::NameFrom&, AXObject::AXObjectVector* name_objects) const override; void TextCharacterOffsets(Vector&) const override; void GetWordBoundaries(Vector&) const override; @@ -63,7 +65,7 @@ class AXInlineTextBox final : public AXObject { SkMatrix44& out_container_transform, bool* clips_children = nullptr) const override; AXObject* ComputeParent() const override; - AccessibilityTextDirection GetTextDirection() const override; + ax::mojom::TextDirection GetTextDirection() const override; Node* GetNode() const override; AXObject* NextOnLine() const override; AXObject* PreviousOnLine() const override; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc index 83d3bc2792d..c61588ea1d9 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc @@ -284,70 +284,74 @@ static bool IsImageOrAltText(LayoutBoxModelObject* box, Node* node) { return false; } -AccessibilityRole AXLayoutObject::NativeAccessibilityRoleIgnoringAria() const { +ax::mojom::Role AXLayoutObject::NativeRoleIgnoringAria() const { Node* node = layout_object_->GetNode(); LayoutBoxModelObject* css_box = GetLayoutBoxModelObject(); if ((css_box && css_box->IsListItem()) || IsHTMLLIElement(node)) - return kListItemRole; + return ax::mojom::Role::kListItem; if (layout_object_->IsListMarkerIncludingNG()) - return kListMarkerRole; + return ax::mojom::Role::kListMarker; if (layout_object_->IsBR()) - return kLineBreakRole; + return ax::mojom::Role::kLineBreak; if (layout_object_->IsText()) - return kStaticTextRole; - if (layout_object_->IsTable() && node) - return IsDataTable() ? kTableRole : kLayoutTableRole; + return ax::mojom::Role::kStaticText; + if (layout_object_->IsTable() && node) { + return IsDataTable() ? ax::mojom::Role::kTable + : ax::mojom::Role::kLayoutTable; + } if (layout_object_->IsTableRow() && node) return DetermineTableRowRole(); if (layout_object_->IsTableCell() && node) return DetermineTableCellRole(); if (css_box && IsImageOrAltText(css_box, node)) { if (node && node->IsLink()) - return kImageMapRole; + return ax::mojom::Role::kImageMap; if (IsHTMLInputElement(node)) return ButtonRoleType(); if (IsSVGImage()) - return kSVGRootRole; + return ax::mojom::Role::kSvgRoot; - return kImageRole; + return ax::mojom::Role::kImage; } if (IsHTMLCanvasElement(node)) - return kCanvasRole; + return ax::mojom::Role::kCanvas; if (css_box && css_box->IsLayoutView()) - return kWebAreaRole; + return ax::mojom::Role::kRootWebArea; if (layout_object_->IsSVGImage()) - return kImageRole; + return ax::mojom::Role::kImage; if (layout_object_->IsSVGRoot()) - return kSVGRootRole; + return ax::mojom::Role::kSvgRoot; // Table sections should be ignored. if (layout_object_->IsTableSection()) - return kIgnoredRole; + return ax::mojom::Role::kIgnored; if (layout_object_->IsHR()) - return kSplitterRole; + return ax::mojom::Role::kSplitter; - return AXNodeObject::NativeAccessibilityRoleIgnoringAria(); + return AXNodeObject::NativeRoleIgnoringAria(); } -AccessibilityRole AXLayoutObject::DetermineAccessibilityRole() { +ax::mojom::Role AXLayoutObject::DetermineAccessibilityRole() { if (!layout_object_) - return kUnknownRole; + return ax::mojom::Role::kUnknown; - native_role_ = NativeAccessibilityRoleIgnoringAria(); + native_role_ = NativeRoleIgnoringAria(); - if ((aria_role_ = DetermineAriaRoleAttribute()) != kUnknownRole) + if ((aria_role_ = DetermineAriaRoleAttribute()) != ax::mojom::Role::kUnknown) return aria_role_; // Anything that needs to still be exposed but doesn't have a more specific // role should be considered a generic container. Examples are // layout blocks with no node, in-page link targets, and plain elements // such as a with ARIA markup. - return native_role_ == kUnknownRole ? kGenericContainerRole : native_role_; + return native_role_ == ax::mojom::Role::kUnknown + ? ax::mojom::Role::kGenericContainer + : native_role_; } Node* AXLayoutObject::GetNodeOrContainingBlockNode() const { @@ -396,13 +400,28 @@ bool AXLayoutObject::IsEditable() const { if (IsDetached()) return false; - if (GetLayoutObject()->IsTextControl()) - return true; - const Node* node = GetNodeOrContainingBlockNode(); if (!node) return false; + // TODO(accessibility) pursue standards track so that aria-goog-editable + // becomes aria-editable. At that time, create ariaEditableAttr in + // html_element.cc. The current version of the editable attribute does not + // inherit, in order to match the automatic Gecko implementation, but + // hopefully the standardized version will, in which case a more performant + // implementation will be required, e.g. cache it or only expose on ancestor, + // having browser-side propagate it. + const Element* elem = node->IsElementNode() + ? ToElement(node) + : FlatTreeTraversal::ParentElement(*node); + if (elem && elem->hasAttribute("aria-goog-editable")) { + auto editable = elem->getAttribute("aria-goog-editable"); + return !EqualIgnoringASCIICase("false", editable); + } + + if (GetLayoutObject()->IsTextControl()) + return true; + if (HasEditableStyle(*node)) return true; @@ -430,6 +449,21 @@ bool AXLayoutObject::IsRichlyEditable() const { if (!node) return false; + // TODO(accessibility) pursue standards track so that aria-goog-editable + // becomes aria-editable. At that time, create ariaEditableAttr in + // html_element.cc. The current version of the editable attribute does not + // inherit, in order to match the automatic Gecko implementation, but + // hopefully the standardized version will, in which case a more performant + // implementation will be required, e.g. cache it or only expose on ancestor, + // having browser-side propagate it. + const Element* elem = node->IsElementNode() + ? ToElement(node) + : FlatTreeTraversal::ParentElement(*node); + if (elem && elem->hasAttribute("aria-goog-editable")) { + auto editable = elem->getAttribute("aria-goog-editable"); + return !EqualIgnoringASCIICase("false", editable); + } + if (HasRichlyEditableStyle(*node)) return true; @@ -463,7 +497,7 @@ bool AXLayoutObject::IsLoaded() const { bool AXLayoutObject::IsOffScreen() const { DCHECK(layout_object_); IntRect content_rect = - PixelSnappedIntRect(layout_object_->AbsoluteVisualRect()); + PixelSnappedIntRect(layout_object_->VisualRectInDocument()); LocalFrameView* view = layout_object_->GetFrame()->View(); IntRect view_rect(IntPoint(), view->Size()); view_rect.Intersect(content_rect); @@ -496,7 +530,7 @@ bool AXLayoutObject::IsFocused() const { // A web area is represented by the Document node in the DOM tree, which isn't // focusable. Check instead if the frame's selection controller is focused if (focused_object == this || - (RoleValue() == kWebAreaRole && + (RoleValue() == ax::mojom::Role::kRootWebArea && GetDocument()->GetFrame()->Selection().FrameIsFocusedAndActive())) return true; @@ -595,6 +629,30 @@ static bool HasLineBox(const LayoutBlockFlow& block_flow) { return false; } +// Is this the anonymous placeholder for a text control? +bool AXLayoutObject::IsPlaceholder() const { + AXObject* parent_object = ParentObject(); + if (!parent_object) + return false; + + LayoutObject* parent_layout_object = parent_object->GetLayoutObject(); + if (!parent_layout_object || !parent_layout_object->IsTextControl()) + return false; + + LayoutTextControl* layout_text_control = + ToLayoutTextControl(parent_layout_object); + DCHECK(layout_text_control); + + TextControlElement* text_control_element = + layout_text_control->GetTextControlElement(); + if (!text_control_element) + return false; + + HTMLElement* placeholder_element = text_control_element->PlaceholderElement(); + + return GetElement() == static_cast(placeholder_element); +} + bool AXLayoutObject::ComputeAccessibilityIsIgnored( IgnoredReasons* ignored_reasons) const { #if DCHECK_IS_ON() @@ -625,7 +683,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( return true; } - if (RoleValue() == kIgnoredRole) { + if (RoleValue() == ax::mojom::Role::kIgnored) { if (ignored_reasons) ignored_reasons->push_back(IgnoredReason(kAXUninteresting)); return true; @@ -635,7 +693,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (ignored_reasons) { const AXObject* inherits_from = InheritsPresentationalRoleFrom(); if (inherits_from == this) - ignored_reasons->push_back(IgnoredReason(kAXPresentationalRole)); + ignored_reasons->push_back(IgnoredReason(kAXPresentational)); else ignored_reasons->push_back( IgnoredReason(kAXInheritsPresentation, inherits_from)); @@ -653,8 +711,18 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( // Make sure renderers with layers stay in the tree. if (GetLayoutObject() && GetLayoutObject()->HasLayer() && GetNode() && - GetNode()->hasChildren()) + GetNode()->hasChildren()) { + if (IsPlaceholder()) { + // Placeholder is already exposed via AX attributes, do not expose as + // child of text input. Therefore, if there is a child of a text input, + // it will contain the value. + if (ignored_reasons) + ignored_reasons->push_back(IgnoredReason(kAXPresentational)); + return true; + } + return false; + } // Find out if this element is inside of a label element. If so, it may be // ignored because it's the label for a checkbox or radio button. @@ -688,8 +756,8 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( // A click handler might be placed on an otherwise ignored non-empty block // element, e.g. a div. We shouldn't ignore such elements because if an AT - // sees the |AXDefaultActionVerb::kClickAncestor|, it will look for the - // clickable ancestor and it expects to find one. + // sees the |ax::mojom::DefaultActionVerb::kClickAncestor|, it will look for + // the clickable ancestor and it expects to find one. if (IsClickable()) return false; @@ -718,7 +786,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (IsControl()) return false; - if (AriaRoleAttribute() != kUnknownRole) + if (AriaRoleAttribute() != ax::mojom::Role::kUnknown) return false; // don't ignore labels, because they serve as TitleUIElements @@ -733,58 +801,58 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (HasContentEditableAttributeSet()) return false; - if (RoleValue() == kAbbrRole) + if (RoleValue() == ax::mojom::Role::kAbbr) return false; // List items play an important role in defining the structure of lists. They // should not be ignored. - if (RoleValue() == kListItemRole) + if (RoleValue() == ax::mojom::Role::kListItem) return false; - if (RoleValue() == kBlockquoteRole) + if (RoleValue() == ax::mojom::Role::kBlockquote) return false; - if (RoleValue() == kDialogRole) + if (RoleValue() == ax::mojom::Role::kDialog) return false; - if (RoleValue() == kFigcaptionRole) + if (RoleValue() == ax::mojom::Role::kFigcaption) return false; - if (RoleValue() == kFigureRole) + if (RoleValue() == ax::mojom::Role::kFigure) return false; - if (RoleValue() == kContentDeletionRole) + if (RoleValue() == ax::mojom::Role::kContentDeletion) return false; - if (RoleValue() == kContentInsertionRole) + if (RoleValue() == ax::mojom::Role::kContentInsertion) return false; - if (RoleValue() == kDetailsRole) + if (RoleValue() == ax::mojom::Role::kDetails) return false; - if (RoleValue() == kMarkRole) + if (RoleValue() == ax::mojom::Role::kMark) return false; - if (RoleValue() == kMathRole) + if (RoleValue() == ax::mojom::Role::kMath) return false; - if (RoleValue() == kMeterRole) + if (RoleValue() == ax::mojom::Role::kMeter) return false; - if (RoleValue() == kRubyRole) + if (RoleValue() == ax::mojom::Role::kRuby) return false; - if (RoleValue() == kSplitterRole) + if (RoleValue() == ax::mojom::Role::kSplitter) return false; - if (RoleValue() == kTimeRole) + if (RoleValue() == ax::mojom::Role::kTime) return false; - if (RoleValue() == kProgressIndicatorRole) + if (RoleValue() == ax::mojom::Role::kProgressIndicator) return false; // if this element has aria attributes on it, it should not be ignored. - if (SupportsARIAAttributes()) + if (HasGlobalARIAAttribute()) return false; if (IsImage()) @@ -837,6 +905,14 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (layout_object_->IsPositioned()) return false; + // Inner editor element of editable area with empty text provides bounds + // used to compute the character extent for index 0. This is the same as + // what the caret's bounds would be if the editable area is focused. + if (ParentObject() && ParentObject()->GetLayoutObject() && + ParentObject()->GetLayoutObject()->IsTextControl()) { + return false; + } + // Ignore layout objects that are block flows with inline children. These // are usually dummy layout objects that pad out the tree, but there are // some exceptions below. @@ -868,9 +944,10 @@ bool AXLayoutObject::HasAriaCellRole(Element* elem) const { if (aria_role_str.IsEmpty()) return false; - AccessibilityRole aria_role = AriaRoleToWebCoreRole(aria_role_str); - return aria_role == kCellRole || aria_role == kColumnHeaderRole || - aria_role == kRowHeaderRole; + ax::mojom::Role aria_role = AriaRoleToWebCoreRole(aria_role_str); + return aria_role == ax::mojom::Role::kCell || + aria_role == ax::mojom::Role::kColumnHeader || + aria_role == ax::mojom::Role::kRowHeader; } // Return true if whitespace is not necessary to keep adjacent_node separate @@ -1118,7 +1195,8 @@ String AXLayoutObject::ImageDataUrl(const IntSize& max_size) const { SkImageInfo info = SkImageInfo::Make(width, height, kRGBA_8888_SkColorType, kUnpremul_SkAlphaType); size_t row_bytes = info.minRowBytes(); - Vector pixel_storage(info.computeByteSize(row_bytes)); + Vector pixel_storage( + SafeCast(info.computeByteSize(row_bytes))); SkPixmap pixmap(info, pixel_storage.data(), row_bytes); if (!SkImage::MakeFromBitmap(bitmap)->readPixels(pixmap, 0, 0)) return String(); @@ -1171,7 +1249,7 @@ String AXLayoutObject::GetText() const { return AXNodeObject::GetText(); } -AccessibilityTextDirection AXLayoutObject::GetTextDirection() const { +ax::mojom::TextDirection AXLayoutObject::GetTextDirection() const { if (!GetLayoutObject()) return AXNodeObject::GetTextDirection(); @@ -1182,23 +1260,23 @@ AccessibilityTextDirection AXLayoutObject::GetTextDirection() const { if (style->IsHorizontalWritingMode()) { switch (style->Direction()) { case TextDirection::kLtr: - return kAccessibilityTextDirectionLTR; + return ax::mojom::TextDirection::kLtr; case TextDirection::kRtl: - return kAccessibilityTextDirectionRTL; + return ax::mojom::TextDirection::kRtl; } } else { switch (style->Direction()) { case TextDirection::kLtr: - return kAccessibilityTextDirectionTTB; + return ax::mojom::TextDirection::kTtb; case TextDirection::kRtl: - return kAccessibilityTextDirectionBTT; + return ax::mojom::TextDirection::kBtt; } } return AXNodeObject::GetTextDirection(); } -AXTextPosition AXLayoutObject::GetTextPosition() const { +ax::mojom::TextPosition AXLayoutObject::GetTextPosition() const { if (!GetLayoutObject()) return AXNodeObject::GetTextPosition(); @@ -1217,9 +1295,9 @@ AXTextPosition AXLayoutObject::GetTextPosition() const { case EVerticalAlign::kLength: return AXNodeObject::GetTextPosition(); case EVerticalAlign::kSub: - return kAXTextPositionSubscript; + return ax::mojom::TextPosition::kSubscript; case EVerticalAlign::kSuper: - return kAXTextPositionSuperscript; + return ax::mojom::TextPosition::kSuperscript; } } @@ -1505,7 +1583,7 @@ String AXLayoutObject::StringValue() const { String AXLayoutObject::TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { if (layout_object_) { @@ -1546,7 +1624,7 @@ String AXLayoutObject::TextAlternative(bool recursive, } if (found_text_alternative) { - name_from = kAXNameFromContents; + name_from = ax::mojom::NameFrom::kContents; if (name_sources) { name_sources->push_back(NameSource(false)); name_sources->back().type = name_from; @@ -1575,24 +1653,24 @@ void AXLayoutObject::AriaDescribedbyElements( describedby); } -AXHasPopup AXLayoutObject::HasPopup() const { +ax::mojom::HasPopup AXLayoutObject::HasPopup() const { const AtomicString& has_popup = GetAOMPropertyOrARIAAttribute(AOMStringProperty::kHasPopUp); if (!has_popup.IsNull()) { if (EqualIgnoringASCIICase(has_popup, "false")) - return kAXHasPopupFalse; + return ax::mojom::HasPopup::kFalse; if (EqualIgnoringASCIICase(has_popup, "listbox")) - return kAXHasPopupListbox; + return ax::mojom::HasPopup::kListbox; if (EqualIgnoringASCIICase(has_popup, "tree")) - return kAXHasPopupTree; + return ax::mojom::HasPopup::kTree; if (EqualIgnoringASCIICase(has_popup, "grid")) - return kAXHasPopupGrid; + return ax::mojom::HasPopup::kGrid; if (EqualIgnoringASCIICase(has_popup, "dialog")) - return kAXHasPopupDialog; + return ax::mojom::HasPopup::kDialog; // To provide backward compatibility with ARIA 1.0 content, // user agents MUST treat an aria-haspopup value of true @@ -1600,13 +1678,13 @@ AXHasPopup AXLayoutObject::HasPopup() const { // And unknown value also return menu too. if (EqualIgnoringASCIICase(has_popup, "true") || EqualIgnoringASCIICase(has_popup, "menu") || !has_popup.IsEmpty()) - return kAXHasPopupMenu; + return ax::mojom::HasPopup::kMenu; } // ARIA 1.1 default value of haspopup for combobox is "listbox". - if (RoleValue() == kComboBoxMenuButtonRole || - RoleValue() == kTextFieldWithComboBoxRole) - return kAXHasPopupListbox; + if (RoleValue() == ax::mojom::Role::kComboBoxMenuButton || + RoleValue() == ax::mojom::Role::kTextFieldWithComboBox) + return ax::mojom::HasPopup::kListbox; return AXObject::HasPopup(); } @@ -1654,13 +1732,13 @@ const AtomicString& AXLayoutObject::LiveRegionStatus() const { // These roles have implicit live region status. if (live_region_status.IsEmpty()) { switch (RoleValue()) { - case kAlertRole: + case ax::mojom::Role::kAlert: return live_region_status_assertive; - case kLogRole: - case kStatusRole: + case ax::mojom::Role::kLog: + case ax::mojom::Role::kStatus: return live_region_status_polite; - case kTimerRole: - case kMarqueeRole: + case ax::mojom::Role::kTimer: + case ax::mojom::Role::kMarquee: return live_region_status_off; default: break; @@ -1760,12 +1838,12 @@ AXObject* AXLayoutObject::ComputeParent() const { if (!layout_object_) return nullptr; - if (AriaRoleAttribute() == kMenuBarRole) + if (AriaRoleAttribute() == ax::mojom::Role::kMenuBar) return AXObjectCache().GetOrCreate(layout_object_->Parent()); // menuButton and its corresponding menu are DOM siblings, but Accessibility // needs them to be parent/child. - if (AriaRoleAttribute() == kMenuRole) { + if (AriaRoleAttribute() == ax::mojom::Role::kMenu) { AXObject* parent = MenuButtonForMenu(); if (parent) return parent; @@ -1788,12 +1866,12 @@ AXObject* AXLayoutObject::ComputeParentIfExists() const { if (!layout_object_) return nullptr; - if (AriaRoleAttribute() == kMenuBarRole) + if (AriaRoleAttribute() == ax::mojom::Role::kMenuBar) return AXObjectCache().Get(layout_object_->Parent()); // menuButton and its corresponding menu are DOM siblings, but Accessibility // needs them to be parent/child. - if (AriaRoleAttribute() == kMenuRole) { + if (AriaRoleAttribute() == ax::mojom::Role::kMenu) { AXObject* parent = MenuButtonForMenuIfExists(); if (parent) return parent; @@ -2414,7 +2492,7 @@ void AXLayoutObject::HandleActiveDescendantChanged() { return; AXObject* focused_object = AXObjectCache().FocusedObject(); - if (focused_object == this && SupportsARIAActiveDescendant()) { + if (focused_object == this) { AXObject* active_descendant = ActiveDescendant(); if (active_descendant && active_descendant->IsSelectedFromFocus()) { // In single selection containers, selection follows focus, so a selection @@ -2423,8 +2501,10 @@ void AXLayoutObject::HandleActiveDescendantChanged() { // the user navigates through the items. AXObjectCache().HandleAriaSelectedChanged(active_descendant->GetNode()); } - AXObjectCache().PostNotification( - GetLayoutObject(), AXObjectCacheImpl::kAXActiveDescendantChanged); + + // Mark this node dirty. AXEventGenerator will automatically infer + // that the active descendant changed. + AXObjectCache().MarkAXObjectDirty(this, false); } } @@ -2435,11 +2515,11 @@ void AXLayoutObject::HandleAriaExpandedChanged() { bool found_parent = false; switch (container_parent->RoleValue()) { - case kLayoutTableRole: - case kTreeRole: - case kTreeGridRole: - case kGridRole: - case kTableRole: + case ax::mojom::Role::kLayoutTable: + case ax::mojom::Role::kTree: + case ax::mojom::Role::kTreeGrid: + case ax::mojom::Role::kGrid: + case ax::mojom::Role::kTable: found_parent = true; break; default: @@ -2453,25 +2533,25 @@ void AXLayoutObject::HandleAriaExpandedChanged() { } // Post that the row count changed. - if (container_parent) + if (container_parent) { AXObjectCache().PostNotification(container_parent, - AXObjectCacheImpl::kAXRowCountChanged); + ax::mojom::Event::kRowCountChanged); + } // Post that the specific row either collapsed or expanded. AccessibilityExpanded expanded = IsExpanded(); if (!expanded) return; - if (RoleValue() == kRowRole || RoleValue() == kTreeItemRole) { - AXObjectCacheImpl::AXNotification notification = - AXObjectCacheImpl::kAXRowExpanded; + if (RoleValue() == ax::mojom::Role::kRow || + RoleValue() == ax::mojom::Role::kTreeItem) { + ax::mojom::Event notification = ax::mojom::Event::kRowExpanded; if (expanded == kExpandedCollapsed) - notification = AXObjectCacheImpl::kAXRowCollapsed; + notification = ax::mojom::Event::kRowCollapsed; AXObjectCache().PostNotification(this, notification); } else { - AXObjectCache().PostNotification(this, - AXObjectCacheImpl::kAXExpandedChanged); + AXObjectCache().PostNotification(this, ax::mojom::Event::kExpandedChanged); } } @@ -2481,7 +2561,7 @@ void AXLayoutObject::HandleAutofillStateChanged(bool is_available) { // Reusing the value change event in order to invalidate, even though the // value did not necessarily change. // TODO(dmazzoni) change to using a MarkDirty() API. - AXObjectCache().PostNotification(this, AXObjectCacheImpl::kAXValueChanged); + AXObjectCache().PostNotification(this, ax::mojom::Event::kValueChanged); } } @@ -2491,7 +2571,7 @@ void AXLayoutObject::TextChanged() { Settings* settings = GetDocument()->GetSettings(); if (settings && settings->GetInlineTextBoxAccessibilityEnabled() && - RoleValue() == kStaticTextRole) + RoleValue() == ax::mojom::Role::kStaticText) ChildrenChanged(); // Do this last - AXNodeObject::textChanged posts live region announcements, @@ -2632,7 +2712,8 @@ void AXLayoutObject::LineBreaks(Vector& line_breaks) const { } // The following is a heuristic used to determine if a -// should be with kTableRole or kLayoutTableRole. +//
should be with ax::mojom::Role::kTable or +// ax::mojom::Role::kLayoutTable. bool AXLayoutObject::IsDataTable() const { if (!layout_object_ || !GetNode()) return false; @@ -2840,7 +2921,7 @@ bool AXLayoutObject::IsDataTable() const { } unsigned AXLayoutObject::ColumnCount() const { - if (AriaRoleAttribute() != kUnknownRole) + if (AriaRoleAttribute() != ax::mojom::Role::kUnknown) return AXNodeObject::ColumnCount(); LayoutObject* layout_object = GetLayoutObject(); @@ -2857,7 +2938,7 @@ unsigned AXLayoutObject::ColumnCount() const { } unsigned AXLayoutObject::RowCount() const { - if (AriaRoleAttribute() != kUnknownRole) + if (AriaRoleAttribute() != ax::mojom::Role::kUnknown) return AXNodeObject::RowCount(); LayoutObject* layout_object = GetLayoutObject(); @@ -2954,99 +3035,100 @@ unsigned AXLayoutObject::RowSpan() const { return cell->ResolvedRowSpan(); } -SortDirection AXLayoutObject::GetSortDirection() const { - if (RoleValue() != kRowHeaderRole && RoleValue() != kColumnHeaderRole) - return kSortDirectionUndefined; +ax::mojom::SortDirection AXLayoutObject::GetSortDirection() const { + if (RoleValue() != ax::mojom::Role::kRowHeader && + RoleValue() != ax::mojom::Role::kColumnHeader) + return ax::mojom::SortDirection::kNone; const AtomicString& aria_sort = GetAOMPropertyOrARIAAttribute(AOMStringProperty::kSort); if (aria_sort.IsEmpty()) - return kSortDirectionUndefined; + return ax::mojom::SortDirection::kNone; if (EqualIgnoringASCIICase(aria_sort, "none")) - return kSortDirectionNone; + return ax::mojom::SortDirection::kNone; if (EqualIgnoringASCIICase(aria_sort, "ascending")) - return kSortDirectionAscending; + return ax::mojom::SortDirection::kAscending; if (EqualIgnoringASCIICase(aria_sort, "descending")) - return kSortDirectionDescending; + return ax::mojom::SortDirection::kDescending; // Technically, illegal values should be exposed as is, but this does // not seem to be worth the implementation effort at this time. - return kSortDirectionOther; + return ax::mojom::SortDirection::kOther; } -static AccessibilityRole DecideRoleFromSibling(LayoutTableCell* sibling_cell) { +static ax::mojom::Role DecideRoleFromSibling(LayoutTableCell* sibling_cell) { if (!sibling_cell) - return kCellRole; + return ax::mojom::Role::kCell; if (Node* sibling_node = sibling_cell->GetNode()) { if (sibling_node->HasTagName(thTag)) - return kColumnHeaderRole; + return ax::mojom::Role::kColumnHeader; if (sibling_node->HasTagName(tdTag)) - return kRowHeaderRole; + return ax::mojom::Role::kRowHeader; } - return kCellRole; + return ax::mojom::Role::kCell; } -AccessibilityRole AXLayoutObject::DetermineTableRowRole() const { +ax::mojom::Role AXLayoutObject::DetermineTableRowRole() const { AXObject* parent = ParentObjectUnignored(); if (!parent) - return kGenericContainerRole; + return ax::mojom::Role::kGenericContainer; - if (parent->RoleValue() == kLayoutTableRole) - return kLayoutTableRowRole; + if (parent->RoleValue() == ax::mojom::Role::kLayoutTable) + return ax::mojom::Role::kLayoutTableRow; if (parent->IsTableLikeRole()) - return kRowRole; + return ax::mojom::Role::kRow; - return kGenericContainerRole; + return ax::mojom::Role::kGenericContainer; } -AccessibilityRole AXLayoutObject::DetermineTableCellRole() const { +ax::mojom::Role AXLayoutObject::DetermineTableCellRole() const { DCHECK(layout_object_); AXObject* parent = ParentObjectUnignored(); if (!parent || !parent->IsTableRowLikeRole()) - return kGenericContainerRole; + return ax::mojom::Role::kGenericContainer; AXObject* grandparent = parent->ParentObjectUnignored(); if (!grandparent || !grandparent->IsTableLikeRole()) - return kGenericContainerRole; + return ax::mojom::Role::kGenericContainer; - if (parent->RoleValue() == kLayoutTableRowRole) - return kLayoutTableCellRole; + if (parent->RoleValue() == ax::mojom::Role::kLayoutTableRow) + return ax::mojom::Role::kLayoutTableCell; if (!parent->IsTableRowLikeRole()) - return kGenericContainerRole; + return ax::mojom::Role::kGenericContainer; if (!GetNode() || !GetNode()->HasTagName(thTag)) - return kCellRole; + return ax::mojom::Role::kCell; const AtomicString& scope = GetAttribute(scopeAttr); if (EqualIgnoringASCIICase(scope, "row") || EqualIgnoringASCIICase(scope, "rowgroup")) - return kRowHeaderRole; + return ax::mojom::Role::kRowHeader; if (EqualIgnoringASCIICase(scope, "col") || EqualIgnoringASCIICase(scope, "colgroup")) - return kColumnHeaderRole; + return ax::mojom::Role::kColumnHeader; // Check the previous cell and the next cell on the same row. LayoutTableCell* layout_cell = ToLayoutTableCell(layout_object_); - AccessibilityRole header_role = kCellRole; + ax::mojom::Role header_role = ax::mojom::Role::kCell; // if header is preceded by header cells on the same row, then it is a // column header. If it is preceded by other cells then it's a row header. if ((header_role = DecideRoleFromSibling(layout_cell->PreviousCell())) != - kCellRole) + ax::mojom::Role::kCell) return header_role; // if header is followed by header cells on the same row, then it is a // column header. If it is followed by other cells then it's a row header. if ((header_role = DecideRoleFromSibling(layout_cell->NextCell())) != - kCellRole) + ax::mojom::Role::kCell) return header_role; // If there are no other cells on that row, then it is a column header. - return kColumnHeaderRole; + return ax::mojom::Role::kColumnHeader; } AXObject* AXLayoutObject::CellForColumnAndRow(unsigned target_column_index, @@ -3098,7 +3180,7 @@ AXObject* AXLayoutObject::CellForColumnAndRow(unsigned target_column_index, return nullptr; } -bool AXLayoutObject::FindAllTableCellsWithRole(AccessibilityRole role, +bool AXLayoutObject::FindAllTableCellsWithRole(ax::mojom::Role role, AXObjectVector& cells) const { LayoutObject* layout_object = GetLayoutObject(); if (!layout_object || !layout_object->IsTable()) @@ -3129,12 +3211,12 @@ bool AXLayoutObject::FindAllTableCellsWithRole(AccessibilityRole role, } void AXLayoutObject::ColumnHeaders(AXObjectVector& headers) const { - if (!FindAllTableCellsWithRole(kColumnHeaderRole, headers)) + if (!FindAllTableCellsWithRole(ax::mojom::Role::kColumnHeader, headers)) AXNodeObject::ColumnHeaders(headers); } void AXLayoutObject::RowHeaders(AXObjectVector& headers) const { - if (!FindAllTableCellsWithRole(kRowHeaderRole, headers)) + if (!FindAllTableCellsWithRole(ax::mojom::Role::kRowHeader, headers)) AXNodeObject::RowHeaders(headers); } @@ -3147,7 +3229,7 @@ AXObject* AXLayoutObject::HeaderObject() const { for (LayoutTableCell* cell = row->FirstCell(); cell; cell = cell->NextCell()) { AXObject* ax_cell = AXObjectCache().GetOrCreate(cell); - if (ax_cell && ax_cell->RoleValue() == kRowHeaderRole) + if (ax_cell && ax_cell->RoleValue() == ax::mojom::Role::kRowHeader) return ax_cell; } @@ -3182,7 +3264,7 @@ bool AXLayoutObject::IsTabItemSelected() const { AXObject* tab_panel = AXObjectCache().GetOrCreate(element); // A tab item should only control tab panels. - if (!tab_panel || tab_panel->RoleValue() != kTabPanelRole) + if (!tab_panel || tab_panel->RoleValue() != ax::mojom::Role::kTabPanel) continue; AXObject* check_focus_element = focused_element; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.h index f7b2597c2ee..45384248ffa 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_layout_object.h @@ -56,8 +56,8 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { LayoutObject* GetLayoutObject() const final { return layout_object_; } LayoutBoxModelObject* GetLayoutBoxModelObject() const; ScrollableArea* GetScrollableAreaIfScrollable() const final; - AccessibilityRole DetermineAccessibilityRole() override; - AccessibilityRole NativeAccessibilityRoleIgnoringAria() const override; + ax::mojom::Role DetermineAccessibilityRole() override; + ax::mojom::Role NativeRoleIgnoringAria() const override; // If this is an anonymous block, returns the node of its containing layout // block, otherwise returns the node of this layout object. @@ -107,8 +107,8 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { float FontSize() const final; String ImageDataUrl(const IntSize& max_size) const final; String GetText() const override; - AccessibilityTextDirection GetTextDirection() const final; - AXTextPosition GetTextPosition() const final; + ax::mojom::TextDirection GetTextDirection() const final; + ax::mojom::TextPosition GetTextPosition() const final; int TextLength() const override; TextStyle GetTextStyle() const final; KURL Url() const override; @@ -125,7 +125,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { void AriaDescribedbyElements(AXObjectVector&) const override; void AriaOwnsElements(AXObjectVector&) const override; - AXHasPopup HasPopup() const override; + ax::mojom::HasPopup HasPopup() const override; bool SupportsARIADragging() const override; bool SupportsARIADropping() const override; bool SupportsARIAFlowTo() const override; @@ -139,7 +139,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { String TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom&, + ax::mojom::NameFrom&, AXRelatedObjectVector*, NameSources*) const override; @@ -202,7 +202,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { unsigned RowIndex() const override; // Also for a table row. unsigned ColumnSpan() const override; unsigned RowSpan() const override; - SortDirection GetSortDirection() const override; + ax::mojom::SortDirection GetSortDirection() const override; // For a table row or column. AXObject* HeaderObject() const override; @@ -224,9 +224,9 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { void AddRemoteSVGChildren(); void AddTableChildren(); void AddInlineTextBoxChildren(bool force); - AccessibilityRole DetermineTableCellRole() const; - AccessibilityRole DetermineTableRowRole() const; - bool FindAllTableCellsWithRole(AccessibilityRole, AXObjectVector&) const; + ax::mojom::Role DetermineTableCellRole() const; + ax::mojom::Role DetermineTableRowRole() const; + bool FindAllTableCellsWithRole(ax::mojom::Role, AXObjectVector&) const; LayoutRect ComputeElementRect() const; AXSelection TextControlSelection() const; @@ -236,6 +236,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { bool CanIgnoreTextAsEmpty() const; bool CanIgnoreSpaceNextTo(LayoutObject*, bool is_after) const; bool HasAriaCellRole(Element*) const; + bool IsPlaceholder() const; bool is_autofill_available_; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_list.cc index 59f9b75a3a8..98d081036a6 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list.cc @@ -59,10 +59,10 @@ bool AXList::IsDescriptionList() const { return node && node->HasTagName(dlTag); } -AccessibilityRole AXList::RoleValue() const { +ax::mojom::Role AXList::RoleValue() const { if (IsDescriptionList()) - return kDescriptionListRole; + return ax::mojom::Role::kDescriptionList; - return kListRole; + return ax::mojom::Role::kList; } } // namespace blink diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_list.h index b07f0712680..f2211e18772 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list.h @@ -46,7 +46,7 @@ class AXList final : public AXLayoutObject { bool IsList() const override { return true; } - AccessibilityRole RoleValue() const final; + ax::mojom::Role RoleValue() const final; private: bool IsDescriptionList() const; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.cc index c34efafd2c6..083bad904a2 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.cc @@ -50,11 +50,11 @@ AXListBox* AXListBox::Create(LayoutObject* layout_object, return new AXListBox(layout_object, ax_object_cache); } -AccessibilityRole AXListBox::DetermineAccessibilityRole() { - if ((aria_role_ = DetermineAriaRoleAttribute()) != kUnknownRole) +ax::mojom::Role AXListBox::DetermineAccessibilityRole() { + if ((aria_role_ = DetermineAriaRoleAttribute()) != ax::mojom::Role::kUnknown) return aria_role_; - return kListBoxRole; + return ax::mojom::Role::kListBox; } AXObject* AXListBox::ActiveDescendant() { @@ -84,8 +84,8 @@ void AXListBox::ActiveIndexChanged() { if (!select->IsFocused()) return; - AXObjectCache().PostNotification( - this, AXObjectCacheImpl::kAXActiveDescendantChanged); + AXObjectCache().PostNotification(this, + ax::mojom::Event::kActiveDescendantChanged); } } // namespace blink diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.h index e79171d3b6b..c4ddb67784e 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box.h @@ -44,7 +44,7 @@ class AXListBox final : public AXLayoutObject { static AXListBox* Create(LayoutObject*, AXObjectCacheImpl&); ~AXListBox() override; - AccessibilityRole DetermineAccessibilityRole() final; + ax::mojom::Role DetermineAccessibilityRole() final; bool IsAXListBox() const override { return true; } AXObject* ActiveDescendant() final; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.cc index c0ce1e480e3..de06a56fd1c 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.cc @@ -49,8 +49,8 @@ AXListBoxOption* AXListBoxOption::Create(LayoutObject* layout_object, return new AXListBoxOption(layout_object, ax_object_cache); } -AccessibilityRole AXListBoxOption::DetermineAccessibilityRole() { - if ((aria_role_ = DetermineAriaRoleAttribute()) != kUnknownRole) +ax::mojom::Role AXListBoxOption::DetermineAccessibilityRole() { + if ((aria_role_ = DetermineAriaRoleAttribute()) != ax::mojom::Role::kUnknown) return aria_role_; // http://www.w3.org/TR/wai-aria/complete#presentation @@ -59,9 +59,9 @@ AccessibilityRole AXListBoxOption::DetermineAccessibilityRole() { // does not cause the content contained within the element to be removed from // the accessibility tree. if (IsParentPresentationalRole()) - return kStaticTextRole; + return ax::mojom::Role::kStaticText; - return kListBoxOptionRole; + return ax::mojom::Role::kListBoxOption; } bool AXListBoxOption::IsParentPresentationalRole() const { @@ -111,7 +111,7 @@ bool AXListBoxOption::ComputeAccessibilityIsIgnored( String AXListBoxOption::TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { // If nameSources is non-null, relatedObjects is used in filling it in, so it @@ -129,7 +129,7 @@ String AXListBoxOption::TextAlternative(bool recursive, if (found_text_alternative && !name_sources) return text_alternative; - name_from = kAXNameFromContents; + name_from = ax::mojom::NameFrom::kContents; text_alternative = ToHTMLOptionElement(GetNode())->DisplayLabel(); if (name_sources) { name_sources->push_back(NameSource(found_text_alternative)); diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h index ef2129317de..07ed3c8f526 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h @@ -47,7 +47,7 @@ class AXListBoxOption final : public AXLayoutObject { ~AXListBoxOption() override; bool IsAXListBoxOption() const override { return true; } - AccessibilityRole DetermineAccessibilityRole() final; + ax::mojom::Role DetermineAccessibilityRole() final; AccessibilitySelectedState IsSelected() const override; bool IsSelectedOptionActive() const override; bool OnNativeSetSelectedAction(bool) override; @@ -55,7 +55,7 @@ class AXListBoxOption final : public AXLayoutObject { String TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom&, + ax::mojom::NameFrom&, AXRelatedObjectVector*, NameSources*) const override; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.cc index 66bef28d1da..4bc852fd8ee 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.cc @@ -59,6 +59,10 @@ AXObject* AccessibilityMediaControl::Create( case kMediaSlider: return AccessibilityMediaTimeline::Create(layout_object, ax_object_cache); + case kMediaVolumeSlider: + return AccessibilityMediaVolumeSlider::Create(layout_object, + ax_object_cache); + case kMediaCurrentTimeDisplay: case kMediaTimeRemainingDisplay: return AccessibilityMediaTimeDisplay::Create(layout_object, @@ -79,7 +83,6 @@ AXObject* AccessibilityMediaControl::Create( case kMediaTimelineContainer: case kMediaTrackSelectionCheckmark: case kMediaVolumeSliderContainer: - case kMediaVolumeSlider: case kMediaVolumeSliderThumb: case kMediaExitFullscreenButton: case kMediaCastOffButton: @@ -93,6 +96,7 @@ AXObject* AccessibilityMediaControl::Create( case kMediaEnterPictureInPictureButton: case kMediaExitPictureInPictureButton: case kMediaDisplayCutoutFullscreenButton: + case kMediaAnimatedArrowContainer: return new AccessibilityMediaControl(layout_object, ax_object_cache); } @@ -108,28 +112,21 @@ MediaControlElementType AccessibilityMediaControl::ControlType() const { GetLayoutObject()->GetNode()); } -bool AccessibilityMediaControl::OnNativeScrollToGlobalPointAction( - const IntPoint& point) const { +bool AccessibilityMediaControl::InternalSetAccessibilityFocusAction() { MediaControlElementsHelper::NotifyMediaControlAccessibleFocus(GetElement()); - return AXLayoutObject::OnNativeScrollToGlobalPointAction(point); + return AXLayoutObject::InternalSetAccessibilityFocusAction(); } -bool AccessibilityMediaControl::OnNativeScrollToMakeVisibleAction() const { - MediaControlElementsHelper::NotifyMediaControlAccessibleFocus(GetElement()); - return AXLayoutObject::OnNativeScrollToMakeVisibleAction(); -} - -bool AccessibilityMediaControl::OnNativeScrollToMakeVisibleWithSubFocusAction( - const IntRect& rect) const { - MediaControlElementsHelper::NotifyMediaControlAccessibleFocus(GetElement()); - return AXLayoutObject::OnNativeScrollToMakeVisibleWithSubFocusAction(rect); +bool AccessibilityMediaControl::InternalClearAccessibilityFocusAction() { + MediaControlElementsHelper::NotifyMediaControlAccessibleBlur(GetElement()); + return AXLayoutObject::InternalClearAccessibilityFocusAction(); } String AccessibilityMediaControl::TextAlternative( bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { switch (ControlType()) { @@ -169,10 +166,10 @@ String AccessibilityMediaControl::TextAlternative( case kMediaTrackSelectionCheckmark: case kMediaControlsPanel: case kMediaVolumeSliderContainer: - case kMediaVolumeSlider: case kMediaVolumeSliderThumb: case kMediaOverflowList: case kMediaScrubbingMessage: + case kMediaAnimatedArrowContainer: return QueryString(WebLocalizedString::kAXMediaDefault); case kMediaEnterPictureInPictureButton: return QueryString( @@ -184,6 +181,7 @@ String AccessibilityMediaControl::TextAlternative( return QueryString( WebLocalizedString::kAXMediaDisplayCutoutFullscreenButton); case kMediaSlider: + case kMediaVolumeSlider: NOTREACHED(); return QueryString(WebLocalizedString::kAXMediaDefault); } @@ -193,62 +191,49 @@ String AccessibilityMediaControl::TextAlternative( } String AccessibilityMediaControl::Description( - AXNameFrom name_from, - AXDescriptionFrom& description_from, + ax::mojom::NameFrom name_from, + ax::mojom::DescriptionFrom& description_from, AXObjectVector* description_objects) const { switch (ControlType()) { + case kMediaCurrentTimeDisplay: + return QueryString(WebLocalizedString::kAXMediaCurrentTimeDisplayHelp); + case kMediaTimeRemainingDisplay: + return QueryString(WebLocalizedString::kAXMediaTimeRemainingDisplayHelp); + case kMediaOverflowButton: + return QueryString(WebLocalizedString::kAXMediaOverflowButtonHelp); + // The following descriptions are repeats of their respective titles. When + // read by accessibility, we get the same thing said twice, with no value + // added. So instead, we just return an empty string. case kMediaEnterFullscreenButton: - return QueryString(WebLocalizedString::kAXMediaEnterFullscreenButtonHelp); case kMediaExitFullscreenButton: - return QueryString(WebLocalizedString::kAXMediaExitFullscreenButtonHelp); + case kMediaDisplayCutoutFullscreenButton: case kMediaMuteButton: - return QueryString(WebLocalizedString::kAXMediaMuteButtonHelp); - case kMediaPlayButton: - return QueryString(WebLocalizedString::kAXMediaPlayButtonHelp); case kMediaUnMuteButton: - return QueryString(WebLocalizedString::kAXMediaUnMuteButtonHelp); + case kMediaPlayButton: case kMediaPauseButton: - return QueryString(WebLocalizedString::kAXMediaPauseButtonHelp); - case kMediaCurrentTimeDisplay: - return QueryString(WebLocalizedString::kAXMediaCurrentTimeDisplayHelp); - case kMediaTimeRemainingDisplay: - return QueryString(WebLocalizedString::kAXMediaTimeRemainingDisplayHelp); case kMediaShowClosedCaptionsButton: - return QueryString( - WebLocalizedString::kAXMediaShowClosedCaptionsButtonHelp); case kMediaHideClosedCaptionsButton: - return QueryString( - WebLocalizedString::kAXMediaHideClosedCaptionsButtonHelp); case kMediaCastOffButton: case kMediaOverlayCastOffButton: - return QueryString(WebLocalizedString::kAXMediaCastOffButtonHelp); case kMediaCastOnButton: case kMediaOverlayCastOnButton: - return QueryString(WebLocalizedString::kAXMediaCastOnButtonHelp); - case kMediaOverflowButton: - return QueryString(WebLocalizedString::kAXMediaOverflowButtonHelp); case kMediaEnterPictureInPictureButton: - return QueryString( - WebLocalizedString::kAXMediaEnterPictureInPictureButtonHelp); case kMediaExitPictureInPictureButton: - return QueryString( - WebLocalizedString::kAXMediaExitPictureInPictureButtonHelp); - case kMediaDisplayCutoutFullscreenButton: - return QueryString( - WebLocalizedString::kAXMediaDisplayCutoutFullscreenButtonHelp); + return ""; case kMediaSliderThumb: case kMediaTextTrackList: case kMediaTimelineContainer: case kMediaTrackSelectionCheckmark: case kMediaControlsPanel: case kMediaVolumeSliderContainer: - case kMediaVolumeSlider: case kMediaVolumeSliderThumb: case kMediaOverflowList: case kMediaDownloadButton: case kMediaScrubbingMessage: + case kMediaAnimatedArrowContainer: return QueryString(WebLocalizedString::kAXMediaDefault); case kMediaSlider: + case kMediaVolumeSlider: NOTREACHED(); return QueryString(WebLocalizedString::kAXMediaDefault); } @@ -267,7 +252,7 @@ bool AccessibilityMediaControl::ComputeAccessibilityIsIgnored( return AccessibilityIsIgnoredByDefault(ignored_reasons); } -AccessibilityRole AccessibilityMediaControl::RoleValue() const { +ax::mojom::Role AccessibilityMediaControl::RoleValue() const { switch (ControlType()) { case kMediaEnterFullscreenButton: case kMediaExitFullscreenButton: @@ -286,32 +271,33 @@ AccessibilityRole AccessibilityMediaControl::RoleValue() const { case kMediaEnterPictureInPictureButton: case kMediaExitPictureInPictureButton: case kMediaDisplayCutoutFullscreenButton: - return kButtonRole; + return ax::mojom::Role::kButton; case kMediaTimelineContainer: case kMediaVolumeSliderContainer: case kMediaTextTrackList: case kMediaOverflowList: - return kGroupRole; + return ax::mojom::Role::kGroup; case kMediaControlsPanel: case kMediaCurrentTimeDisplay: case kMediaTimeRemainingDisplay: case kMediaSliderThumb: case kMediaTrackSelectionCheckmark: - case kMediaVolumeSlider: case kMediaVolumeSliderThumb: case kMediaScrubbingMessage: - return kUnknownRole; + case kMediaAnimatedArrowContainer: + return ax::mojom::Role::kUnknown; case kMediaSlider: + case kMediaVolumeSlider: // Not using AccessibilityMediaControl. NOTREACHED(); - return kUnknownRole; + return ax::mojom::Role::kUnknown; } NOTREACHED(); - return kUnknownRole; + return ax::mojom::Role::kUnknown; } // @@ -331,7 +317,7 @@ String AXMediaControlsContainer::TextAlternative( bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { return QueryString(IsControllingVideoElement() @@ -340,8 +326,8 @@ String AXMediaControlsContainer::TextAlternative( } String AXMediaControlsContainer::Description( - AXNameFrom name_from, - AXDescriptionFrom& description_from, + ax::mojom::NameFrom name_from, + ax::mojom::DescriptionFrom& description_from, AXObjectVector* description_objects) const { return QueryString(IsControllingVideoElement() ? WebLocalizedString::kAXMediaVideoElementHelp @@ -374,14 +360,45 @@ AXObject* AccessibilityMediaTimeline::Create( } String AccessibilityMediaTimeline::Description( - AXNameFrom name_from, - AXDescriptionFrom& description_from, + ax::mojom::NameFrom name_from, + ax::mojom::DescriptionFrom& description_from, AXObjectVector* description_objects) const { return QueryString(IsControllingVideoElement() ? WebLocalizedString::kAXMediaVideoSliderHelp : WebLocalizedString::kAXMediaAudioSliderHelp); } +// +// AccessibilityMediaVolumeSlider + +AccessibilityMediaVolumeSlider::AccessibilityMediaVolumeSlider( + LayoutObject* layout_object, + AXObjectCacheImpl& ax_object_cache) + : AXSlider(layout_object, ax_object_cache) {} + +AXObject* AccessibilityMediaVolumeSlider::Create( + LayoutObject* layout_object, + AXObjectCacheImpl& ax_object_cache) { + return new AccessibilityMediaVolumeSlider(layout_object, ax_object_cache); +} + +String AccessibilityMediaVolumeSlider::Description( + ax::mojom::NameFrom name_from, + ax::mojom::DescriptionFrom& description_from, + AXObjectVector* description_objects) const { + return QueryString(WebLocalizedString::kAXMediaVolumeSliderHelp); +} + +bool AccessibilityMediaVolumeSlider::InternalSetAccessibilityFocusAction() { + MediaControlElementsHelper::NotifyMediaControlAccessibleFocus(GetElement()); + return AXSlider::InternalSetAccessibilityFocusAction(); +} + +bool AccessibilityMediaVolumeSlider::InternalClearAccessibilityFocusAction() { + MediaControlElementsHelper::NotifyMediaControlAccessibleBlur(GetElement()); + return AXSlider::InternalClearAccessibilityFocusAction(); +} + // // AccessibilityMediaTimeDisplay @@ -412,7 +429,7 @@ String AccessibilityMediaTimeDisplay::TextAlternative( bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { if (ControlType() == kMediaCurrentTimeDisplay) diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.h index 17f1913e57f..fc7c71c0424 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_media_controls.h @@ -42,22 +42,20 @@ class AccessibilityMediaControl : public AXLayoutObject { static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaControl() override = default; - AccessibilityRole RoleValue() const override; + ax::mojom::Role RoleValue() const override; String TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom&, + ax::mojom::NameFrom&, AXRelatedObjectVector*, NameSources*) const override; - String Description(AXNameFrom, - AXDescriptionFrom&, + String Description(ax::mojom::NameFrom, + ax::mojom::DescriptionFrom&, AXObjectVector* description_objects) const override; - bool OnNativeScrollToGlobalPointAction(const IntPoint&) const override; - bool OnNativeScrollToMakeVisibleAction() const override; - bool OnNativeScrollToMakeVisibleWithSubFocusAction( - const IntRect&) const override; + bool InternalSetAccessibilityFocusAction() override; + bool InternalClearAccessibilityFocusAction() override; protected: AccessibilityMediaControl(LayoutObject*, AXObjectCacheImpl&); @@ -72,8 +70,8 @@ class AccessibilityMediaTimeline final : public AXSlider { static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaTimeline() override = default; - String Description(AXNameFrom, - AXDescriptionFrom&, + String Description(ax::mojom::NameFrom, + ax::mojom::DescriptionFrom&, AXObjectVector* description_objects) const override; private: @@ -82,21 +80,41 @@ class AccessibilityMediaTimeline final : public AXSlider { DISALLOW_COPY_AND_ASSIGN(AccessibilityMediaTimeline); }; +class AccessibilityMediaVolumeSlider final : public AXSlider { + public: + static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); + ~AccessibilityMediaVolumeSlider() override = default; + + String Description(ax::mojom::NameFrom, + ax::mojom::DescriptionFrom&, + AXObjectVector* description_objects) const override; + + bool InternalSetAccessibilityFocusAction() override; + bool InternalClearAccessibilityFocusAction() override; + + private: + AccessibilityMediaVolumeSlider(LayoutObject*, AXObjectCacheImpl&); + + DISALLOW_COPY_AND_ASSIGN(AccessibilityMediaVolumeSlider); +}; + class AXMediaControlsContainer final : public AccessibilityMediaControl { public: static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AXMediaControlsContainer() override = default; - AccessibilityRole RoleValue() const override { return kToolbarRole; } + ax::mojom::Role RoleValue() const override { + return ax::mojom::Role::kToolbar; + } String TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom&, + ax::mojom::NameFrom&, AXRelatedObjectVector*, NameSources*) const override; - String Description(AXNameFrom, - AXDescriptionFrom&, + String Description(ax::mojom::NameFrom, + ax::mojom::DescriptionFrom&, AXObjectVector* description_objects) const override; private: @@ -111,13 +129,15 @@ class AccessibilityMediaTimeDisplay final : public AccessibilityMediaControl { static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaTimeDisplay() override = default; - AccessibilityRole RoleValue() const override { return kStaticTextRole; } + ax::mojom::Role RoleValue() const override { + return ax::mojom::Role::kStaticText; + } String StringValue() const override; String TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom&, + ax::mojom::NameFrom&, AXRelatedObjectVector*, NameSources*) const override; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.cc index 85ee9f64206..1f294af0880 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.cc @@ -41,11 +41,11 @@ AXMenuList* AXMenuList::Create(LayoutMenuList* layout_object, return new AXMenuList(layout_object, ax_object_cache); } -AccessibilityRole AXMenuList::DetermineAccessibilityRole() { - if ((aria_role_ = DetermineAriaRoleAttribute()) != kUnknownRole) +ax::mojom::Role AXMenuList::DetermineAccessibilityRole() { + if ((aria_role_ = DetermineAriaRoleAttribute()) != ax::mojom::Role::kUnknown) return aria_role_; - return kPopUpButtonRole; + return ax::mojom::Role::kPopUpButton; } bool AXMenuList::OnNativeClickAction() { @@ -78,7 +78,7 @@ void AXMenuList::AddChildren() { AXObjectCacheImpl& cache = AXObjectCache(); - AXObject* list = cache.GetOrCreate(kMenuListPopupRole); + AXObject* list = cache.GetOrCreate(ax::mojom::Role::kMenuListPopup); if (!list) return; @@ -127,7 +127,7 @@ void AXMenuList::DidUpdateActiveOption(int option_index) { } AXObjectCache().PostNotification(this, - AXObjectCacheImpl::kAXMenuListValueChanged); + ax::mojom::Event::kMenuListValueChanged); } void AXMenuList::DidShowPopup() { @@ -146,8 +146,7 @@ void AXMenuList::DidHidePopup() { popup->DidHide(); if (GetNode() && GetNode()->IsFocused()) - AXObjectCache().PostNotification( - this, AXObjectCacheImpl::kAXFocusedUIElementChanged); + AXObjectCache().PostNotification(this, ax::mojom::Event::kFocus); } } // namespace blink diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.h index bafcc00afa5..a54dc3177da 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.h +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list.h @@ -38,7 +38,6 @@ class AXMenuList final : public AXLayoutObject { public: static AXMenuList* Create(LayoutMenuList* layout_object, AXObjectCacheImpl&); - bool IsCollapsed() const override; AccessibilityExpanded IsExpanded() const final; bool OnNativeClickAction() override; void ClearChildren() override; @@ -53,10 +52,12 @@ class AXMenuList final : public AXLayoutObject { AXMenuList(LayoutMenuList*, AXObjectCacheImpl&); bool IsMenuList() const override { return true; } - AccessibilityRole DetermineAccessibilityRole() final; + ax::mojom::Role DetermineAccessibilityRole() final; void AddChildren() override; + bool IsCollapsed() const; + DISALLOW_COPY_AND_ASSIGN(AXMenuList); }; diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.cc index a6b3ae05669..57b987bbdcd 100644 --- a/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.cc +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.cc @@ -55,16 +55,16 @@ LocalFrameView* AXMenuListOption::DocumentFrameView() const { return element_->GetDocument().View(); } -AccessibilityRole AXMenuListOption::RoleValue() const { +ax::mojom::Role AXMenuListOption::RoleValue() const { const AtomicString& aria_role = GetAOMPropertyOrARIAAttribute(AOMStringProperty::kRole); if (aria_role.IsEmpty()) - return kMenuListOptionRole; + return ax::mojom::Role::kMenuListOption; - AccessibilityRole role = AriaRoleToWebCoreRole(aria_role); - if (role) + ax::mojom::Role role = AriaRoleToWebCoreRole(aria_role); + if (role != ax::mojom::Role::kUnknown) return role; - return kMenuListOptionRole; + return ax::mojom::Role::kMenuListOption; } Element* AXMenuListOption::ActionElement() const { @@ -79,6 +79,8 @@ AXObject* AXMenuListOption::ComputeParent() const { if (!select) return nullptr; AXObject* select_ax_object = AXObjectCache().GetOrCreate(select); + if (!select_ax_object) + return nullptr; // This happens if the element. name_objects->clear(); @@ -1755,7 +1777,7 @@ String AXNodeObject::GetName(AXNameFrom& name_from, String AXNodeObject::TextAlternative(bool recursive, bool in_aria_labelled_by_traversal, AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources) const { // If nameSources is non-null, relatedObjects is used in filling it in, so it @@ -1793,13 +1815,28 @@ String AXNodeObject::TextAlternative(bool recursive, return StringValue(); } + // Step 2E from: http://www.w3.org/TR/accname-aam-1.1 + // "If the embedded control has role combobox or listbox, return the text + // alternative of the chosen option." + if (NameFromSelectedOption(recursive)) { + StringBuilder accumulated_text; + AXObjectVector selected_options; + SelectedOptions(selected_options); + for (const auto& child : selected_options) { + if (accumulated_text.length()) + accumulated_text.Append(" "); + accumulated_text.Append(child->ComputedName()); + } + return accumulated_text.ToString(); + } + // Step 2D from: http://www.w3.org/TR/accname-aam-1.1 text_alternative = NativeTextAlternative(visited, name_from, related_objects, name_sources, &found_text_alternative); const bool has_text_alternative = !text_alternative.IsEmpty() || - name_from == kAXNameFromAttributeExplicitlyEmpty; + name_from == ax::mojom::NameFrom::kAttributeExplicitlyEmpty; if (has_text_alternative && !name_sources) return text_alternative; @@ -1807,7 +1844,7 @@ String AXNodeObject::TextAlternative(bool recursive, if (in_aria_labelled_by_traversal || NameFromContents(recursive)) { Node* node = GetNode(); if (!IsHTMLSelectElement(node)) { // Avoid option descendant text - name_from = kAXNameFromContents; + name_from = ax::mojom::NameFrom::kContents; if (name_sources) { name_sources->push_back(NameSource(found_text_alternative)); name_sources->back().type = name_from; @@ -1832,7 +1869,7 @@ String AXNodeObject::TextAlternative(bool recursive, } // Step 2H from: http://www.w3.org/TR/accname-aam-1.1 - name_from = kAXNameFromTitle; + name_from = ax::mojom::NameFrom::kTitle; if (name_sources) { name_sources->push_back(NameSource(found_text_alternative, titleAttr)); name_sources->back().type = name_from; @@ -1840,6 +1877,7 @@ String AXNodeObject::TextAlternative(bool recursive, const AtomicString& title = GetAttribute(titleAttr); if (!title.IsEmpty()) { text_alternative = title; + name_from = ax::mojom::NameFrom::kTitle; if (name_sources) { found_text_alternative = true; name_sources->back().text = text_alternative; @@ -1848,12 +1886,11 @@ String AXNodeObject::TextAlternative(bool recursive, } } - name_from = kAXNameFromUninitialized; + name_from = ax::mojom::NameFrom::kUninitialized; if (name_sources && found_text_alternative) { - for (size_t i = 0; i < name_sources->size(); ++i) { - if (!(*name_sources)[i].text.IsNull() && !(*name_sources)[i].superseded) { - NameSource& name_source = (*name_sources)[i]; + for (NameSource& name_source : *name_sources) { + if (!name_source.text.IsNull() && !name_source.superseded) { name_from = name_source.type; if (!name_source.related_objects.IsEmpty()) *related_objects = name_source.related_objects; @@ -1865,6 +1902,59 @@ String AXNodeObject::TextAlternative(bool recursive, return String(); } +static bool ShouldInsertSpaceBetweenObjectsIfNeeded( + AXObject* previous, + AXObject* next, + ax::mojom::NameFrom last_used_name_from, + ax::mojom::NameFrom name_from) { + // If we're going between two layoutObjects that are in separate + // LayoutBoxes, add whitespace if it wasn't there already. Intuitively if + // you have HelloWorld, those are part of the same + // LayoutBox so we should return "HelloWorld", but given + //
Hello
World
the strings are in separate boxes so we + // should return "Hello World". + if (!IsInSameNonInlineBlockFlow(next->GetLayoutObject(), + previous->GetLayoutObject())) + return true; + + // Even if it is in the same inline block flow, if we are using a text + // alternative such as an ARIA label or HTML title, we should separate + // the strings. Doing so is consistent with what is stated in the AccName + // spec and with what is done in other user agents. + switch (last_used_name_from) { + case ax::mojom::NameFrom::kNone: + case ax::mojom::NameFrom::kUninitialized: + case ax::mojom::NameFrom::kAttributeExplicitlyEmpty: + case ax::mojom::NameFrom::kContents: + break; + case ax::mojom::NameFrom::kAttribute: + case ax::mojom::NameFrom::kCaption: + case ax::mojom::NameFrom::kPlaceholder: + case ax::mojom::NameFrom::kRelatedElement: + case ax::mojom::NameFrom::kTitle: + case ax::mojom::NameFrom::kValue: + return true; + } + switch (name_from) { + case ax::mojom::NameFrom::kNone: + case ax::mojom::NameFrom::kUninitialized: + case ax::mojom::NameFrom::kAttributeExplicitlyEmpty: + case ax::mojom::NameFrom::kContents: + break; + case ax::mojom::NameFrom::kAttribute: + case ax::mojom::NameFrom::kCaption: + case ax::mojom::NameFrom::kPlaceholder: + case ax::mojom::NameFrom::kRelatedElement: + case ax::mojom::NameFrom::kTitle: + case ax::mojom::NameFrom::kValue: + return true; + } + + // According to the AccName spec, we need to separate controls from text nodes + // using a space. + return previous->IsControl() || next->IsControl(); +} + String AXNodeObject::TextFromDescendants(AXObjectSet& visited, bool recursive) const { if (!CanHaveChildren() && recursive) @@ -1872,6 +1962,7 @@ String AXNodeObject::TextFromDescendants(AXObjectSet& visited, StringBuilder accumulated_text; AXObject* previous = nullptr; + ax::mojom::NameFrom last_used_name_from = ax::mojom::NameFrom::kUninitialized; AXObjectVector children; @@ -1893,26 +1984,39 @@ String AXNodeObject::TextFromDescendants(AXObjectSet& visited, if (child->AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kHidden)) continue; - // If we're going between two layoutObjects that are in separate - // LayoutBoxes, add whitespace if it wasn't there already. Intuitively if - // you have HelloWorld, those are part of the same - // LayoutBox so we should return "HelloWorld", but given - //
Hello
World
the strings are in separate boxes so we - // should return "Hello World". - if (previous && accumulated_text.length() && - !IsHTMLSpace(accumulated_text[accumulated_text.length() - 1])) { - if (!IsInSameNonInlineBlockFlow(child->GetLayoutObject(), - previous->GetLayoutObject())) + ax::mojom::NameFrom child_name_from = ax::mojom::NameFrom::kUninitialized; + String result; + if (child->IsPresentational()) { + result = child->TextFromDescendants(visited, true); + } else { + result = + RecursiveTextAlternative(*child, false, visited, child_name_from); + } + + if (!result.IsEmpty() && previous && accumulated_text.length() && + !IsHTMLSpace(accumulated_text[accumulated_text.length() - 1]) && + !IsHTMLSpace(result[0])) { + if (ShouldInsertSpaceBetweenObjectsIfNeeded( + previous, child, last_used_name_from, child_name_from)) { accumulated_text.Append(' '); + } } - String result; - if (child->IsPresentational()) - result = child->TextFromDescendants(visited, true); - else - result = RecursiveTextAlternative(*child, false, visited); accumulated_text.Append(result); + + // We keep track of all non-hidden children, even those whose content is + // not included, because all rendered children impact whether or not a + // space should be inserted between objects. Example: A label which has + // a single, nameless input surrounded by CSS-generated content should + // have a space separating the before and after content. previous = child; + + // We only keep track of the source of children whose content is included. + // Example: Three spans, the first with an aria-label, the second with no + // content, and the third whose name comes from content. There should be a + // space between the first and third because of the aria-label in the first. + if (!result.IsEmpty()) + last_used_name_from = child_name_from; } return accumulated_text.ToString(); @@ -2134,8 +2238,8 @@ void AXNodeObject::InsertChild(AXObject* child, unsigned index) { if (child->AccessibilityIsIgnored()) { const auto& children = child->Children(); - size_t length = children.size(); - for (size_t i = 0; i < length; ++i) + wtf_size_t length = children.size(); + for (wtf_size_t i = 0; i < length; ++i) children_.insert(index + i, children[i]); } else { DCHECK_EQ(child->ParentObject(), this); @@ -2166,55 +2270,55 @@ bool AXNodeObject::CanHaveChildren() const { } switch (native_role_) { - case kButtonRole: - case kCheckBoxRole: - case kImageRole: - case kListBoxOptionRole: - case kMenuButtonRole: - case kMenuListOptionRole: - case kMenuItemRole: - case kMenuItemCheckBoxRole: - case kMenuItemRadioRole: - case kProgressIndicatorRole: - case kRadioButtonRole: - case kScrollBarRole: - // case kSearchBoxRole: - case kSliderRole: - case kSplitterRole: - case kSwitchRole: - case kTabRole: - // case kTextFieldRole: - case kToggleButtonRole: + case ax::mojom::Role::kButton: + case ax::mojom::Role::kCheckBox: + case ax::mojom::Role::kImage: + case ax::mojom::Role::kListBoxOption: + case ax::mojom::Role::kMenuButton: + case ax::mojom::Role::kMenuListOption: + case ax::mojom::Role::kMenuItem: + case ax::mojom::Role::kMenuItemCheckBox: + case ax::mojom::Role::kMenuItemRadio: + case ax::mojom::Role::kProgressIndicator: + case ax::mojom::Role::kRadioButton: + case ax::mojom::Role::kScrollBar: + // case ax::mojom::Role::kSearchBox: + case ax::mojom::Role::kSlider: + case ax::mojom::Role::kSplitter: + case ax::mojom::Role::kSwitch: + case ax::mojom::Role::kTab: + // case ax::mojom::Role::kTextField: + case ax::mojom::Role::kToggleButton: return false; - case kPopUpButtonRole: + case ax::mojom::Role::kPopUpButton: return true; - case kStaticTextRole: + case ax::mojom::Role::kStaticText: return AXObjectCache().InlineTextBoxAccessibilityEnabled(); default: break; } switch (AriaRoleAttribute()) { - case kImageRole: + case ax::mojom::Role::kImage: return false; - case kButtonRole: - case kCheckBoxRole: - case kListBoxOptionRole: - case kMathRole: // role="math" is flat, unlike - case kMenuButtonRole: - case kMenuListOptionRole: - case kMenuItemRole: - case kMenuItemCheckBoxRole: - case kMenuItemRadioRole: - case kPopUpButtonRole: - case kProgressIndicatorRole: - case kRadioButtonRole: - case kScrollBarRole: - case kSliderRole: - case kSplitterRole: - case kSwitchRole: - case kTabRole: - case kToggleButtonRole: { + case ax::mojom::Role::kButton: + case ax::mojom::Role::kCheckBox: + case ax::mojom::Role::kListBoxOption: + case ax::mojom::Role::kMath: // role="math" is flat, unlike + case ax::mojom::Role::kMenuButton: + case ax::mojom::Role::kMenuListOption: + case ax::mojom::Role::kMenuItem: + case ax::mojom::Role::kMenuItemCheckBox: + case ax::mojom::Role::kMenuItemRadio: + case ax::mojom::Role::kPopUpButton: + case ax::mojom::Role::kProgressIndicator: + case ax::mojom::Role::kRadioButton: + case ax::mojom::Role::kScrollBar: + case ax::mojom::Role::kSlider: + case ax::mojom::Role::kSplitter: + case ax::mojom::Role::kSwitch: + case ax::mojom::Role::kTab: + case ax::mojom::Role::kToggleButton: { // These roles have ChildrenPresentational: true in the ARIA spec. // We used to remove/prune all descendants of them, but that removed // useful content if the author didn't follow the spec perfectly, for @@ -2354,7 +2458,7 @@ bool AXNodeObject::OnNativeFocusAction() { bool AXNodeObject::OnNativeIncrementAction() { LocalFrame* frame = GetDocument() ? GetDocument()->GetFrame() : nullptr; std::unique_ptr gesture_indicator = - Frame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); + LocalFrame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); AlterSliderOrSpinButtonValue(true); return true; } @@ -2362,7 +2466,7 @@ bool AXNodeObject::OnNativeIncrementAction() { bool AXNodeObject::OnNativeDecrementAction() { LocalFrame* frame = GetDocument() ? GetDocument()->GetFrame() : nullptr; std::unique_ptr gesture_indicator = - Frame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); + LocalFrame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); AlterSliderOrSpinButtonValue(false); return true; } @@ -2408,7 +2512,7 @@ void AXNodeObject::ChildrenChanged() { if (IsDetached()) return; - AXObjectCache().PostNotification(this, AXObjectCacheImpl::kAXChildrenChanged); + AXObjectCache().PostNotification(this, ax::mojom::Event::kChildrenChanged); // Go up the accessibility parent chain, but only if the element already // exists. This method is called during layout, minimal work should be done. @@ -2424,16 +2528,16 @@ void AXNodeObject::ChildrenChanged() { // If this element supports ARIA live regions, then notify the AT of // changes. - if (parent->IsLiveRegion()) + if (parent->IsLiveRegion()) { AXObjectCache().PostNotification(parent, - AXObjectCacheImpl::kAXLiveRegionChanged); + ax::mojom::Event::kLiveRegionChanged); + } // If this element is an ARIA text box or content editable, post a "value // changed" notification on it so that it behaves just like a native input // element or textarea. if (IsNonNativeTextControl()) - AXObjectCache().PostNotification(parent, - AXObjectCacheImpl::kAXValueChanged); + AXObjectCache().PostNotification(parent, ax::mojom::Event::kValueChanged); } } @@ -2444,17 +2548,47 @@ void AXNodeObject::UpdateChildrenIfNecessary() { AXObject::UpdateChildrenIfNecessary(); } +void AXNodeObject::SelectedOptions(AXObjectVector& options) const { + if (IsHTMLSelectElement(GetNode())) { + HTMLSelectElement* select = ToHTMLSelectElement(GetNode()); + for (auto* const option : *select->selectedOptions()) { + options.push_back(AXObjectCache().GetOrCreate(option)); + } + return; + } + + // If the combobox or listbox is a descendant of a label element for another + // widget, it may be ignored and Children() won't return all its children. + // As a result, we need to use RawFirstChild and RawNextSibling to iterate + // over the children in search of the selected option(s). + + if (RoleValue() == ax::mojom::Role::kComboBoxGrouping || + RoleValue() == ax::mojom::Role::kComboBoxMenuButton) { + for (AXObject* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { + if (obj->RoleValue() == ax::mojom::Role::kListBox) { + obj->SelectedOptions(options); + return; + } + } + } + + for (AXObject* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { + if (obj->IsSelected() == kSelectedStateTrue) + options.push_back(obj); + } +} + void AXNodeObject::SelectionChanged() { // Post the selected text changed event on the first ancestor that's // focused (to handle form controls, ARIA text boxes and contentEditable), // or the web area if the selection is just in the document somewhere. if (IsFocused() || IsWebArea()) { AXObjectCache().PostNotification(this, - AXObjectCacheImpl::kAXSelectedTextChanged); + ax::mojom::Event::kTextSelectionChanged); if (GetDocument()) { AXObject* document_object = AXObjectCache().GetOrCreate(GetDocument()); AXObjectCache().PostNotification( - document_object, AXObjectCacheImpl::kAXDocumentSelectionChanged); + document_object, ax::mojom::Event::kDocumentSelectionChanged); } } else { AXObject::SelectionChanged(); // Calls selectionChanged on parent. @@ -2472,14 +2606,13 @@ void AXNodeObject::TextChanged() { continue; if (parent->IsLiveRegion()) - cache.PostNotification(parent_node, - AXObjectCacheImpl::kAXLiveRegionChanged); + cache.PostNotification(parent_node, ax::mojom::Event::kLiveRegionChanged); // If this element is an ARIA text box or content editable, post a "value // changed" notification on it so that it behaves just like a native input // element or textarea. if (parent->IsNonNativeTextControl()) - cache.PostNotification(parent_node, AXObjectCacheImpl::kAXValueChanged); + cache.PostNotification(parent_node, ax::mojom::Event::kValueChanged); } } @@ -2520,7 +2653,7 @@ void AXNodeObject::ComputeAriaOwnsChildren( // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-description-calculation String AXNodeObject::NativeTextAlternative( AXObjectSet& visited, - AXNameFrom& name_from, + ax::mojom::NameFrom& name_from, AXRelatedObjectVector* related_objects, NameSources* name_sources, bool* found_text_alternative) const { @@ -2544,7 +2677,7 @@ String AXNodeObject::NativeTextAlternative( html_element = ToHTMLElement(GetNode()); if (html_element && html_element->IsLabelable()) { - name_from = kAXNameFromRelatedElement; + name_from = ax::mojom::NameFrom::kRelatedElement; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2578,7 +2711,7 @@ String AXNodeObject::NativeTextAlternative( source.related_objects = *related_objects; source.text = text_alternative; } else { - return text_alternative; + return text_alternative.StripWhiteSpace(); } } else if (name_sources) { name_sources->back().invalid = true; @@ -2589,7 +2722,7 @@ String AXNodeObject::NativeTextAlternative( // 5.2 input type="button", input type="submit" and input type="reset" if (input_element && input_element->IsTextButton()) { // value attribue - name_from = kAXNameFromValue; + name_from = ax::mojom::NameFrom::kValue; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative, valueAttr)); name_sources->back().type = name_from; @@ -2612,7 +2745,7 @@ String AXNodeObject::NativeTextAlternative( String default_label = input_element->ValueOrDefaultLabel(); if (value.IsNull() && !default_label.IsNull()) { // default label - name_from = kAXNameFromContents; + name_from = ax::mojom::NameFrom::kContents; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2636,8 +2769,8 @@ String AXNodeObject::NativeTextAlternative( // alt attr const AtomicString& alt = input_element->getAttribute(altAttr); const bool is_empty = alt.IsEmpty() && !alt.IsNull(); - name_from = - is_empty ? kAXNameFromAttributeExplicitlyEmpty : kAXNameFromAttribute; + name_from = is_empty ? ax::mojom::NameFrom::kAttributeExplicitlyEmpty + : ax::mojom::NameFrom::kAttribute; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative, altAttr)); name_sources->back().type = name_from; @@ -2659,7 +2792,7 @@ String AXNodeObject::NativeTextAlternative( name_sources->push_back(NameSource(*found_text_alternative, valueAttr)); name_sources->back().type = name_from; } - name_from = kAXNameFromAttribute; + name_from = ax::mojom::NameFrom::kAttribute; String value = input_element->value(); if (!value.IsNull()) { text_alternative = value; @@ -2672,8 +2805,27 @@ String AXNodeObject::NativeTextAlternative( } } + // title attr + if (name_sources) { + name_sources->push_back(NameSource(*found_text_alternative, titleAttr)); + name_sources->back().type = name_from; + } + name_from = ax::mojom::NameFrom::kTitle; + const AtomicString& title = input_element->getAttribute(titleAttr); + if (!title.IsNull()) { + text_alternative = title; + if (name_sources) { + NameSource& source = name_sources->back(); + source.attribute_value = title; + source.text = text_alternative; + *found_text_alternative = true; + } else { + return text_alternative; + } + } + // localised default value ("Submit") - name_from = kAXNameFromValue; + name_from = ax::mojom::NameFrom::kValue; text_alternative = input_element->GetLocale().QueryString( WebLocalizedString::kSubmitButtonDefaultLabel); if (name_sources) { @@ -2691,7 +2843,7 @@ String AXNodeObject::NativeTextAlternative( // 5.1 Text inputs - step 3 (placeholder attribute) if (html_element && html_element->IsTextControl()) { - name_from = kAXNameFromPlaceholder; + name_from = ax::mojom::NameFrom::kPlaceholder; if (name_sources) { name_sources->push_back( NameSource(*found_text_alternative, placeholderAttr)); @@ -2711,9 +2863,11 @@ String AXNodeObject::NativeTextAlternative( return text_alternative; } } + } - // Also check for aria-placeholder. - name_from = kAXNameFromPlaceholder; + // Also check for aria-placeholder. + if (IsTextControl()) { + name_from = ax::mojom::NameFrom::kPlaceholder; if (name_sources) { name_sources->push_back( NameSource(*found_text_alternative, aria_placeholderAttr)); @@ -2740,7 +2894,7 @@ String AXNodeObject::NativeTextAlternative( // 5.7 figure and figcaption Elements if (GetNode()->HasTagName(figureTag)) { // figcaption - name_from = kAXNameFromRelatedElement; + name_from = ax::mojom::NameFrom::kRelatedElement; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2785,8 +2939,8 @@ String AXNodeObject::NativeTextAlternative( // alt const AtomicString& alt = GetAttribute(altAttr); const bool is_empty = alt.IsEmpty() && !alt.IsNull(); - name_from = - is_empty ? kAXNameFromAttributeExplicitlyEmpty : kAXNameFromAttribute; + name_from = is_empty ? ax::mojom::NameFrom::kAttributeExplicitlyEmpty + : ax::mojom::NameFrom::kAttribute; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative, altAttr)); name_sources->back().type = name_from; @@ -2808,7 +2962,7 @@ String AXNodeObject::NativeTextAlternative( // 5.9 table Element if (auto* table_element = ToHTMLTableElementOrNull(GetNode())) { // caption - name_from = kAXNameFromCaption; + name_from = ax::mojom::NameFrom::kCaption; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2839,7 +2993,7 @@ String AXNodeObject::NativeTextAlternative( } // summary - name_from = kAXNameFromAttribute; + name_from = ax::mojom::NameFrom::kAttribute; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative, summaryAttr)); name_sources->back().type = name_from; @@ -2862,7 +3016,7 @@ String AXNodeObject::NativeTextAlternative( // Per SVG AAM 1.0's modifications to 2D of this algorithm. if (GetNode()->IsSVGElement()) { - name_from = kAXNameFromRelatedElement; + name_from = ax::mojom::NameFrom::kRelatedElement; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2897,7 +3051,7 @@ String AXNodeObject::NativeTextAlternative( // Fieldset / legend. if (IsHTMLFieldSetElement(GetNode())) { - name_from = kAXNameFromRelatedElement; + name_from = ax::mojom::NameFrom::kRelatedElement; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2934,7 +3088,7 @@ String AXNodeObject::NativeTextAlternative( if (IsWebArea()) { Document* document = this->GetDocument(); if (document) { - name_from = kAXNameFromAttribute; + name_from = ax::mojom::NameFrom::kAttribute; if (name_sources) { name_sources->push_back( NameSource(found_text_alternative, aria_labelAttr)); @@ -2958,7 +3112,7 @@ String AXNodeObject::NativeTextAlternative( } } - name_from = kAXNameFromRelatedElement; + name_from = ax::mojom::NameFrom::kRelatedElement; if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative)); name_sources->back().type = name_from; @@ -2992,25 +3146,25 @@ String AXNodeObject::NativeTextAlternative( return text_alternative; } -String AXNodeObject::Description(AXNameFrom name_from, - AXDescriptionFrom& description_from, +String AXNodeObject::Description(ax::mojom::NameFrom name_from, + ax::mojom::DescriptionFrom& description_from, AXObjectVector* description_objects) const { AXRelatedObjectVector related_objects; String result = Description(name_from, description_from, nullptr, &related_objects); if (description_objects) { description_objects->clear(); - for (size_t i = 0; i < related_objects.size(); i++) - description_objects->push_back(related_objects[i]->object); + for (NameSourceRelatedObject* related_object : related_objects) + description_objects->push_back(related_object->object); } result = CollapseWhitespace(result); - if (RoleValue() == kSpinButtonRole && DatetimeAncestor()) { + if (RoleValue() == ax::mojom::Role::kSpinButton && DatetimeAncestor()) { // Fields inside a datetime control need to merge the field description // with the description of the
elements and are not backed by - // DOM text nodes. We can't mark them as text objects for that reason. + // Objects with |ax::mojom::Role::kLineBreak| are HTML
elements and are + // not backed by DOM text nodes. We can't mark them as text objects for that + // reason. switch (RoleValue()) { - case kInlineTextBoxRole: - case kStaticTextRole: + case ax::mojom::Role::kInlineTextBox: + case ax::mojom::Role::kStaticText: return true; default: return false; @@ -820,21 +836,22 @@ bool AXObject::IsClickable() const { if (IsButton() || IsLink() || IsTextControl()) return true; - // TODO(dmazzoni): Ensure that kColorWellRole and kSpinButtonRole are - // correctly handled here via their constituent parts. + // TODO(dmazzoni): Ensure that ax::mojom::Role::kColorWell and + // ax::mojom::Role::kSpinButton are correctly handled here via their + // constituent parts. switch (RoleValue()) { - case kCheckBoxRole: - case kComboBoxMenuButtonRole: - case kDisclosureTriangleRole: - case kListBoxRole: - case kListBoxOptionRole: - case kMenuItemCheckBoxRole: - case kMenuItemRadioRole: - case kMenuItemRole: - case kMenuListOptionRole: - case kRadioButtonRole: - case kSwitchRole: - case kTabRole: + case ax::mojom::Role::kCheckBox: + case ax::mojom::Role::kComboBoxMenuButton: + case ax::mojom::Role::kDisclosureTriangle: + case ax::mojom::Role::kListBox: + case ax::mojom::Role::kListBoxOption: + case ax::mojom::Role::kMenuItemCheckBox: + case ax::mojom::Role::kMenuItemRadio: + case ax::mojom::Role::kMenuItem: + case ax::mojom::Role::kMenuListOption: + case ax::mojom::Role::kRadioButton: + case ax::mojom::Role::kSwitch: + case ax::mojom::Role::kTab: return true; default: return false; @@ -1099,7 +1116,7 @@ bool AXObject::DispatchEventToAOMEventListeners(Event& event) { // Bubbling phase. event.SetEventPhase(Event::kBubblingPhase); - for (size_t i = 1; i < event_path.size(); i++) { + for (wtf_size_t i = 1; i < event_path.size(); i++) { event.SetCurrentTarget(event_path[i]); event_path[i]->FireEventListeners(event); if (event.PropagationStopped()) @@ -1133,10 +1150,10 @@ const AXObject* AXObject::DisabledAncestor() const { const AXObject* AXObject::DatetimeAncestor(int max_levels_to_check) const { switch (RoleValue()) { - case kDateTimeRole: - case kDateRole: - case kInputTimeRole: - case kTimeRole: + case ax::mojom::Role::kDateTime: + case ax::mojom::Role::kDate: + case ax::mojom::Role::kInputTime: + case ax::mojom::Role::kTime: return this; default: break; @@ -1185,17 +1202,17 @@ bool AXObject::CanReceiveAccessibilityFocus() const { bool AXObject::CanSetValueAttribute() const { switch (RoleValue()) { - case kColorWellRole: - case kDateRole: - case kDateTimeRole: - case kScrollBarRole: - case kSliderRole: - case kSpinButtonRole: - case kSplitterRole: - case kTextFieldRole: - case kTextFieldWithComboBoxRole: - case kTimeRole: - case kSearchBoxRole: + case ax::mojom::Role::kColorWell: + case ax::mojom::Role::kDate: + case ax::mojom::Role::kDateTime: + case ax::mojom::Role::kScrollBar: + case ax::mojom::Role::kSlider: + case ax::mojom::Role::kSpinButton: + case ax::mojom::Role::kSplitter: + case ax::mojom::Role::kTextField: + case ax::mojom::Role::kTextFieldWithComboBox: + case ax::mojom::Role::kTime: + case ax::mojom::Role::kSearchBox: return Restriction() == kNone; default: break; @@ -1213,7 +1230,7 @@ bool AXObject::CanSetFocusAttribute() const { // Children of elements with an aria-activedescendant attribute should be // focusable if they have a (non-presentational) ARIA role. - if (!IsPresentational() && AriaRoleAttribute() != kUnknownRole && + if (!IsPresentational() && AriaRoleAttribute() != ax::mojom::Role::kUnknown && CanBeActiveDescendant()) { return true; } @@ -1228,7 +1245,8 @@ bool AXObject::CanSetFocusAttribute() const { // don't help when the