Open annevk opened 6 years ago
What would you use instead of MIME types?
The question is really how many places sniff. If this is all local to the font loader, it could just perform the sniffing and dispatch to the appropriate parser algorithm. You shouldn't need a MIME type to find a parser algorithm, generally.
I think it's still useful to use MIME types as the canonical label for given parsers, even if they're not exposed to web developers.
We could call this spec the "resource sniffer algorithm" and make up our own ad-hoc labels for each format/parser, but that doesn't seem like a useful thing to do when MIME types already exist.
Maybe, I'm still a little unsure if font sniffing should be in this specification at all if the only caller is the font loader. Though maybe it makes more sense with the cross-origin thingy Chrome is working on?
Is there a conclusion on font MIME type sniffing? @annevk If it is not used, should this issue be closed?
btw Font MIME types defined in RFC 8081: The "font" Top-Level Media Type
Tentatively, since fonts always use CORS, it matters less that they are sniffed for CORB/Spectre purposes. The actual sniffing should be defined as part of the font loader I think, which I guess would be part of some CSS font specification.
We have sniffing for fonts, but as far as I know we only use that to determine which font parser to use, and we don't really need MIME types for that. (E.g.,
X-Content-Type-Options
is ignored for fonts.)cc @svgeesus