GNOME Bugzilla – Bug 682523
a11y: need a way to specify a relation between and object and more than one label
Last modified: 2021-07-05 14:20:21 UTC
Background: from the accessibility point of view, each relevant ui element should have a proper name. This can be achieved by setting directly the name to the accessible object, or if any label is available, set a relation between the object and the label. At the Shell Toolkit, for simplicity sake, we initially added a one-to-one relation. We added a property called label_actor, so if you do something like: my_object.label_actor = my_label You are saying that my_object is labelled by my_label. But we have started to find cases that this is not enough. One example is the items on the power menu. One label is "Laptop Battery" and the other is "83%". So IMHO, it is required a way to define more that one relation. My proposal is: * Change the private structure at StWidget in order to have a list of labels instead of just one. * Maintain label_actor property, as a convenient way to specify a one-to-one relation (most of the cases) * Add two methods on st: st_widget_add_label_actor: this will add a new relation st_widget_flush_label_actors: this will clean all the relations Someone could wonder why a flush_label_actors intead of remove. This is because I feel that a _remove method will be hard to use. By my experience, when you use the property label_actor is because you need to override the label_actor set by your parent. And usually at that moment you don't have the label to remove, so it would be easier to just clean all the relationships and start again. In any case, add a _remove method could be easy. With those new methods, label_actor set_property can be easily implemented as a flush and a add. Note: this is not something really new. gtk has a way to specify more than one relation with a label. On gtk when you use gtk_widget_add_mnemonic_label, automatically it add a relation between the widget and the label. Note2: this is not something really new2. As we are talking about javascript, this list of labels are equivalent to aria-labelledby property: http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.