!47509 【无障碍】修复邮件编辑框不播报问题

Merge pull request !47509 from hoo334/master
This commit is contained in:
openharmony_ci 2024-11-04 13:29:56 +00:00 committed by Gitee
commit ebdb7c3470
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -121,6 +121,10 @@ const std::map<Accessibility::ActionType, std::function<bool(const Accessibility
} },
};
const std::unordered_map<std::string, std::string> WEB_COMPONENT_TYPE_MAPPING = {
{ "textField", "textArea" }
};
bool IsExtensionComponent(const RefPtr<NG::UINode>& node)
{
return node && (node->GetTag() == V2::UI_EXTENSION_COMPONENT_ETS_TAG
@ -527,6 +531,15 @@ void ConvertExtensionAccessibilityNodeId(std::list<AccessibilityElementInfo>& in
}
}
std::string ConvertWebComponentType(std::string type)
{
auto it = WEB_COMPONENT_TYPE_MAPPING.find(type);
if (it != WEB_COMPONENT_TYPE_MAPPING.end()) {
return it->second;
}
return type;
}
inline std::string BoolToString(bool tag)
{
return tag ? "true" : "false";
@ -1665,7 +1678,7 @@ void JsAccessibilityManager::UpdateWebAccessibilityElementInfo(
}
nodeInfo.SetAccessibilityId(node->GetAccessibilityId());
nodeInfo.SetComponentType(node->GetComponentType());
nodeInfo.SetComponentType(ConvertWebComponentType(node->GetComponentType()));
nodeInfo.SetEnabled(node->GetIsEnabled());
nodeInfo.SetFocused(node->GetIsFocused());
nodeInfo.SetAccessibilityFocus(node->GetIsAccessibilityFocus());