Skip to content

Commit 45f409d

Browse files
caugnerddbeck
andauthored
Introduce mediatypes directory with image type data (#27168)
* Add image formats * Add new media top-level object to README * Chromium unshipped JPEG XL * Remove GIF animation (same support as parent) * Add HEIC/HEIF bugs * Rename HEIC to HEIF * Refine Safari data for AVIF * Safari doesn't support JPEG XL with animated images * Add Edge/IE image format data * Add WebP subfeatures * Refine Opera data for WebP * Move {media.formats => media-types}.image * Split media-types/image.json Ran `npm run split media-types/image.json`. * Add spec url for BMP (Bitmap file) * Add media-types to code snippets, generate-types, data-folders * Fix accidental "false" string * refactor: rename {media-types => mediatypes} Avoids dash in TypeScript definitions. * Fix some media-types versions * Fix notes array with single note * Fix spec URL * Add missing WebView entries for media types * Fix AVIF animation version for Edge * Add fragments to media types spec URLs * Add spec URL exceptions for media types * Replace APNG spec URL * Apply suggestions from code review Co-authored-by: Daniel D. Beck <[email protected]> --------- Co-authored-by: Daniel D. Beck <[email protected]>
1 parent 6353913 commit 45f409d

File tree

20 files changed

+747
-1
lines changed

20 files changed

+747
-1
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ data:mathml:
3636
- changed-files:
3737
- any-glob-to-any-file:
3838
- "mathml/**"
39+
data:mediatypes:
40+
- changed-files:
41+
- any-glob-to-any-file:
42+
- "mediatypes/**"
3943
data:svg:
4044
- changed-files:
4145
- any-glob-to-any-file:

.github/workflows/system-file-changes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- "!javascript/**.json"
1616
- "!manifests/**.json"
1717
- "!mathml/**.json"
18+
- "!mediatypes/**.json"
1819
- "!svg/**.json"
1920
- "!webassembly/**.json"
2021
- "!webdriver/**.json"

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"/javascript/*.json",
1919
"/manifests/*.json",
2020
"/mathml/*.json",
21+
"/mediatypes/*.json",
2122
"/svg/*.json",
2223
"/webdriver/*.json",
2324
"/webextensions/*.json"

.vscode/snippets.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"prefix": ["bcd", "browser-compat"],
55
"body": [
66
"{",
7-
" \"${1|api,css,html,http,javascript,manifests,mathml,svg,webassembly,webdriver,webextensions|}\": {",
7+
" \"${1|api,css,html,http,javascript,manifests,mathml,mediatypes,svg,webassembly,webdriver,webextensions|}\": {",
88
" \"${2:${TM_FILENAME_BASE}}\": {",
99
" \"__compat\": {",
1010
" \"mdn_url\": \"${3:mdn-url}\",",

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ Data for [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) features,
187187

188188
- `elements` - Elements
189189

190+
### [`mediatypes`](./mediatypes)
191+
192+
Data for [Media types](https://developer.mozilla.org/docs/Web/HTTP/Guides/MIME_types), including:
193+
194+
- `mediatypes/image` - Image types
195+
196+
An image type is considered supported if it displays correctly when used in an `<img>` element's `src` attribute, or as a CSS `background-image`.
197+
190198
### [`svg`](./svg)
191199

192200
Data for [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG) features, including:

lint/linter/test-spec-urls.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ const specsExceptions = [
4848
'https://github.com/WebAssembly/function-references/blob/main/proposals/function-references/Overview.md',
4949
'https://github.com/WebAssembly/js-promise-integration',
5050
'https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md',
51+
52+
// Media types
53+
'https://developers.google.com/speed/webp/docs/riff_container',
54+
'https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification',
55+
'https://jpeg.org/jpeg/',
56+
'https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/',
57+
'https://www.iso.org/standard/89035.html',
58+
'https://www.rfc-editor.org/rfc/rfc7903',
59+
'https://www.w3.org/Graphics/GIF/spec-gif87.txt',
5160
];
5261

5362
const allowedSpecURLs = [

mediatypes/image/avif.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"mediatypes": {
3+
"image": {
4+
"avif": {
5+
"__compat": {
6+
"description": "AV1 Image File Format (AVIF)",
7+
"mdn_url": "https://developer.mozilla.org/docs/Web/Media/Guides/Formats/Image_types#avif_image",
8+
"spec_url": "https://aomediacodec.github.io/av1-avif/#general",
9+
"support": {
10+
"chrome": {
11+
"version_added": "85"
12+
},
13+
"chrome_android": "mirror",
14+
"edge": {
15+
"version_added": "121"
16+
},
17+
"firefox": {
18+
"version_added": "93"
19+
},
20+
"firefox_android": "mirror",
21+
"opera": "mirror",
22+
"opera_android": "mirror",
23+
"safari": [
24+
{
25+
"version_added": "16.4"
26+
},
27+
{
28+
"version_added": "16.1",
29+
"version_removed": "16.4",
30+
"partial_implementation": true,
31+
"notes": [
32+
"Only on macOS Ventura. Big Sur and Monterey are not supported.",
33+
"Noise synthesis is not supported."
34+
]
35+
}
36+
],
37+
"safari_ios": {
38+
"version_added": "16.1"
39+
},
40+
"samsunginternet_android": "mirror",
41+
"webview_android": "mirror",
42+
"webview_ios": "mirror"
43+
},
44+
"status": {
45+
"experimental": false,
46+
"standard_track": true,
47+
"deprecated": false
48+
}
49+
},
50+
"animation": {
51+
"__compat": {
52+
"description": "Animation support (AVIF Image sequences)",
53+
"spec_url": "https://aomediacodec.github.io/av1-avif/#image-sequences",
54+
"support": {
55+
"chrome": {
56+
"version_added": "85"
57+
},
58+
"chrome_android": "mirror",
59+
"edge": {
60+
"version_added": "121"
61+
},
62+
"firefox": {
63+
"version_added": "113"
64+
},
65+
"firefox_android": "mirror",
66+
"opera": "mirror",
67+
"opera_android": "mirror",
68+
"safari": {
69+
"version_added": "16.1"
70+
},
71+
"safari_ios": "mirror",
72+
"samsunginternet_android": "mirror",
73+
"webview_android": "mirror",
74+
"webview_ios": "mirror"
75+
},
76+
"status": {
77+
"experimental": false,
78+
"standard_track": true,
79+
"deprecated": false
80+
}
81+
}
82+
}
83+
}
84+
}
85+
}
86+
}

mediatypes/image/bmp.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"mediatypes": {
3+
"image": {
4+
"bmp": {
5+
"__compat": {
6+
"description": "Bitmap (BMP)",
7+
"mdn_url": "https://developer.mozilla.org/docs/Web/Media/Guides/Formats/Image_types#bmp_bitmap_file",
8+
"spec_url": "https://www.rfc-editor.org/rfc/rfc7903#section-1.2",
9+
"support": {
10+
"chrome": {
11+
"version_added": "1"
12+
},
13+
"chrome_android": "mirror",
14+
"edge": {
15+
"version_added": "12"
16+
},
17+
"firefox": {
18+
"version_added": "1"
19+
},
20+
"firefox_android": "mirror",
21+
"ie": {
22+
"version_added": "1"
23+
},
24+
"opera": {
25+
"version_added": "≤2"
26+
},
27+
"opera_android": "mirror",
28+
"safari": {
29+
"version_added": "1"
30+
},
31+
"safari_ios": "mirror",
32+
"samsunginternet_android": "mirror",
33+
"webview_android": "mirror",
34+
"webview_ios": "mirror"
35+
},
36+
"status": {
37+
"experimental": false,
38+
"standard_track": true,
39+
"deprecated": false
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}

mediatypes/image/gif.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"mediatypes": {
3+
"image": {
4+
"gif": {
5+
"__compat": {
6+
"description": "Graphics Interchange Format (GIF)",
7+
"mdn_url": "https://developer.mozilla.org/docs/Web/Media/Guides/Formats/Image_types#gif_graphics_interchange_format",
8+
"spec_url": [
9+
"https://www.w3.org/Graphics/GIF/spec-gif87.txt#top",
10+
"https://www.w3.org/Graphics/GIF/spec-gif89a.txt#top"
11+
],
12+
"support": {
13+
"chrome": {
14+
"version_added": "1"
15+
},
16+
"chrome_android": "mirror",
17+
"edge": {
18+
"version_added": "12"
19+
},
20+
"firefox": {
21+
"version_added": "1"
22+
},
23+
"firefox_android": "mirror",
24+
"ie": [
25+
{
26+
"version_added": "2"
27+
},
28+
{
29+
"version_added": "1",
30+
"version_removed": "2",
31+
"partial_implementation": true,
32+
"notes": "Animation is not supported."
33+
}
34+
],
35+
"opera": {
36+
"version_added": "≤2"
37+
},
38+
"opera_android": "mirror",
39+
"safari": {
40+
"version_added": "1"
41+
},
42+
"safari_ios": "mirror",
43+
"samsunginternet_android": "mirror",
44+
"webview_android": "mirror",
45+
"webview_ios": "mirror"
46+
},
47+
"status": {
48+
"experimental": false,
49+
"standard_track": true,
50+
"deprecated": false
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}

mediatypes/image/heif.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"mediatypes": {
3+
"image": {
4+
"heif": {
5+
"__compat": {
6+
"description": "High Efficiency Image File Format (HEIF)",
7+
"spec_url": "https://www.iso.org/standard/89035.html#content",
8+
"support": {
9+
"chrome": {
10+
"version_added": false,
11+
"impl_url": "https://crbug.com/411125808"
12+
},
13+
"chrome_android": "mirror",
14+
"edge": "mirror",
15+
"firefox": {
16+
"version_added": false,
17+
"impl_url": "https://bugzil.la/1402293"
18+
},
19+
"firefox_android": "mirror",
20+
"opera": "mirror",
21+
"opera_android": "mirror",
22+
"safari": {
23+
"version_added": "17"
24+
},
25+
"safari_ios": "mirror",
26+
"samsunginternet_android": "mirror",
27+
"webview_android": "mirror",
28+
"webview_ios": "mirror"
29+
},
30+
"status": {
31+
"experimental": false,
32+
"standard_track": true,
33+
"deprecated": false
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)