mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
commit
ebdb7c3470
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user