[webkit-dev] Harmonizing content sniffing

Adam Barth abarth at webkit.org
Fri Nov 14 14:06:17 PST 2008


My colleagues and I have put together a web site that makes it easy to
compare the mime signatures used by Internet Explorer 7, Firefox 3,
Safari 3.1, Google Chrome, and the HTML 5 specification:

http://webblaze.cs.berkeley.edu/2009/content-sniffing/

I'm hoping we can use this information to converge the content
sniffing algorithms used by different browsers and then update the
HTML 5 spec to reflect the consensus.

I know some changes to the content sniffing algorithm will be
contentious (such as whether to sniff HTML from text/plain), but I'm
hoping other changes will be easier.  For example, Firefox, IE, and
Safari all use different signatures for JPEG.

When I raised this issue before on this list, I got the impression
that the WebKit project was generally receptive to changing its
content sniffing algorithm.  Get the ball rolling, I'd suggest making
the following changes:

1) Remove the fourth byte of the JPEG signature to match Firefox 3,
Google Chrome, and the HTML 5 spec.  (Internet Explorer uses a
two-byte signature.)

2) Add a signature for GIF.  Currently, Internet Explorer 7, Firefox
3, Google Chrome, and the HTML 5 spec all have signatures for GIF, but
Safari 3.1 does not.

3) Add a signature for PNG.  Currently, Internet Explorer 7, Firefox
3, Google Chrome, and the HTML 5 spec all have signatures for PNG, but
Safari 3.1 does not.

I think the next logical set is for me to file a bug about these
issues, but I wanted to send an email to the list to provide some
context for that bug report.

Thanks,
Adam


More information about the webkit-dev mailing list