-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AccessibleRole::Image
and use it in the AboutSlint
widget
#7593
base: master
Are you sure you want to change the base?
Conversation
AccessibleRole::Image
and use it in the AboutSlint
widget
We set the default role for Text there.
But it is true that if in practice, the images won't have a label by default so it might not be so useful to apply the role if no label is set? The patch looks good but perhaps the documentation of the image role could be extended a bit to explain that it is not set by default (if we choose not to set it by default) and what kind of image it should apply to in combination to what other accessible properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guts feeling is that it makes sense to let this be opt-in: exposing the image to assistive tech when there is a label, and otherwise not.
(I thought perhaps it would make sense to have a default for the label extracted from image metadata, but that may not be translated or contextually correct)
Even images without alternative description can be useful these days. If I launch the Gallery app with the Windows Narrator running, then go to the About tab, navigate to the image and press CapsLock+Control+D, the image is described as "A logo for a company". Not super great, but I think recent VoiceOver versions have better image recognition models built-in. If we make images accessible by default, I'm afraid they will be cluttered by irrelevant nodes. We'd have to hide the "check-mark" icon on the CheckBox for instance because keeping it would be annoying. I agree that the accessible role should be mentioned on the documentation of the Image element. |
How is the image data given to the model? |
Perhaps via grabbing the pixels from the framebuffer? The bounds of the image/node within the window are known. |
Yes I think that's exactly how it works. But for that the assistive technology have to know that there is a node on which it can perform image recognition, hence this new role. I'll do the documentation tomorrow. |
I'm not entirely sure whether images should be part of the accessibility tree by default or not, and I wouldn't want to make a bad choice for Slint. I'm going to reach out to more knowledgeable people to discuss this matter and I'll update you here. |
Introduces a new
AccessibleRole
to represent images and maps it to the appropriate role for each accessibility backend. The role could be set by default but (1) it would probably have to be done in a compiler pass and (2) theImage
widget is already used extensively to represent icons and other visual elements that really should not be part of the accessibility tree, so it would be annoying to setaccessible-role: none
everywhere.I took this opportunity to improve the
AboutSlint
widget. I chose "#MadeWithSlint" as the label because I think this is the most important piece of information carried out by the image, but this is your branding so feel free to suggest something else.