Explorar el Código

LibWebView: Display Accessible Name and Description

The accessibility tab now displays elements' names and descriptions
along with the role.
Jonah hace 2 años
padre
commit
2f4c463920
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp

+ 4 - 0
Userland/Libraries/LibWebView/AccessibilityTreeModel.cpp

@@ -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 {};