表单或导航标签中的角色属性已过时
Role attribute obsolete in form or nav tags
简介
我知道,role 属性是 W3C 在 WAI-ARIA 1.0 中引入的,然后在 HTML5.
中进行了改编
当 HTML5 是新的并且许多浏览器没有实现本机元素 people advised 以使用像 <nav role="nav">…</nav>
这样的角色属性来支持它们,但他们也提到这将很快就会不需要。
但目前有不同意见:
Bootstrap
bootstrap 成员在 GitHub that the WAI-ARIA rules are "more important" then the current HTML5 specifications. Also, other third-party sites like TutorialsPoint or W3Schools 上表示也建议添加该属性以授予完全可访问性。
W3C
另一方面,当您输入带有角色属性的可疑表单标签时,W3C-Validator 会发出以下警告。
<form role="form"></form>
Element form does not need a role attribute.
这显然表明不包括角色属性。
终于
是不是已经到了忽略 备份 原生 HTML5 标签(和表单)的时候了,或者是否仍然有必要保证一个完全可访问的网站(例如对于有屏幕阅读器的残障人士 people/people)?是否有某种“官方声明”或指南(是最新的)?
W3C 的维护者 HTML Checker(验证器)在这里。简短的回答是 current authoritative requirement that’s relevant to the <form role="form"></form>
案例是这样的:
Web developers should not set the ARIA role
and aria-*
attributes to
values that match the default implicit ARIA semantics defined in the
table.
…其中“the table”表示 Document conformance requirements for use of ARIA attributes in HTML section of the ARIA in HTML 规范中的 table,您可以在此处找到最新版本:
http://w3c.github.io/html-aria/
而spec之所以权威是因为the HTML spec itself formally references it:
Conformance checker requirements for checking use of ARIA role
and
aria-*
attributes on HTML elements are defined in ARIA in HTML.
W3C 检查器因此严格遵循 HTMLARIA 中的规则。因此,鉴于以下内容:
<form role="form"></form>
是为 form
元素设置 role
值的情况,该值匹配 form
元素的默认隐式语义,并且;
- HTML中ARIA的相关规则是
role
值不应设置为与元素的默认隐式语义相匹配的值
…检查器因此给出元素形式不需要角色属性警告。
Is there a kind of "official statement" or a guideline (which is
up-to-date)?
是的,这正是 ARIA in HTML 规格。
任何与 HTML 规范规则中的 ARIA 冲突的来源都是错误的或过时的,应予以更正。
简介
我知道,role 属性是 W3C 在 WAI-ARIA 1.0 中引入的,然后在 HTML5.
中进行了改编当 HTML5 是新的并且许多浏览器没有实现本机元素 people advised 以使用像 <nav role="nav">…</nav>
这样的角色属性来支持它们,但他们也提到这将很快就会不需要。
但目前有不同意见:
Bootstrap
bootstrap 成员在 GitHub that the WAI-ARIA rules are "more important" then the current HTML5 specifications. Also, other third-party sites like TutorialsPoint or W3Schools 上表示也建议添加该属性以授予完全可访问性。
W3C
另一方面,当您输入带有角色属性的可疑表单标签时,W3C-Validator 会发出以下警告。
<form role="form"></form>
Element form does not need a role attribute.
这显然表明不包括角色属性。
终于
是不是已经到了忽略 备份 原生 HTML5 标签(和表单)的时候了,或者是否仍然有必要保证一个完全可访问的网站(例如对于有屏幕阅读器的残障人士 people/people)?是否有某种“官方声明”或指南(是最新的)?
W3C 的维护者 HTML Checker(验证器)在这里。简短的回答是 current authoritative requirement that’s relevant to the <form role="form"></form>
案例是这样的:
Web developers should not set the ARIA
role
andaria-*
attributes to values that match the default implicit ARIA semantics defined in the table.
…其中“the table”表示 Document conformance requirements for use of ARIA attributes in HTML section of the ARIA in HTML 规范中的 table,您可以在此处找到最新版本:
http://w3c.github.io/html-aria/
而spec之所以权威是因为the HTML spec itself formally references it:
Conformance checker requirements for checking use of ARIA
role
andaria-*
attributes on HTML elements are defined in ARIA in HTML.
W3C 检查器因此严格遵循 HTMLARIA 中的规则。因此,鉴于以下内容:
<form role="form"></form>
是为form
元素设置role
值的情况,该值匹配form
元素的默认隐式语义,并且;- HTML中ARIA的相关规则是
role
值不应设置为与元素的默认隐式语义相匹配的值
…检查器因此给出元素形式不需要角色属性警告。
Is there a kind of "official statement" or a guideline (which is up-to-date)?
是的,这正是 ARIA in HTML 规格。
任何与 HTML 规范规则中的 ARIA 冲突的来源都是错误的或过时的,应予以更正。