Bugzilla – Bug 456343
ComboBox_DropDown: menu item role is missing "showing" state
Last modified: 2009-01-04 03:26:40 UTC
PROBLEM STATEMENT: in r120682: "menu item" role is missing "showing" state even though drop down the menu list REPRO: 1. run accerciser 2. run uia2atk/test/samples/combobox_dropdown.py 3. in accerciser, expand 'ipy' on the left tree, select item which is with "menu item" role, see states list under "interface viewer" 4. click combobox to drop down menu list to show menu items, see states list RESULTS: "menu item" is missing "showing" state EXPECTED RESULTS: expect "showing" state when drop down menu list to show menu items
this test due 12/10, I give it P1 priority
Brad fixed in trunk: UiaAtkBridge 120743 UIAutomationWinforms fixed in trunk: r120795 Should fix all ComboBox styles: Simple, DropDown and DropDownList.
Fixed a minor typo in UIAutomationWinforms r120797, use that revision instead of r120795.
hi Mario, it still have problem in r120801, please run combobox_dropdown.py, then run below script: 1. you would see only menuitem0 have "showing" state, I think when expand the menu all menu items should have showing state. 2. another problem is menuitem[1] is default selected in this example which I think should have "selected" states until select another one 3. do you think menu item should have "focused" state? because menu items in gtk.comboboxentry(samples/gtkcomboboxentry.py) have "focused" state when you keycombo up/down or click to select the items menuitem[0] states: [STATE_ENABLED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE] menuitem[1] states: [STATE_ENABLED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_VISIBLE] menuitem[2] states: [STATE_ENABLED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_VISIBLE] pyatspi script: #!/usr/bin/env python import pyatspi reg = pyatspi.Registry desktop = reg.getDesktop(0) ipy = pyatspi.findDescendant(desktop, lambda x: x.name == 'ipy' and x.getRoleName() == 'application') combobox = pyatspi.findDescendant(ipy, lambda x: x.getRoleName() == 'combo box') action = combobox.queryAction() action.doAction(0) menuitem = pyatspi.findAllDescendants(ipy, lambda x: x.getRoleName() == 'menu item') print "menuitem[0] states: ", menuitem[0].getState().getStates() print "menuitem[1] states: ", menuitem[1].getState().getStates() print "menuitem[2] states: ", menuitem[1].getState().getStates()
I'm not sure about the default states in MenuItem, maybe Andres can help us.
I'm stuck to help on this one because I've written a test that should be working, but doesn't pass in GailTest! The patch is: Index: UiaAtkBridge/Test/AtkTest/AtkTests.cs =================================================================== --- UiaAtkBridge/Test/AtkTest/AtkTests.cs (revision 120927) +++ UiaAtkBridge/Test/AtkTest/AtkTests.cs (working copy) @@ -656,11 +657,39 @@ Atk.Selection atkSelection = CastToAtkInterface <Atk.Selection> (accessible); InterfaceSelection (atkSelection, names, accessible, type); + + States (firstComboBoxItem, + Atk.StateType.Enabled, + Atk.StateType.Selectable, //yes! even not having Atk.Selection + Atk.StateType.Sensitive, + Atk.StateType.Visible, + Atk.StateType.Showing); + + Console.WriteLine ("detenido"); + System.Threading.Thread.Sleep (100000); + States (secondComboBoxItem, + Atk.StateType.Enabled, + Atk.StateType.Selectable, //yes! even not having Atk.Selection + Atk.StateType.Sensitive, + Atk.StateType.Visible); //check the Action impl of a comboboxitem (menuitem role) atkAction = CastToAtkInterface <Atk.Action> (secondComboBoxItem); InterfaceAction (BasicWidgetType.ComboBoxItem, atkAction, secondComboBoxItem); + States (secondComboBoxItem, + Atk.StateType.Enabled, + Atk.StateType.Selectable, //yes! even not having Atk.Selection + Atk.StateType.Sensitive, + Atk.StateType.Visible, + Atk.StateType.Showing); + + States (firstComboBoxItem, + Atk.StateType.Enabled, + Atk.StateType.Selectable, //yes! even not having Atk.Selection + Atk.StateType.Sensitive, + Atk.StateType.Visible); + //FIXME: uncomment this when we can test interfaces negatively: //Assert.IsNull (CastToAtkInterface <Atk.Selection> (firstComboBoxItem)); }
Calen, your script has no output when I run it, so I'm using Accerciser to explore this bug. Now that I'm looking at this bug, I'd like to make sure I understand the remaining issues, as the problem listed in the summary seems to have been solved (the "showing" state seems to work exactly like it is supposed to): 1) The item that is initially selected should have the "selected" state. 2) MenuItems should potentially have the "focused" state when they are selected. Am I missing anything?
Hi Sandy, I got your message from IRC. I tried this issue in trunk r121661, MenuItems now have "showing" state when click combobox. (1)but the initially selected MenuItem "1" still is missing "selected", "focused", "showing" when click combobox showing menu list. (2)you are right that I think MenuItems should have "focused" and "selected" states when they are selected by keyUp/Down or click, it has been fixed in trunk r121661. *but seems it has a problem, you know "text" role always have "focused" state that would focus MenuItem and Text in duplicate(I remember Mike said we just can focus one widget once time). so I have no idea how should we do, maybe Text role should get rid of "focused" when menu list is showing by clicking combobox. do you have any idea?
I'm back working on this issue to help Sandy out. Testing with r122306, I'm seeing the following: menuitem[0] states: [STATE_ENABLED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_VISIBLE] menuitem[1] states: [STATE_ENABLED, STATE_FOCUSED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE] menuitem[2] states: [STATE_ENABLED, STATE_FOCUSED, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE] The only thing to me that seems peculiar is that menuitem 1 and 2 both have Focused. I'll look into that now.
Actually you need to run ./combobox_dropdown.py and re-select 1 to get Focused to show up twice. Otherwise, no control shows Focused.
There's a bug in the script, so comment #9 is erroneous: print "menuitem[1] states: ", menuitem[1].getState().getStates() -print "menuitem[2] states: ", menuitem[1].getState().getStates() +print "menuitem[2] states: ", menuitem[2].getState().getStates() Aside from this, I fixed an issue in r122307 where SELECTED wasn't being set initially and everything is behaving correctly in the test and using accerciser. Hopefully this will put this issue to rest once and for all, marking FIXED.
Closed in trunk r122387: all menuitems have showing state when click combobox