Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.
This repository was archived by the owner on May 5, 2022. It is now read-only.

Parsable MIME type is going away #113

Closed
whatwg/html
#7851

Description

@annevk

In whatwg/mimesniff#36 I'm changing some of the fundamentals around MIME types. It'll be called a "MIME type" or "MIME type record" now.

I'm also not super happy about the term "supported by the user agent" which I think Preload is the only consumer of:

  1. It's overly generic and not clear it applies to just MIME types.
  2. The definition leaves a lot to be desired. Is text/javascript supported?

Activity

  1. yoavweiss commented on Oct 9, 2017

    @yoavweiss
    Contributor

    The processing of type with <link rel=preload> should not differ from the processing of type in <picture><source></picture>.
    Looking at https://html.spec.whatwg.org/multipage/images.html#updating-the-source-set (step 4.8) it seems to be the case. (HTML just doesn't point at the definition of "supported MIME type" but to "MIME type" itself)

    I'll be happy to switch preload (as well as HTML's image processing) to any definition of that term that you prefer.

  2. annevk commented on Oct 9, 2017

    @annevk
    MemberAuthor

    So you just want to match <picture>? What about <video><source>? What about text/html?

  3. yoavweiss commented on Oct 10, 2017

    @yoavweiss
    Contributor

    The reason I brought up <picture> is because that's the one I know requires similar hooks. You're right that <video><source> is similar, and it seems to be using "a type that the user agent knows it cannot render", which would also fit the bill if defined in a way that is not media specific.

    What about text/html?

    I'm not sure what you mean by that. Can you elaborate?

  4. annevk commented on Oct 10, 2017

    @annevk
    MemberAuthor

    I think I still don't understand your requirements. What <picture> and <video> need seems much more limited. Again, in OP I brought up text/javascript, which isn't typically seen by the user. Is that something you might preload? I'd think so.

  5. yoavweiss commented on Oct 12, 2017

    @yoavweiss
    Contributor

    I don't think there's a true use case to avoid loading <link rel=preload as=image type="text/javascript"> or the like. The important thing with type is to avoid loading resources that the UA does not support at all. Is this the part that wasn't clear to you about the requirements for preload? Or is it something else?

    As an aside, it's not clear to me from updating the source set algorithm what should be done with e.g. <picture><source srcset=foo type="text/javascript"><img></picture>.

  6. annevk commented on Oct 12, 2017

    @annevk
    MemberAuthor

    That's probably a good bug to file against "updating the source set".

    I was just asking since the current text talks about being able to interpret the resource and present it. But we support some types we don't really present as well. And yeah, type being used with a value that doesn't match as is confusing too. The text should probably clarify that type is being used as a boolean check irrespective of other attributes (or we need to define something more detailed).

  7. domenic commented on Oct 13, 2017

    @domenic
    Contributor

    Why would "parseable MIME type" go away? I think it'd be any string/byte sequence for which https://mimesniff.spec.whatwg.org/branch-snapshots/annevk/mime-type/#parse-a-mime-type does not return failure.

  8. annevk commented on Oct 13, 2017

    @annevk
    MemberAuthor

    I don't think that's a useful thing to have similar to how not having a "parseable URL" is fine. You parse something and then you use it for all kinds of things. You don't continue parsing it for use in a conditional.

  9. yoavweiss commented on Oct 15, 2018

    @yoavweiss
    Contributor

    @annevk getting back to this. IIUC, what we need here (other than changing the link from "parsable mime type" to "mime type") is to redefine "supported by the user agent" in a way that's not tied to presentation. Does that match your understanding?

  10. annevk commented on Oct 16, 2018

    @annevk
    MemberAuthor

    I think it also needs to be made clearer when type is involved in the decision making process and how the user agent is to react to different values. E.g., if Chrome were to preload <link rel=preload as=image type=text/javascript>, but Firefox would not, and the specification were to allow either, I think there's a problem.

  11. added this to the Level 1 milestone on Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions