Skip to content
  • Emmanuele Bassi's avatar
    a11y: Compute the label for a GtkATContext · 21482e82
    Emmanuele Bassi authored
    The ARIA spec defines the mechanism for determining the name of an
    accessible element—see §4.3 of the WAI-ARIA spec.
    
    We follow the specification as much as it makes sense for GTK to do
    so:
    
     1. if the element is hidden, return an empty string
     1. if the element has a labelled-by relation set, retrieve the
        label of the related element
     2. if the element has a label property set, use the value of
        the property
     3. if neither labelled-by nor label attributes are set, we use
        the role to compute the name:
       - for a `range` role, we return the contents of the value of
         the `value-text` or `value-now` properties
       - for any other role, we return a textual representation of
         the GtkAccessibleRole enumeration value
    21482e82