On Fri, 13 Nov 2009 11:36:33 +0100, Arun Ranganathan <a...@mozilla.com> wrote:
Anne van Kesteren wrote:
This should be a bit more exact as to how the mediaType is returned. I would prefer ASCII-lowercase.

Done.

The current text says the string is ASCII-encoded. That's not true. It's in 16bit code points like any other DOMString.


Returning "application/octet-stream" rather than null also seems better if the type is not known. That way you do not have to type check. Other parts of the platform also handle "application/octet-stream" as unknown.

It's been pointed out that user agents type check on files. If the mediaType is not known, users invoking the attribute can't do anything useful with it, so null is better. What are the use cases for using application/octet-stream instead?

I guess not known might be useful. Can't we just make it the empty string then? I don't really see the need to return something other than a DOMString.


Also, maybe we should just call this type? File.type seems unambiguous enough.

"mediaType" is more specific than "type".

But it is less consistent with <style>.type, <script>.type, <link>.type, etc. I'm not sure we use mediaType anywhere right now.


--
Anne van Kesteren
http://annevankesteren.nl/

Reply via email to