Re: <object> content-type sniffing (detailed review of Semantics)

Simon Pieters wrote:
> gif as text/plain:
>    http://simon.html5.org/test/html/semantics/object/mislabeled/001.htm
....
> Firefox uses the fallback.

As of three days ago, yes.

> It seems that image types are treated the same in browsers, and the 
> resources are basically fed through the image library that reads the 
> first few bytes before deciding what type of image it is.

That's precisely what Firefox does.

 > flash as application/octet-stream, with type="":
 > flash as application/octet-stream with .swf extension, with type="":
...
 > Opera and Firefox use the fallback for the first and treats the second as
 > application/x-shockwave-flash.

As of three days ago both are treated as application/x-shockwave-flash.

In general, the behavior of Firefox for <object> as of today is as follows:

* All the same sniffing as is performed for a browsing context is
   performed.  This was needed because we ran into a number of sites
   sending binary data as text/plain.  That's the only part of the
   sniffing that doesn't "always" happen; images, for example, are
   always sniffed by the image library.
* If the type comes out to be application/octet-stream (whether explicitly
   sent by the server or sniffed from text/plain), use the type attribute,
   if present.  This was needed because we found a number of sites sending
   Flash, etc. as application/octet-stream.

You raise an interesting point, which is that this is not compatible with other 
UAs if there is no type attribute, because they will fall back on using the 
extension to determine the type.  That could probably be changed, of course.

-Boris

Received on Thursday, 23 August 2007 16:54:31 UTC