w3c / FileAPI

File API
https://w3c.github.io/FileAPI/
Other
104 stars 44 forks source link

Consider reserializing type attributes, not just parsing them. #123

Closed wisniewskit closed 4 years ago

wisniewskit commented 5 years ago

While working on Gecko's Fetch compliance, I noted that there are web platform tests which fail because they expect blob types to be passed through the MIME Sniffing standard's serialization. @annevk suggested that there may have been discussions on doing this reserialization, so I'm filing a bug to verify that option.

inexorabletash commented 5 years ago

Additional context in #43

annevk commented 5 years ago

Aside from Blob, this also affects slice() and File.

I think what should happen is that we store a MIME type internally (I think @mkruisselbrink was planning on adding internal slots) and the type getter serializes it using https://mimesniff.spec.whatwg.org/#serialize-a-mime-type.

I looked into writing a patch for this briefly, but it would end up being quite the rewrite as these bits of the specification are quite dated.

annevk commented 5 years ago

Note that there's tests for this already at /mimesniff/mime-types/parsing.any.js so this is mainly about updating the specification as also discussed at https://github.com/w3c/FileAPI/issues/43#issuecomment-347775858.

annevk commented 4 years ago

Let's duplicate this into that issue as there's no real need to track it separately.