[whatwg] Script-related feedback

Anne van Kesteren annevk at annevk.nl
Wed Jan 9 13:22:43 PST 2013

On Wed, Jan 9, 2013 at 9:32 PM, Ian Hickson <ian at hixie.ch> wrote:
> Advantages of putting this in JS over multipart:
>  - it's backwards-compatible
>  - it's easier to parse a static barrier than a multipart/*'s wacky
>    syntax.
>  - it doesn't impact any of the current fetching logic, since it's
>    still just one resource instead of introducing a layer in between
>    <script>'s logic and the JS logic.
>  - it automatically works anywhere you can use JS, not just where HTTP is
>    involved.
>  - it can be shimmed more easily (if you trust the JS not to have
>    arbitrary injection and be written with the shim in mind, especially).
>  - it doesn't run into weird problems like what if a part has the wrong
>    MIME type.
>  - it's way easier to deploy (authors hate having to set MIME types).
>  - it doesn't run into the problem that all UAs have historically ignored
>    the MIME type of script.

Adding magic meaning to certain JavaScript comments seems like a
pretty big downside though. Furthermore, multipart logic, however
weird, is a sunk cost both on consumer and producer side, whereas
introducing /*@BREAK*/ seems like a very steep uphill battle. And
actually <img> is a precedent for checking a MIME type before
sniffing/executing and it hasn't been much of a problem. (The problems
there were mostly figuring out how SVG should work.)


More information about the whatwg mailing list