Add test cases where input and menuitems have different roles for different types

pull/8195/head
Nguyen Tran 4 years ago
parent 8f80a35e74
commit ad34794586

@ -161,6 +161,28 @@
<div role="doc-tip" aria-valuenow="0" /> <div role="doc-tip" aria-valuenow="0" />
<div role="doc-toc" aria-posinset="0" /> <div role="doc-toc" aria-posinset="0" />
<!-- input and menuitem have different implicit roles based on different type attributes, and thus different valid and invalid props -->
<!-- INVALID -->
<input type="text" aria-rowspan="0" /> <!-- implicit role: textbox -->
<input type="tel" aria-pressed /> <!-- implicit role: textbox -->
<input type="url" aria-level="0" /> <!-- implicit role: textbox -->
<input type="email" aria-pressed /> <!-- implicit role: textbox -->
<input type="search" aria-valuetext="text" /> <!-- implicit role: searchbox -->
<input type="text" list={['id']} aria-valuemin="0" /> <!-- implicit role: combobox -->
<input type="tel" list={['id']} aria-colspan="0" /> <!-- implicit role: combobox -->
<input type="url" list={['id']} aria-posinset="0" /> <!-- implicit role: combobox -->
<input type="email" list={['id']} aria-modal /> <!-- implicit role: combobox -->
<input type="search" list={['id']} aria-rowindex="0" /> <!-- implicit role: combobox -->
<input type="image" alt="some text" aria-valuemax="0" /> <!-- implicit role: button -->
<input type="reset" aria-modal /> <!-- implicit role: button -->
<input type="submit" aria-placeholder="placeholder" /> <!-- implicit role: button -->
<input type="checkbox" aria-rowindex="0" /> <!-- implicit role: checkbox -->
<input type="radio" aria-valuetext="text" /> <!-- implicit role: radio -->
<input type="range" aria-checked /> <!-- implicit role: slider -->
<menuitem type="command" aria-colindex="0" /> <!-- implicit role: menuitem -->
<menuitem type="checkbox" aria-colcount="0" /> <!-- implicit role: menuitemcheckbox -->
<menuitem type="radio" aria-placeholder="placeholder" /> <!-- implicit role: menuitemradio -->
<!-- VALID --> <!-- VALID -->
<a aria-keyshortcuts="" href="/">Link</a> <a aria-keyshortcuts="" href="/">Link</a>
<area aria-expanded alt="" /> <area aria-expanded alt="" />
@ -325,3 +347,25 @@
<div role="doc-tip" aria-owns="id" /> <div role="doc-tip" aria-owns="id" />
<div role="doc-toc" aria-expanded /> <div role="doc-toc" aria-expanded />
<!-- input and menuitem have different implicit roles based on different type attributes, and thus different valid and invalid props -->
<!-- VALID -->
<input type="text" aria-labelledby="id" /> <!-- implicit role: textbox -->
<input type="tel" aria-readonly /> <!-- implicit role: textbox -->
<input type="url" aria-errormessage="id" /> <!-- implicit role: textbox -->
<input type="email" aria-details="id" /> <!-- implicit role: textbox -->
<input type="searchbox" aria-owns="id" /> <!-- implicit role: searchbox -->
<input type="text" list={['id']} aria-keyshortcuts="key" /> <!-- implicit role: combobox -->
<input type="tel" list={['id']} aria-readonly /> <!-- implicit role: combobox -->
<input type="url" list={['id']} aria-label="label" /> <!-- implicit role: combobox -->
<input type="email" list={['id']} aria-activedescendant="id" /> <!-- implicit role: combobox -->
<input type="search" list={['id']} aria-dropeffect="none" /> <!-- implicit role: combobox -->
<input type="image" alt="some text" aria-pressed /> <!-- implicit role: button -->
<input type="reset" aria-expanded /> <!-- implicit role: button -->
<input type="submit" aria-disabled /> <!-- implicit role: button -->
<input type="checkbox" aria-controls="id" /> <!-- implicit role: checkbox -->
<input type="radio" aria-atomic /> <!-- implicit role: radio -->
<input type="range" aria-hidden /> <!-- implicit role: slider -->
<menuitem type="command" aria-live="off" /> <!-- implicit role: menuitem -->
<menuitem type="checkbox" aria-relevant="all" /> <!-- implicit role: menuitemcheckbox -->
<menuitem type="radio" aria-required /> <!-- implicit role: menuitemradio -->

