Remove caption warning on <audio> (#6054)

pull/6494/head
Geoff Rich 4 years ago committed by GitHub
parent a35506b5eb
commit 391258aa10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -519,7 +519,7 @@ export default class Element extends Node {
} }
} }
if (this.is_media_node()) { if (this.name === 'video') {
if (attribute_map.has('muted')) { if (attribute_map.has('muted')) {
return; return;
} }
@ -533,7 +533,7 @@ export default class Element extends Node {
if (!has_caption) { if (!has_caption) {
component.warn(this, { component.warn(this, {
code: 'a11y-media-has-caption', code: 'a11y-media-has-caption',
message: 'A11y: Media elements must have a <track kind="captions">' message: 'A11y: <video> elements must have a <track kind="captions">'
}); });
} }
} }

@ -1,4 +1,4 @@
<video><track kind="captions"/></video> <video><track kind="captions"/></video>
<video></video> <video></video>
<video><track /></video> <video><track /></video>
<audio muted></audio> <audio></audio>

@ -6,7 +6,7 @@
"column": 15, "column": 15,
"line": 2 "line": 2
}, },
"message": "A11y: Media elements must have a <track kind=\"captions\">", "message": "A11y: <video> elements must have a <track kind=\"captions\">",
"pos": 40, "pos": 40,
"start": { "start": {
"character": 40, "character": 40,
@ -21,7 +21,7 @@
"column": 24, "column": 24,
"line": 3 "line": 3
}, },
"message": "A11y: Media elements must have a <track kind=\"captions\">", "message": "A11y: <video> elements must have a <track kind=\"captions\">",
"pos": 56, "pos": 56,
"start": { "start": {
"character": 56, "character": 56,

Loading…
Cancel
Save