From deceb967fe11e6311565ce7189f93da052a5a88e Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 22 Feb 2022 11:15:28 +1300 Subject: [PATCH] Set a11y roles for checks, toggles and sliders. Note that ATK_ROLE_CHECK_BOX is not perfect as this will also be used for switches and radio buttons but we don't have sufficient information from Flutter to determine this. --- shell/platform/linux/fl_accessible_node.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shell/platform/linux/fl_accessible_node.cc b/shell/platform/linux/fl_accessible_node.cc index 21cdb24de985a..2752b432cb0d8 100644 --- a/shell/platform/linux/fl_accessible_node.cc +++ b/shell/platform/linux/fl_accessible_node.cc @@ -173,6 +173,13 @@ static AtkRole fl_accessible_node_get_role(AtkObject* accessible) { if ((self->flags & kFlutterSemanticsFlagIsButton) != 0) { return ATK_ROLE_PUSH_BUTTON; } + if ((self->flags & (kFlutterSemanticsFlagHasCheckedState | + kFlutterSemanticsFlagHasToggledState)) != 0) { + return ATK_ROLE_CHECK_BOX; + } + if ((self->flags & kFlutterSemanticsFlagIsSlider) != 0) { + return ATK_ROLE_SLIDER; + } if ((self->flags & kFlutterSemanticsFlagIsTextField) != 0) { return ATK_ROLE_TEXT; }