@ -2398,5 +2398,290 @@
"column":20, "column":20,
"line":162 "line":162
} }
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":6664,
"column":35,
"line":166
},
"message":"A11y: The attribute 'aria-rowspan' is not supported by the role 'textbox'. This role is implicit on the element <input>.",
"pos":6648,
"start":{
"character":6648,
"column":19,
"line":166
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":6730,
"column":30,
"line":167
},
"message":"A11y: The attribute 'aria-pressed' is not supported by the role 'textbox'. This role is implicit on the element <input>.",
"pos":6718,
"start":{
"character":6718,
"column":18,
"line":167
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":6798,
"column":32,
"line":168
},
"message":"A11y: The attribute 'aria-level' is not supported by the role 'textbox'. This role is implicit on the element <input>.",
"pos":6784,
"start":{
"character":6784,
"column":18,
"line":168
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":6866,
"column":32,
"line":169
},
"message":"A11y: The attribute 'aria-pressed' is not supported by the role 'textbox'. This role is implicit on the element <input>.",
"pos":6854,
"start":{
"character":6854,
"column":20,
"line":169
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":6944,
"column":42,
"line":170
},
"message":"A11y: The attribute 'aria-valuetext' is not supported by the role 'searchbox'. This role is implicit on the element <input>.",
"pos":6923,
"start":{
"character":6923,
"column":21,
"line":170
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7032,
"column":50,
"line":171
},
"message":"A11y: The attribute 'aria-valuemin' is not supported by the role 'combobox'. This role is implicit on the element <input>.",
"pos":7015,
"start":{
"character":7015,
"column":33,
"line":171
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7117,
"column":48,
"line":172
},
"message":"A11y: The attribute 'aria-colspan' is not supported by the role 'combobox'. This role is implicit on the element <input>.",
"pos":7101,
"start":{
"character":7101,
"column":32,
"line":172
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7203,
"column":49,
"line":173
},
"message":"A11y: The attribute 'aria-posinset' is not supported by the role 'combobox'. This role is implicit on the element <input>.",
"pos":7186,
"start":{
"character":7186,
"column":32,
"line":173
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7284,
"column":44,
"line":174
},
"message":"A11y: The attribute 'aria-modal' is not supported by the role 'combobox'. This role is implicit on the element <input>.",
"pos":7274,
"start":{
"character":7274,
"column":34,
"line":174
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7373,
"column":52,
"line":175
},
"message":"A11y: The attribute 'aria-rowindex' is not supported by the role 'combobox'. This role is implicit on the element <input>.",
"pos":7356,
"start":{
"character":7356,
"column":35,
"line":175
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7463,
"column":53,
"line":176
},
"message":"A11y: The attribute 'aria-valuemax' is not supported by the role 'button'. This role is implicit on the element <input>.",
"pos":7446,
"start":{
"character":7446,
"column":36,
"line":176
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7528,
"column":30,
"line":177
},
"message":"A11y: The attribute 'aria-modal' is not supported by the role 'button'. This role is implicit on the element <input>.",
"pos":7518,
"start":{
"character":7518,
"column":20,
"line":177
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7614,
"column":51,
"line":178
},
"message":"A11y: The attribute 'aria-placeholder' is not supported by the role 'button'. This role is implicit on the element <input>.",
"pos":7584,
"start":{
"character":7584,
"column":21,
"line":178
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7689,
"column":40,
"line":179
},
"message":"A11y: The attribute 'aria-rowindex' is not supported by the role 'checkbox'. This role is implicit on the element <input>.",
"pos":7672,
"start":{
"character":7672,
"column":23,
"line":179
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7767,
"column":41,
"line":180
},
"message":"A11y: The attribute 'aria-valuetext' is not supported by the role 'radio'. This role is implicit on the element <input>.",
"pos":7746,
"start":{
"character":7746,
"column":20,
"line":180
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7833,
"column":32,
"line":181
},
"message":"A11y: The attribute 'aria-checked' is not supported by the role 'slider'. This role is implicit on the element <input>.",
"pos":7821,
"start":{
"character":7821,
"column":20,
"line":181
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7910,
"column":42,
"line":182
},
"message":"A11y: The attribute 'aria-colindex' is not supported by the role 'menuitem'. This role is implicit on the element <menuitem>.",
"pos":7893,
"start":{
"character":7893,
"column":25,
"line":182
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":7990,
"column":43,
"line":183
},
"message":"A11y: The attribute 'aria-colcount' is not supported by the role 'menuitemcheckbox'. This role is implicit on the element <menuitem>.",
"pos":7973,
"start":{
"character":7973,
"column":26,
"line":183
}
},
{
"code":"a11y-role-supports-aria-props",
"end":{
"character":8088,
"column":53,
"line":184
},
"message":"A11y: The attribute 'aria-placeholder' is not supported by the role 'menuitemradio'. This role is implicit on the element <menuitem>.",
"pos":8058,
"start":{
"character":8058,
"column":23,
"line":184
}
} }
] ]
Loading…
Cancel
Save