LibWebView: Display Accessible Name and Description

The accessibility tab now displays elements' names and descriptions
along with the role.
This commit is contained in:
Jonah 2023-02-05 11:24:47 -06:00 committed by Linus Groh
commit 2f4c463920
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00

View file

@ -93,8 +93,12 @@ GUI::Variant AccessibilityTreeModel::data(GUI::ModelIndex const& index, GUI::Mod
if (type != "element")
return node_role;
auto name = node.get_deprecated_string("name"sv).value();
auto description = node.get_deprecated_string("description"sv).value();
StringBuilder builder;
builder.append(node_role.to_lowercase());
builder.appendff(" name: \"{}\", description: \"{}\"", name, description);
return builder.to_deprecated_string();
}
return {};