Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315812

Summary: [accessibility] text-based ToolItems read out their help/tooltip text instead of text
Product: [Eclipse Project] Platform Reporter: Scott Kovatch <skovatch>
Component: SWTAssignee: Scott Kovatch <skovatch>
Status: RESOLVED FIXED QA Contact: Carolyn MacLeod <carolynmacleod4>
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.6Flags: carolynmacleod4: review+
Target Milestone: 3.6.1   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 340196    
Attachments:
Description Flags
Fix none

Description Scott Kovatch CLA 2010-06-04 14:01:36 EDT
Build ID: I20100603-1500

VoiceOver reads back the tooltip help of a ToolItem with text. It should read the text if the tool item is just a button.

1. Launch org.eclipse.swt.examples.accessibility.ControlsWithLabelsExample
2. Turn on VoiceOver.
3. Move the VoiceOver cursor to the Toolbar. The ToolItems are labelled "Item0", "Item1", "Item2".

--> VoiceOver reads back "ToolItem ToolTip0", which is the tooltip text for Item0. It should have said Item0 because it's a text button.

Not a 3.6 regression.
Comment 1 Scott Kovatch CLA 2010-06-04 14:04:20 EDT
I will aim to fix this for 3.6.1.
Comment 2 Carolyn MacLeod CLA 2010-06-04 14:28:53 EDT
After fixing, please make sure that Eclipse tool items are still read correctly (they use the SWT accessibility API and override getName to return the tool item's tooltip as its accessible name).
Comment 3 Scott Kovatch CLA 2010-06-04 14:35:59 EDT
(In reply to comment #2)
> After fixing, please make sure that Eclipse tool items are still read correctly
> (they use the SWT accessibility API and override getName to return the tool
> item's tooltip as its accessible name).

That value should only be used when the image of an Item is null, right?
Comment 4 Carolyn MacLeod CLA 2010-06-04 14:54:24 EDT
You know, that's a very good question, and one I don't know the answer to.
On Windows, the getWindowText (what shows up on the display) and the get_accName (what the screen reader is *supposed* to say) really are 2 different things, and they can be set separately.

However, I have yet to see a screen reader that speaks the accName if there is non-null WindowText for a button, label, or tool item. I'll have to check if any new versions of screen reader speak the accName, but the last time I tried it, they didn't.
Comment 5 Scott Kovatch CLA 2010-06-04 17:23:17 EDT
If there's no tooltip text the button title is used, so that's correct. The logic is this:

--------

if (nsAttributeName.isEqualToString (OS.NSAccessibilityTitleAttribute) || nsAttributeName.isEqualToString (OS.NSAccessibilityDescriptionAttribute)) {
		String accessibleText = toolTipText;
		if (accessibleText == null || accessibleText.equals("")) accessibleText = text;
		if (!(accessibleText == null || accessibleText.equals(""))) {
			return NSString.stringWith(accessibleText).id;
		} else {
			return NSString.string().id;
		}
}

--------

I think the title and description should be handled separately, much like buttons are.
Comment 6 Scott Kovatch CLA 2010-06-15 13:41:57 EDT
Created attachment 171968 [details]
Fix

NSAccessibilityTitleAttribute now returns the Item text if available and the tooltipText if not. NSAccessibilityHelpAttribute always returns the tooltip text. NSAccessibilityDescriptionAttribute was an optional attribute, and not what we should be using here.
Comment 7 Scott Kovatch CLA 2010-06-15 13:42:28 EDT
Car, please review. (Following the 3.6.1 plan for reviews for fixes...)
Comment 8 Scott Kovatch CLA 2010-07-13 18:15:28 EDT
*** Bug 319677 has been marked as a duplicate of this bug. ***
Comment 9 Scott Kovatch CLA 2010-07-13 18:19:28 EDT
Fixed in HEAD > 20100713.
Comment 10 Carolyn MacLeod CLA 2010-07-13 23:08:42 EDT
Sorry, Scott. The fix looks good - go ahead for 3.6.1 as well.
Comment 11 Scott Kovatch CLA 2010-07-14 12:23:21 EDT
Thanks! I wasn't pushing you -- I just didn't want to hold up a mainline fix for Markus.
Comment 12 Scott Kovatch CLA 2010-07-14 12:26:46 EDT
Fixed in R3_6_maintenance branch > 20100714.
Comment 13 Carolyn MacLeod CLA 2010-07-14 13:21:13 EDT
> I wasn't pushing you
No worries! It just seemed like a good time to do the review.  ;)