Skip to content

Commit bd77fb9

Browse files
committed
add comments for the reference of image mimesniff
1 parent 825515e commit bd77fb9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ext/canvas/op_create_image_bitmap.rs

-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ See: https://developer.mozilla.org/en-US/docs/Web/API/Blob/type\n",
179179
}
180180
// return an error if the MIME type is not supported in the variable list of ImageTypePatternTable below
181181
// ext/web/01_mimesniff.js
182-
//
183-
// NOTE: Chromium supports AVIF
184-
// https://source.chromium.org/chromium/chromium/src/+/ef3f4e4ed97079dc57861d1195fb2389483bc195:third_party/blink/renderer/platform/image-decoders/image_decoder.cc;l=311
185182
x => {
186183
return Err(
187184
DOMExceptionInvalidStateError::new(

ext/web/01_mimesniff.js

+4
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ const ImageTypePatternTable = [
395395

396396
/**
397397
* Ref: https://mimesniff.spec.whatwg.org/#image-type-pattern-matching-algorithm
398+
* NOTE: Some browsers have implementation-defined image formats.
399+
* For example, The AVIF image format is supported by all browsers today.
400+
* However, the standardization seems to have hard going.
401+
* See: https://github.com/whatwg/mimesniff/issues/143
398402
* @param {Uint8Array} input
399403
* @returns {string | undefined}
400404
*/

0 commit comments

Comments
 (0)