Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313453 - [Accessibility] AccessibleShapesExample doesn't show image properties
Summary: [Accessibility] AccessibleShapesExample doesn't show image properties
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 3.5 RC2   Edit
Assignee: Scott Kovatch CLA
QA Contact: Carolyn MacLeod CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 20:18 EDT by Scott Kovatch CLA
Modified: 2010-05-19 18:02 EDT (History)
1 user (show)

See Also:
carolynmacleod4: review+
Silenio_Quarti: review+


Attachments
Fix (938 bytes, patch)
2010-05-18 20:19 EDT, Scott Kovatch CLA
no flags Details | Diff
New fix (2.83 KB, patch)
2010-05-19 12:59 EDT, Scott Kovatch CLA
no flags Details | Diff
other patch (938 bytes, patch)
2010-05-19 14:44 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Kovatch CLA 2010-05-18 20:18:11 EDT
I20100516-0800

The AccessibleShapesExample doesn't pick up the accessibility titles of the shapes. They also report a children attribute, which isn't right.

Run the AccessibleShapesExample and then turn on Accessibility Inspector to see the problems.
Comment 1 Scott Kovatch CLA 2010-05-18 20:19:52 EDT
Created attachment 169034 [details]
Fix
Comment 2 Scott Kovatch CLA 2010-05-18 20:20:21 EDT
Comment on attachment 169034 [details]
Fix

Nice and simple. Just add the missing attributes and remove the incorrect ones.
Comment 3 Silenio Quarti CLA 2010-05-19 12:14:02 EDT
I do not think you can remove the children attribute all the time. The canvas could have a real child ( a label or something). I see the Accessibility Verifier gives a warning. Is that the only problem?

public static void main(String[] args) {
		display = new Display();
		shell = new Shell(display);
		shell.setLayout(new FillLayout());
		
		Shape redSquare = new Shape(shell, SWT.NONE);
		redSquare.setColor(SWT.COLOR_RED);
		redSquare.setShape(Shape.SQUARE);
		
		Label label = new Label(redSquare, SWT.NONE);
		label.setText("Label");
		label.setBounds(10, 10, 30, 30);
		
		Shape blueCircle = new Shape(shell, SWT.NONE);
		blueCircle.setColor(SWT.COLOR_BLUE);
		blueCircle.setShape(Shape.CIRCLE);

		Shape greenSquare = new Shape(shell, SWT.NONE);
		greenSquare.setColor(SWT.COLOR_GREEN);
		greenSquare.setShape(Shape.SQUARE);

		shell.pack();
		shell.open();
		redSquare.setFocus();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
	}
Comment 4 Scott Kovatch CLA 2010-05-19 12:28:30 EDT
(In reply to comment #3)
> I do not think you can remove the children attribute all the time. The canvas
> could have a real child ( a label or something). I see the Accessibility
> Verifier gives a warning. Is that the only problem?

Accessibility Inspector was complaining, yes. That's why I noticed it. 

The notion of an image having a child is somewhat mindblowing, but I see your point.

I need to rethink this a bit. The real problem is that the AXTitle needs to be added to the set because the AccessibleListener implemented getName() and not just because ROLE_GRAPHIC is being used.
Comment 5 Scott Kovatch CLA 2010-05-19 12:59:56 EDT
Created attachment 169151 [details]
New fix

See if a description or title is being provided by any of the listeners, and if so add the Cocoa attribute to the list. We really should do this for all of the things that accessible listeners can provide, but at this point in the release cycle this is the bare minimum I think we need to do.
Comment 6 Silenio Quarti CLA 2010-05-19 14:44:21 EDT
Created attachment 169183 [details]
other patch

Car and I think it is better keep the fix simple for now. Just add the attributes needed for GRAPHIC. We can rethink this in 3.7. Is that ok?
Comment 7 Scott Kovatch CLA 2010-05-19 15:13:09 EDT
(In reply to comment #6)
> Car and I think it is better keep the fix simple for now. Just add the
> attributes needed for GRAPHIC. We can rethink this in 3.7. Is that ok?

You end up with AXDescription showing up as an empty string in Accessibility Inspector because nothing implements the description property. It's not correct, but also not critical -- VoiceOver still works as expected.

I do think we need to make the general fix, but this is better than nothing given where we are in 3.6.
Comment 8 Carolyn MacLeod CLA 2010-05-19 15:33:25 EDT
Good to go. I think a graphic is more likely to have a description than many other roles, particularly if it is a complicated image.
Comment 9 Scott Kovatch CLA 2010-05-19 17:54:52 EDT
Only the second patch here was committed. I'm leaving the first visible so we can go back to it for the general fix. 

Fixed > 20100519.