Bug 11063

Summary: Scripting MIME Types application/ecmascript, application/javascript not viewable
Product: WebKit Reporter: Sierk Bornemann <sierkb>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: ap, aroben, beidson, ddkilzer
Priority: P2 Keywords: EasyFix, HasReduction
Version: 420+   
Hardware: All   
OS: OS X 10.4   
URL: http://www.ietf.org/rfc/rfc4329.txt
Description Flags
Test application/ecmascript
Test application/javascript
Test application/x-javascript
Patch v1 darin: review+

Description Sierk Bornemann 2006-09-27 12:49:35 PDT
IESG approved registration of the application/ecmascript and related media types.

IANA|Text Media-Types, http://www.iana.org/assignments/media-types/text/
IANA|Application Media-Types, http://www.iana.org/assignments/media-types/application/

RFC 4329 "Scripting Media Types" defines valid MIME-Types for ECMAScript and JavaScript and marks which ones are invalid. See ftp://ftp.rfc-editor.org/in-notes/rfc4329.txt for details.

The use of the former used MIME Types text/ecmascript, text/javascript and text/x-javascript is discouraged (marked obsolete) in favour of application/ecmascript (ECMAScript) and application/javascript (JavaScript).

Web browsers should recognize and handle these new MIME Types correctly.
Comment 1 Sierk Bornemann 2006-09-28 05:56:09 PDT
See also KHTML Bug 134763 with additional Patch on http://bugs.kde.org/show_bug.cgi?id=134763
Comment 2 Sierk Bornemann 2007-02-12 01:43:27 PST
According to http://webkit.org/blog/?p=93, please fix this bug as soon as possible. It would be great, if the next Version of Safari will handle the MIME type of JavaScript/ECMAScript right, wouldn't it?
Comment 3 David Kilzer (:ddkilzer) 2007-02-12 02:52:45 PST
I believe this was fixed in r18843:


Comment 4 David Kilzer (:ddkilzer) 2007-02-12 02:55:31 PST
It seems like the static list of JavaScript MIME types used in WebCore/html/HTMLScriptElement.cpp could be used in these classes as well:


Comment 5 David Kilzer (:ddkilzer) 2007-02-12 02:56:59 PST
(In reply to comment #4)
> It seems like the static list of JavaScript MIME types used in
> WebCore/html/HTMLScriptElement.cpp could be used in these classes as well:
> WebCore/dom/DOMImplementation.cpp

In DOMImplementation::isTextMIMEType().

> WebCore/platform/MimeTypeRegistry.cpp

In initialiseSupportedNonImageMimeTypes().

Comment 6 Sierk Bornemann 2007-02-19 02:01:27 PST
If you are of the opinion, the bug is fixed and can be closed, close it.
Comment 7 David Kilzer (:ddkilzer) 2007-02-19 12:16:30 PST
Created attachment 13244 [details]
Comment 8 David Kilzer (:ddkilzer) 2007-02-19 12:18:37 PST
Created attachment 13245 [details]
Test application/ecmascript
Comment 9 David Kilzer (:ddkilzer) 2007-02-19 12:22:54 PST
(In reply to comment #8)
> Created an attachment (id=13245) [edit]
> Test application/ecmascript

The test works, but Safari won't display the source of the application/ecmascript file in the browser (like it would with application/x-javascript).

I'd like to leave this bug open to address issues from Comment #4 and Comment #5.
Comment 10 David Kilzer (:ddkilzer) 2007-02-19 12:24:33 PST
Created attachment 13246 [details]
Comment 11 David Kilzer (:ddkilzer) 2007-02-19 12:25:52 PST
Created attachment 13248 [details]
Test application/javascript
Comment 12 David Kilzer (:ddkilzer) 2007-02-19 12:27:50 PST
Created attachment 13249 [details]
Comment 13 David Kilzer (:ddkilzer) 2007-02-19 12:29:50 PST
Created attachment 13250 [details]
Test application/x-javascript
Comment 14 Sierk Bornemann 2007-02-28 18:45:18 PST
Bearing in mind the next release of MacOSX 10.5 and rumors of the shortcoming MacOS 10.4.9, I would be very happy, if this bug would be fixed in the then shipped Safari Web Browser.
Please fix the outstanding issues with special regard to Comment #4, Comment #5 and Comment #9, which seem to block this bug here from being fixed.
Comment 15 David Kilzer (:ddkilzer) 2007-03-22 04:01:27 PDT
The methods from Comment #4 should move to WebCore/platform/MimeTypeRegistry.cpp.

Comment 16 David Kilzer (:ddkilzer) 2008-01-01 22:15:52 PST
Created attachment 18232 [details]
Patch v1

Proposed fix.
Comment 17 Darin Adler 2008-01-01 22:39:56 PST
Comment on attachment 18232 [details]
Patch v1

Looks fine, r=me.
Comment 18 David Kilzer (:ddkilzer) 2008-01-01 23:00:06 PST
Committed revision 29077.