Repository: nvaccess/nvda

Issue:
Handling ARIA 1.1 Combobox is broken in Chrome and Firefox
ARIA 1.0 combobox role should be applied to `<input>`, but ARIA 1.1 combobox role is being applied to a container.

NVDA seems to handle ARIA 1.0 comboboxes ok. But handling ARIA 1.1 comboboxes is broken:
  1. In Browse mode NVDA just skips the combobox and its entire contents including `<input>` inside the container with `role=combobox`.
  2. I can use Tab to focus the `<input>` inside the container with `role=combobox`, but when that `<input>` has focus, switching between Browse/Focus modes doesn't work.
  3. The Next Combobox shortcut doesn't work as well (saying «no next combobox»).

The reference example: https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html.

Installed NVDA 2019.1.1, Windows 10.

I am currently reproing it in Chrome Version 74.0.3729.169 (Official Build) (64-bit) and in Firefox 67.0 (64-bit).


Discussion:
@mshoho: Please add all webbrowsers (incl. version), where this issue occurs, to the issue description. Thanks.
CC: @jcsteh and @MarcoZehe
I am currently reproing it in Chrome Version 74.0.3729.169 (Official Build) (64-bit) and in Firefox 67.0 (64-bit).
cc: @jcsteh is this exposed accordingly by Firefox? I think there was a discussion about this in another issue but I cannot find it just now.
Firefox exposes this correctly as far as I can see. This will require some changes to NVDA.
I tried adding a tabindex="0" attribute on the div with combobox role. It's better but it till not work as it should. It's not possible to type text into the input.
I also tried to add the input id in the aria-controls attribut, same result.

The only thing that seems broken about the 1.1 combobox in Firefox is that it never announces "combobox" when textbox gains focus. Try the official w3c examples here:

https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html

They seem to work well in Firefox with the above noted exception.


> The only thing that seems broken about the 1.1 combobox in Firefox is that it never announces "combobox" when textbox gains focus. Try the official w3c examples here:
> 
> https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
> 
> They seem to work well in Firefox with the above noted exception.

No. I have just specifically upgraded Firefox to 67.0.4 and retested. The combobox is skipped in the browse mode, the focus/browse mode switching doesn't work when the input of the combobox has focus, next combobox shortcut (C) says «no next combobox».

Resolving patch:
diff --git a/source/browseMode.py b/source/browseMode.py
--- a/source/browseMode.py
+++ b/source/browseMode.py
@@ -1582,8 +1582,12 @@ def _isNVDAObjectInApplication_noWalk(self, obj):
 		if (
 			# roles such as application and dialog should be treated as being within a "application" and therefore outside of the browseMode document. 
 			obj.role in self.APPLICATION_ROLES 
-			# Anything inside a combo box should be treated as being outside a browseMode document.
-			or (obj.container and obj.container.role==controlTypes.ROLE_COMBOBOX)
+			# Anything other than an editable text box inside a combo box should be
+			# treated as being outside a browseMode document.
+			or (
+				obj.role != controlTypes.ROLE_EDITABLETEXT and obj.container
+				and obj.container.role == controlTypes.ROLE_COMBOBOX
+			)
 		):
 			return True
 		return None


Test patch: