1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

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
parent 29d724d95c
commit 2f4c463920

View file

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