forked from AuroraMiddleware/gtk
a11y: Defer to the GtkAccessible's implementation
Since GtkATContexts are now lazily realized, we need to go through the GtkAccessible's implementation to access the :accessible-role property, in case there are fallbacks.
This commit is contained in:
parent
2285382074
commit
292576f312
@ -104,13 +104,17 @@ gtk_accessible_get_at_context (GtkAccessible *self)
|
||||
GtkAccessibleRole
|
||||
gtk_accessible_get_accessible_role (GtkAccessible *self)
|
||||
{
|
||||
GtkAccessibleRole role;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), GTK_ACCESSIBLE_ROLE_NONE);
|
||||
|
||||
GtkATContext *context = gtk_accessible_get_at_context (self);
|
||||
if (context == NULL)
|
||||
return GTK_ACCESSIBLE_ROLE_NONE;
|
||||
if (context != NULL && gtk_at_context_is_realized (context))
|
||||
return gtk_at_context_get_accessible_role (context);
|
||||
|
||||
return gtk_at_context_get_accessible_role (context);
|
||||
g_object_get (G_OBJECT (self), "accessible-role", &role, NULL);
|
||||
|
||||
return role;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,15 +118,9 @@ gboolean
|
||||
gtk_test_accessible_has_role (GtkAccessible *accessible,
|
||||
GtkAccessibleRole role)
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), FALSE);
|
||||
|
||||
context = gtk_accessible_get_at_context (accessible);
|
||||
if (context == NULL)
|
||||
return FALSE;
|
||||
|
||||
return gtk_at_context_get_accessible_role (context) == role;
|
||||
return gtk_accessible_get_accessible_role (accessible) == role;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user