diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 303b2e91228c..d65c78a7aa87 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -710,7 +710,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; } diff --git a/test/validator/samples/a11y-media-has-caption/input.svelte b/test/validator/samples/a11y-media-has-caption/input.svelte index 6d98fd373448..30f9a05f91ce 100644 --- a/test/validator/samples/a11y-media-has-caption/input.svelte +++ b/test/validator/samples/a11y-media-has-caption/input.svelte @@ -2,3 +2,6 @@ + + + diff --git a/test/validator/samples/a11y-media-has-caption/warnings.json b/test/validator/samples/a11y-media-has-caption/warnings.json index 72c2caae53f9..6db618f03cb0 100644 --- a/test/validator/samples/a11y-media-has-caption/warnings.json +++ b/test/validator/samples/a11y-media-has-caption/warnings.json @@ -28,5 +28,35 @@ "column": 0, "line": 3 } + }, + { + "code": "a11y-media-has-caption", + "end": { + "character": 124, + "column": 27, + "line": 5 + }, + "message": "A11y: