-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a11y: implement media-has-caption rule
- Loading branch information
1 parent
2548877
commit ddb4d69
Showing
5 changed files
with
199 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/css/samples/omit-scoping-attribute-attribute-selector/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><video class="svelte-xyz" autoplay></video> | ||
<video></video></div> | ||
<div><video class="svelte-xyz" autoplay muted></video> | ||
<video muted></video></div> |
6 changes: 3 additions & 3 deletions
6
test/css/samples/omit-scoping-attribute-attribute-selector/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<div> | ||
<video autoplay></video> | ||
<video></video> | ||
<video autoplay muted></video> | ||
<video muted></video> | ||
</div> | ||
|
||
<style> | ||
[autoplay] { | ||
color: red; | ||
} | ||
</style> | ||
</style> |
49 changes: 49 additions & 0 deletions
49
test/validator/samples/a11y-media-has-caption/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script> | ||
export let x; | ||
</script> | ||
|
||
<!-- valid --> | ||
<audio> | ||
<track kind="captions" /> | ||
</audio> | ||
<audio> | ||
<track kind="Captions" /> | ||
</audio> | ||
<audio> | ||
<track kind="Captions" /> | ||
<track kind="subtitles" /> | ||
</audio> | ||
<audio muted /> | ||
<audio muted={x} /> | ||
|
||
<video> | ||
<track kind="captions" /> | ||
</video> | ||
<video> | ||
<track kind="Captions" /> | ||
</video> | ||
<video> | ||
<track kind="Captions" /> | ||
<track kind="subtitles" /> | ||
</video> | ||
<video muted /> | ||
<video muted={x} /> | ||
|
||
<!-- invalid --> | ||
<audio> | ||
<track /> | ||
</audio> | ||
<audio> | ||
<track kind="subtitles" /> | ||
</audio> | ||
<audio /> | ||
<audio>Foo</audio> | ||
|
||
<video> | ||
<track /> | ||
</video> | ||
<video> | ||
<track kind="subtitles" /> | ||
</video> | ||
<video /> | ||
<video>Foo</video> |
122 changes: 122 additions & 0 deletions
122
test/validator/samples/a11y-media-has-caption/warnings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
[ | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <audio> should have a <track> for captions", | ||
"pos": 470, | ||
"start": { | ||
"character": 470, | ||
"column": 0, | ||
"line": 33 | ||
}, | ||
"end": { | ||
"character": 498, | ||
"column": 8, | ||
"line": 35 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <audio> should have a <track> for captions", | ||
"pos": 499, | ||
"start": { | ||
"character": 499, | ||
"column": 0, | ||
"line": 36 | ||
}, | ||
"end": { | ||
"character": 544, | ||
"column": 8, | ||
"line": 38 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <audio> should have a <track> for captions", | ||
"pos": 545, | ||
"start": { | ||
"character": 545, | ||
"column": 0, | ||
"line": 39 | ||
}, | ||
"end": { | ||
"character": 554, | ||
"column": 9, | ||
"line": 39 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <audio> should have a <track> for captions", | ||
"pos": 555, | ||
"start": { | ||
"character": 555, | ||
"column": 0, | ||
"line": 40 | ||
}, | ||
"end": { | ||
"character": 573, | ||
"column": 18, | ||
"line": 40 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <video> should have a <track> for captions", | ||
"pos": 575, | ||
"start": { | ||
"character": 575, | ||
"column": 0, | ||
"line": 42 | ||
}, | ||
"end": { | ||
"character": 603, | ||
"column": 8, | ||
"line": 44 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <video> should have a <track> for captions", | ||
"pos": 604, | ||
"start": { | ||
"character": 604, | ||
"column": 0, | ||
"line": 45 | ||
}, | ||
"end": { | ||
"character": 649, | ||
"column": 8, | ||
"line": 47 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <video> should have a <track> for captions", | ||
"pos": 650, | ||
"start": { | ||
"character": 650, | ||
"column": 0, | ||
"line": 48 | ||
}, | ||
"end": { | ||
"character": 659, | ||
"column": 9, | ||
"line": 48 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-media-has-caption", | ||
"message": "A11y: <video> should have a <track> for captions", | ||
"pos": 660, | ||
"start": { | ||
"character": 660, | ||
"column": 0, | ||
"line": 49 | ||
}, | ||
"end": { | ||
"character": 678, | ||
"column": 18, | ||
"line": 49 | ||
} | ||
} | ||
] |