gpt4 book ai didi

html - SVG 的默认 ARIA 角色是什么?

转载 作者:行者123 更新时间:2023-11-28 05:14:16 24 4
gpt4 key购买 nike

如果 role 属性不存在且文档包含可见图形,我一直在尝试确定 SVG 标签的默认角色。

使用 Chrome 的辅助工具,它告诉我角色是 SVGRoot:

然而,这不是一个有效的 ARIA 角色,它是 Chrome 内部使用的自己的角色之一。

我已经能够通过此文档找到更多信息:WAI-ARIA Graphics Module ,它表示允许在 SVG 标签上使用哪些角色,但我似乎无法缩小默认角色的范围。

如果没有提供有效的 role 属性,用户代理默认假定 SVG 是什么角色?

最佳答案

根据 ARIA in HTML 文档,SVG has no default corresponding role

“无对应角色”状态定义如下:

The elements marked with No corresponding role, in the second column of the table do not have any implicit ARIA semantics, but they do have meaning and this meaning may be represented in roles, states and properties not provided by ARIA, and exposed to users of assistive technology via accessibility APIs. It is therefore recommended that web developers add a role attribute to a semantically neutral element such as a div or span, rather than overriding the semantics of the listed elements.

正如@josh 已经回答的那样,SVG 元素允许的角色是applicationdocumentimg

关于html - SVG 的默认 ARIA 角色是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49197524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com