From 055395aaeddd5ae51f5c131e1cb7046fe4695bfb Mon Sep 17 00:00:00 2001 From: Hajime-san <41257923+Hajime-san@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:59:14 +0900 Subject: [PATCH] add comments for the reference of image mimesniff --- ext/canvas/op_create_image_bitmap.rs | 3 --- ext/web/01_mimesniff.js | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/canvas/op_create_image_bitmap.rs b/ext/canvas/op_create_image_bitmap.rs index e4334d9b20ee7d..3ce5d13b9ef483 100644 --- a/ext/canvas/op_create_image_bitmap.rs +++ b/ext/canvas/op_create_image_bitmap.rs @@ -179,9 +179,6 @@ See: https://developer.mozilla.org/en-US/docs/Web/API/Blob/type\n", } // return an error if the MIME type is not supported in the variable list of ImageTypePatternTable below // ext/web/01_mimesniff.js - // - // NOTE: Chromium supports AVIF - // https://source.chromium.org/chromium/chromium/src/+/ef3f4e4ed97079dc57861d1195fb2389483bc195:third_party/blink/renderer/platform/image-decoders/image_decoder.cc;l=311 x => { return Err( DOMExceptionInvalidStateError::new( diff --git a/ext/web/01_mimesniff.js b/ext/web/01_mimesniff.js index e60783bbe171ac..bfc4a9ec52092d 100644 --- a/ext/web/01_mimesniff.js +++ b/ext/web/01_mimesniff.js @@ -395,6 +395,10 @@ const ImageTypePatternTable = [ /** * Ref: https://mimesniff.spec.whatwg.org/#image-type-pattern-matching-algorithm + * NOTE: Some browsers have implementation-defined image types. + * For example, The AVIF image type is supported by all browsers today. + * However, the standardization seems to have hard going. + * See: https://github.com/whatwg/mimesniff/issues/143 * @param {Uint8Array} input * @returns {string | undefined} */