Skip to content

javascript media types in §3.1.2 #1353

Closed

Description

@iherman

The spec lists two media types:

  • application/javascript
  • text/javascript

the second one is listed as obsolete in RFC4329; on the other hand, it lists application/ecmascript as valid and text/ecmascript, too,as obsolete.

I would propose to allow for all four, but marking the text/* as obsolete (ie, discourage authors to use it)

Activity

  1. mattgarrish commented on Oct 23, 2020

    @mattgarrish
    Member

    This only applies to the package document declaration. You can use any media type in the actual html files. Do we really need to have four possibilities? It's more likely to cause issues with older reading systems.

  2. iherman commented on Oct 24, 2020

    @iherman
    MemberAuthor

    If it is only for package document, then we should probably say that the one that authors SHOULD use is application/javascript but make a note that the other three are acceptable, but not RECOMMENDED to be used. Newer content following this would work with older and newer RS-s, older contents will also be handled.

    The current text does put application/javascript and text/javascript on equal footing, and that contradicts RFC4329...

  3. mattgarrish commented on Oct 24, 2020

    @mattgarrish
    Member

    The current text does put application/javascript and text/javascript

    Because up until 3.2 only text/javascript was allowed and exists in a lot of EPUBs that publishers don't want rejected from vendors because it's no longer recommended (i.e., warning). It's not about providing complete coverage of all possible media types, as there are 10+ other ways of indicating a javascript.

    Adding more without addressing the whole issue of core media types just provides another angle of rejection from vendors who don't update their validation every time there's a new specification.

  4. iherman commented on Oct 24, 2020

    @iherman
    MemberAuthor

    I think we can forget about the historical stuff as listed in full list of js references. Let us consider RFC4329 which lists four or these, and that is already quite enough :-)

    There are several issues

    • application/ecmascript, per RFC4329, is perfectly o.k. even if not widely used. I do not think we should disallow something that is standard compliant
    • We should have some way to push our authors to use application/{javascript,ecmascript} and not their text equivalent. We may hit the problem that future web cores or other javascript tools may have issues with text/*, and we want to avoid that

    We may list all four as possibilities, without formally designating text/* as wrong (ie, epubcheck should not flag their usage), but add an editorial note to make it clear that authors should not (as opposed to SHOULD NOT) use these, because they are considered to obsolete.

    Would that work?

  5. mattgarrish commented on Oct 24, 2020

    @mattgarrish
    Member

    I just think this is more important an issue for content (where you're not bound to the validation/CMT constraints of the package) and potentially more problematic than it's worth for the package on its own.

    But it's not a hill I'm going to die on, as the hackneyed saying goes, as I'm more interested in solving non-content document CMTs more broadly so we don't continue to run into this problem going forward.

  6. OriKuttner commented on Oct 24, 2020

    @OriKuttner
  7. dauwhe commented on May 4, 2021

    @dauwhe
    Contributor

    I don't have any particular interest in “encouraging” the use of a particular media type. What is defined in the package document doesn't matter for script execution! But I worry that we disallow the perfectly valid application/ecmascript. I would propose adding this.

  8. mattgarrish commented on May 7, 2021

    @mattgarrish
    Member

    application/ecmascript. I would propose adding this.

    I can live with this, since it's at least a recommended media type. Adding an obsolete media type to match a mistaken use of an obsolete media type is bad form.

    Since we're adding other new media types, I suppose the pain of rejection from old validators is no more or less than for the others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EPUB33Issues fixed in the EPUB 3.3 revisionSpec-EPUB3The issue affects the core EPUB 3.X Recommendation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions