Summary: | [Accessibility] Table & Tree with no column headers say "sort button" on Leopard | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Carolyn MacLeod <carolynmacleod4> | ||||||
Component: | SWT | Assignee: | Carolyn MacLeod <carolynmacleod4> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | duongn, Silenio_Quarti, skovatch, steve_northover, swingler | ||||||
Version: | 3.3 | Keywords: | accessibility | ||||||
Target Milestone: | 3.4 RC2 | Flags: | Silenio_Quarti:
review+
duongn: review+ |
||||||
Hardware: | Macintosh | ||||||||
OS: | Mac OS X - Carbon (unsup.) | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Carolyn MacLeod
2008-04-22 16:54:39 EDT
I can get VoiceOver to stop saying "sort button" for invisible header buttons by using this extreme hack: - when the column headers are not visible: - set the title of the header buttons to space (must be space - empty string doesn't help) - set the height of the header buttons to 1 pixel instead of 0 This tells VoiceOver that there are some "visible" (by 1 pixel) column header buttons, and they do have a title, but there's no need to read it. So VoiceOver works exactly the way I would expect it to for invisible column headers - it simply reads the text for each item in the selected row. Since I am quite sure this very bad hack would cause a bunch of other problems, I'm still looking for a solution... In case it's useful, here is a reference to the Apple radar that was fixed - and now causes this problem for invisible header buttons: "DataBrowser's list view header buttons now report the kAXSortButton subrole (3502758)." Created attachment 100836 [details]
_patch.txt
This fixes the bug by telling VoiceOver that there is no header when the header is not visible.
SSQ and Duong, please drop by for a demo, and to review fix for RC2. The attached patch is only for Table, but the identical change fixes Tree also. Created attachment 100839 [details]
_patch.txt
Here is a similar patch that is also needed for List.
Sounds bad. Can't we get in the way and stop reporting "kAXSortButton subrole"? It didn't feel bad - I just return nothing when asked for the AXHeaderAttribute and the header isn't visible. I tried returning empty string when the AXRoleDescriptionAttribute was "sort button", but to do it properly (i.e. so it would be NLS safe) required more code and I couldn't quite get that to work. I'm not sure what would happen if I return nothing for AXSubroleAttribute when the outline would normally be returning AXSortButtonSubrole, but that feels "more bad" than just saying there's no header when there's no header. The role would have been already been reported (I believe the sort buttons are "AXOutlineRole:AXSortButtonSubrole" or "AXHeaderRole:AXSortButtonSubrole") and if I don't answer a subrole, then I think VO is going to assume it's looking at something else. What I am saying is that I think the current fix is quite nice, and it feels natural, and it feels safe. The patch looks more complicated than it really is because some code had to be moved up to be reused and some other code ended up inside an else. The 'meat' of the change is here (more comment lines than actual code <g>): if (attributeName.equals(OS.kAXHeaderAttribute)) { /* * Bug in the Macintosh. Even when the header is not visible, * VoiceOver still reports each column header's role for every row. * This is confusing and overly verbose. The fix is to return * "no header" when the screen reader asks for the header, by * returning noErr without setting the event parameter. */ code = OS.noErr; } Oops - that was the change for List (Hmm... I think the comment needs tweaking). The change for Table & Tree also does the getHeaderVisible() check (inline): if (attributeName.equals(OS.kAXHeaderAttribute)) { short [] height = new short [1]; OS.GetDataBrowserListViewHeaderBtnHeight (handle, height); if (height [0] == 0) { /* * Bug in the Macintosh. Even when the header is not visible, * VoiceOver still reports each column header's role for every row. * This is confusing and overly verbose. The fix is to return * "no header" when the screen reader asks for the header, by * returning noErr without setting the event parameter. */ code = OS.noErr; } } I read the words "extreme hack" and something about sizing to "one pixel" height and got scared. Ah, I see. I didn't use the "solution" that I mentioned in comment 1 - for that very reason. That one didn't feel right at all <g>. The patches in comment 2 and comment 4 are completely unrelated to the notes in comment 1. Sorry for the confusion. Fixed > 20080520 and the fix will be in 3.4 RC2. |