[whatwg] Error handling for MIME type parsing (canPlayType)

Robert O'Callahan robert at ocallahan.org
Tue Jul 14 13:01:01 PDT 2009

On Wed, Jul 15, 2009 at 12:56 AM, Philip Jägenstedt <philipj at opera.com>wrote:

> While implementing canPlayType I've found that Firefox/Safari/Chrome (and
> now Opera) all have different error handling in parsing the MIME types. RFC
> 2045[1] gives the BNF form, but it appears that no browser gives much weight
> to this.

In Firefox I just reused our existing MIME type parser. I'm not sure how
tightly that parser is constrained by Web compatibility quirks issues.

audio/x-wav codecs: the same as audio/x-unknown-type (i.e. "no" for Firefox)

Yes, that seems like a bug.

audio/x-wav; codecs=: same as audio/x-wav (unless we want this to mean "no
> codecs", in which case "no" would be more appropriate)

I interpret this as "no codecs". In that case, "probably" is correct, since
we support every codec in the list.

audio/x-wav; codecs=,: same as audio/x-wav (i.e. ignore broken codecs
> parameter)

I interpret this as two codecs, both whose name is the empty string. We
don't support that codec.

Has there been any work done on defining error handling for Content-Type
> parsing or the like?

That's a very good question, but I don't know the answer.

"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090715/a074b8ce/attachment-0002.htm>

More information about the whatwg mailing list