Skip to content

Commit

Permalink
add comments for the reference of image mimesniff
Browse files Browse the repository at this point in the history
  • Loading branch information
Hajime-san committed Sep 21, 2024
1 parent 825515e commit 055395a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ext/canvas/op_create_image_bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions ext/web/01_mimesniff.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down

0 comments on commit 055395a

Please sign in to comment.