[gtk/matthiasc/for-master] scale: Hide internal structure from a11y



commit 8f100269ad5f7d236560a2c83db73be4005529bc
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 21 14:53:17 2020 -0400

    scale: Hide internal structure from a11y
    
    According to section 7.1 of WAI-ARIA, the slider role
    has the "Children presentational" characteristic, which
    indicates that children should not be represented in
    the a11y tree, which makes sense, since these are all
    just internal gizmos.

 gtk/gtkscale.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index d9928636cf..af17b39af2 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1698,12 +1698,13 @@ gtk_scale_add_mark (GtkScale        *scale,
     {
       if (!priv->top_marks_widget)
         {
-          priv->top_marks_widget = gtk_gizmo_new ("marks",
-                                                  gtk_scale_measure_marks,
-                                                  gtk_scale_allocate_marks,
-                                                  NULL,
-                                                  NULL,
-                                                  NULL, NULL);
+          priv->top_marks_widget = gtk_gizmo_new_with_role ("marks",
+                                                            GTK_ACCESSIBLE_ROLE_NONE,
+                                                            gtk_scale_measure_marks,
+                                                            gtk_scale_allocate_marks,
+                                                            NULL,
+                                                            NULL,
+                                                            NULL, NULL);
 
           gtk_widget_insert_after (priv->top_marks_widget,
                                    GTK_WIDGET (scale),
@@ -1716,12 +1717,13 @@ gtk_scale_add_mark (GtkScale        *scale,
     {
       if (!priv->bottom_marks_widget)
         {
-          priv->bottom_marks_widget = gtk_gizmo_new ("marks",
-                                                     gtk_scale_measure_marks,
-                                                     gtk_scale_allocate_marks,
-                                                     NULL,
-                                                     NULL,
-                                                     NULL, NULL);
+          priv->bottom_marks_widget = gtk_gizmo_new_with_role ("marks",
+                                                               GTK_ACCESSIBLE_ROLE_NONE,
+                                                               gtk_scale_measure_marks,
+                                                               gtk_scale_allocate_marks,
+                                                               NULL,
+                                                               NULL,
+                                                               NULL, NULL);
 
           gtk_widget_insert_before (priv->bottom_marks_widget,
                                     GTK_WIDGET (scale),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]