Bugzilla – Bug 516214
Must define "focused" behavior for top-level drop-down menus
Last modified: 2009-07-01 15:05:09 UTC
PROBLEM STATEMENT This has been a question of mine and probably other tests for a while now. Hopefully we can address it with this bug. I am using the term "Top-level drop-down menu" to refer to those menus that are showing on the MenuStrip, MainMenu, or ToolStrip. For example, the "File" and "Edit" menus are generally two top-level drop-down menus on many applications. The problem is that the MenuStrip, MainMenu, and ToolStrip top-level drop-down menus have different behavior. A top-level ToolStrip menu has the "focusable" state and a top-level MenuStrip menu does not. However, both accessibles do receive the "focused" state. MainMenu is a different case, I think. For MenuStrip and ToolStrip, the keyboard can be used to navigate between the menus without dropping them down. That does not seem to be possible for the MainMenu control, so I don't think there is any question that the top-level drop-down menus of the MainMenu control should not have the "focusable" state (unless I'm missing something). (For what it's worth, the MainMenu top-level drop-down menus currently do have the "focusable" state, but I have logged a separate bug--Bug 516151--for that.) In Windows, UI Spy says that isKeyboardFocusable is false for these menus, but the menus do become focused in Windows also. Gtk+ is a good example for the MenuStrip and ToolStrip controls because when such a drop-down menu is dropped down, the first menu item automatically gets the keyboard focus (see uia2atk/test/samples/gtkmenubar.py for an example). However, a drop-down combo box top-level menu does receive the "focused" state despite not having a "focusable" state. I have logged bgo#583748 for that issue. Additionally, The Gtk+ GUI behavior does match that of the MainMenu control, so we can use Gtk+ as a guide there. In Mono, a drop-down combo box top-level menu also receives the "focused" state despite not having a "focusable" state. I have logged Bug 506745 for this. As mentioned, despite isKeyboardFocusable being false in Windows, the top-level drop-down menus can receive keyboard focus and the "focused" state in both Windows and Mono. Normally you can press Alt+F to open a "File" menu and then press the escape key, then you can use the left and right arrow keys to move the keyboard focus between the top-level drop-down menus. REPRO 1. Run uia2atk/test/samples/menustrip.py or toolstripmenuitem.py. 2. Run Accerciser, click on the "Interface Viewer" tab, and expand the "Accessible" expander. 3. If working with the menustrip.py sample, browse to and select the "File" menu and notice that it does not have the "focusable" state. If working with the toolstripmenuitem.py sample, browse to and select the "View" menu and notice that it does have the "focusable" state. 4. Press Alt+Tab to return to the sample application (opened in step 1). 5. If working with the menustrip.py sample, press Alt+F to drop down the "File" menu. If working with the toolstripmenuitem.py sample, press Alt+V to drop down the "View" menu. 6. Press escape to close the drop-down menu. Focus should state on the menu that was previous dropped-down. At this point you should be able to use the right and left arrows to change the keyboard focus between the top-level menus. Note: Because of Bug 516202 (for ToolStrip) and Bug 516151 (for MainMenu), REPRO step 5 will actually give the top-level drop-down menu accessible the "focused" state when it definitely should not. So, you should use the left and right arrow keys away from and back to the menu selected in step 3. RESULTS When the keyboard is moved to the accessible selected in REPRO step 3, the interface viewer will show that that accessible has the "focused" state. EXPECTED RESULTS We must decide! I am really fine with any behavior here as long as it is sane and consistent. COMMENTS Another thing to consider is that when the mouse hovers over a top-level drop down menu when the menu is not dropped down, the top-level menu also receives the "focused" state. This is even true in Gtk, where the top-level drop-down menus do not have the "focusable" state.
CCing the QA team so they are aware of this.