Re: [widgets] Content-type sniffing and file extension to MIME mapping

Hi Art,
On Thu, Dec 4, 2008 at 12:48 PM, Arthur Barstow <art.barstow@nokia.com> wrote:
> Marcos,
>
> On Dec 3, 2008, at 5:03 PM, ext Marcos Caceres wrote:
>
>> A widget user agent would be expected to support the above types. All
>> other types are optional. All proprietary types, apart from ico, are
>> optional.
>
> What - if anything - will be prescribed (normative) here for the various
> conformance classes?
>

The spec will contain a table of file extensions, corresponding MIME
types, and magic numbers (unique byte sequences for sniffing). User
Agents would be expected to use table to derive the MIME type
interoperably.

> I scanned the new Section 6.1 and didn't notice any testable assertions:
>
>  <http://dev.w3.org/2006/waf/widgets/#files>
>

A testable assertion would be to check that, for instance, a .html
file is being process as text/html and not as application/xhtml+xml. A
bunch of tests could be developed where files have no extensions and a
widget user agent is expected to correctly process each file. Another
testable assertion would be to make sure that either sniffing or file
extension checking is done first.

>From reading [1], seems that sniffing is performed by browsers first.
If sniffing cannot determine the type, file extension is used as a
fallback. So, another testable assertion would be to create a
"index.jpg" file (with HTML content) and make sure it does actually
get rendered as text/html. Or create a image.html with png data and
make sure that it does get rendered as image/png. And so on...

Kind regards,
Marcos

-- 
Marcos Caceres
http://datadriven.com.au

Received on Thursday, 4 December 2008 14:25:01 UTC