From 2f4c4639203dd6ef1462741c5e25d1ee60d0287b Mon Sep 17 00:00:00 2001 From: Jonah Date: Sun, 5 Feb 2023 11:24:47 -0600 Subject: [PATCH] LibWebView: Display Accessible Name and Description The accessibility tab now displays elements' names and descriptions along with the role. --- Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp b/Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp index c09704b059..a847e5ef81 100644 --- a/Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp +++ b/Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp @@ -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 {};