fix: omit a11y warning on `<video>` when `aria-hidden="true"` (#7880)

Related to #5967. Closes #7874

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
pull/8308/head
Carlos Ivanchuk 2 years ago committed by GitHub
parent 2a5b488386
commit aa9b2dd5f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -718,7 +718,10 @@ export default class Element extends Node {
}
if (this.name === 'video') {
if (attribute_map.has('muted')) {
const aria_hidden_attribute = attribute_map.get('aria-hidden');
const aria_hidden_exist = aria_hidden_attribute && aria_hidden_attribute.get_static_value();
if (attribute_map.has('muted') || aria_hidden_exist === 'true') {
return;
}

@ -2,3 +2,6 @@
<video></video>
<video><track /></video>
<audio></audio>
<video aria-hidden></video>
<video aria-hidden="false"></video>
<video aria-hidden="true"></video>

@ -28,5 +28,35 @@
"column": 0,
"line": 3
}
},
{
"code": "a11y-media-has-caption",
"end": {
"character": 124,
"column": 27,
"line": 5
},
"message": "A11y: <video> elements must have a <track kind=\"captions\">",
"pos": 97,
"start": {
"character": 97,
"column": 0,
"line": 5
}
},
{
"code": "a11y-media-has-caption",
"end": {
"character": 160,
"column": 35,
"line": 6
},
"message": "A11y: <video> elements must have a <track kind=\"captions\">",
"pos": 125,
"start": {
"character": 125,
"column": 0,
"line": 6
}
}
]

Loading…
Cancel
Save