nvda
b9a8fbc0 - Make support for search suggestions more generic, supporting Excel comment mentions and Google Chrome location bar suggestions (#14222)

Commit
3 years ago
Make support for search suggestions more generic, supporting Excel comment mentions and Google Chrome location bar suggestions (#14222) Fixes #13772 Fixes #13764 Fixes #13522 Summary of the issue: • When starting to type an @mention in a Microsoft Excel comment, NVDA does not report available suggestions when arrowing through them. ( [Excel- Add @mention]: Screen Reader Users are not Notified when Search Suggestions Appear after Typing "@" in the comment  #13764) • When typing in the Google Chrome location bar, NVDA does not report rich information for each suggestion, nor does it report when a suggestions control (switch to tb, remove suggestion) is selected. (Chrome: Omnibox: User is not notified of useful information in the first item of keyword search #13522) • As a developer, adding support for new suggestion scenarios is tedious as specific mappings must be always made. Description of user facing changes • NVDA will now report the selected suggestion when arrowing through suggestions when typing an @mention in a Microsoft Excel comment. • NVDA will report the selected suggestion or suggestion control (switch to tab, remove suggestion) in the Google Chrome location bar. Description of development approach Make support for suggestions on editable text fields more generic, allowing it to be supported in more places without having to specifically choose particular overlay classes. This adds support for reporting @mention suggestions in Microsoft Excel comments, and reporting of suggestions and related controls in the Google Chrome location bar. Specific changes: * IAccessible NVDAObject: implement the controllerFor property making use of IAccessible2 relations * NVDAObject: add an isDescendantOf method which should return True if the object this method is called on is a descendant of the given obj argument. The base method raises NotImplementedError. Efficient implementations for UIA and Ia2Web have been provided. * Implement event_selection on the base NVDAObject, which reports the object being selected, if the current focus is controlling an ancestor of the selected object. This replaces SuggestionListItem UIA NVDAObject's event_UIA_elementSelected logic. Now it is more generic, and works purely on tree topology, rather than checking the name and appModule etc. * Remove event_selection implementation from IAccessible NvDAObject as the base handles this now. * Add an event_controllerForchange method to the base NVDAObject which does nothing. * UIA NVDAObject: implement event_UIA_controllerforchange to directly call event_controllerforchange, allowing for more generic code, but still backwards compatibility for subclasses to still override event_UIA_controllerforchange if they need to. * behaviours: * Rename EditableTextWithSuggestions to InputFieldWithSuggestions and inherit directly from NVDAObject making this class more generic. * InputFieldWithSuggestions class: implement event_controllerForChange which will fire the suggestionsOpened and suggestionsClosed events based on whether there are objects in the controllerfor list. this code was taken from SearchField UIA NVDAObject's event_UIA_controllerforchange. * Rename EditableText to EditabletextBase * Add a replacement EditableTextWithSuggestions class that inherits from both InputFieldWithSuggestions and EditableTextBase * Add a replacement EditableText class which inherits from EditableTextwithSuggestions and EditableTextBase. Essentially all this builds suggestion support into EditableText, but keeps the EditableTextWithSuggestionsClass specifically available for compatibility.
Parents
Loading