Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Spec differentiates between ImageDecoder initialization with unsupported non-image MIME type and an unsupported image MIME type

オープン
#794 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
html
領域
api, testing, web-dev

調査の方向性

issue にリンクされている ImageDecoder constructor、valid ImageDecoderInit、valid image MIME type、Configure the ImageDecoder の各セクションを読みます。記載されているエラーを、image-decoder.https.any.js の 163 行目にある WPT と比較します。仕様とテストのどちらを修正する必要があるかについて合意に達し、解決した動作を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

There is a WPT that checks for a NotSupportedError promise rejection when the MIME type "junk/type"
https://github.com/web-platform-tests/wpt/blob/53a1437dcfc754a3dc8ffe0bd34f9a6524e49fcf/webcodecs/image-decoder.https.any.js#L163

This conflicts with a strict reading of the spec:

From https://w3c.github.io/webcodecs/#imagedecoder-constructor:
"If init is not valid ImageDecoderInit, throw a TypeError."

From https://w3c.github.io/webcodecs/#valid-imagedecoderinit:
"1. If type is not a valid image MIME type, return false."

From https://w3c.github.io/webcodecs/#valid-image-mime-type:
"A valid image MIME type is a string that is a valid MIME type string and for which the type, per Section 8.3.1 of [RFC9110], is image."

From https://w3c.github.io/webcodecs/#configure-the-image-decoder
"1. Let supported be the result of running the Check Type Support algorithm with init.type."
"2. If supported is false, run the Close ImageDecoder algorithm with a NotSupportedError DOMException and return "processed"."

If we put all this together, my reading of it says that if the MIME type supplied is anything besides "image/XXX", we should throw a TypeError in the ImageDecoder constructor. If we don't support XXX, then we should reject the ImageDecoder [[completed promise]] and ImageTrackList [[ready promise]] with NotSupportedError.

Is this what we want? I don't have any strong feelings either way, just want to understand if the test is wrong, or if this is an inconsistency in the spec that we want to correct.

主要言語
HTML
スター
1.3k
フォーク
192
平均マージ
21時間 7分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

w3c/webcodecs のほかの issue

w3c/webcodecs の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。