Closed Bug 672814 Opened 14 years ago Closed 13 years ago

Increase the set of script @type values that nsScriptLoader treats as JavaScript

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: bzbarsky, Assigned: Ms2ger)

References

()

Details

(Keywords: dev-doc-needed)

Attachments

(7 files)

The HTML5 draft has: "application/ecmascript" "application/javascript" "application/x-ecmascript" "application/x-javascript" "text/ecmascript" "text/javascript" "text/javascript1.0" "text/javascript1.1" "text/javascript1.2" "text/javascript1.3" "text/javascript1.4" "text/javascript1.5" "text/jscript" "text/livescript" "text/x-ecmascript" "text/x-javascript" I don't know about all of these, but at least WebKit and Presto and Trident support text/jscript... See http://stackoverflow.com/questions/6760193/javascript-jquery-works-in-every-browser-except-firefox
Note that I'm not convinced about everything in that list. None of Gecko, WebKit, Presto support "text/javascript1.0" as far as I can tell. Does Trident?
So text/javascript1.0 and friends are because of > Otherwise, the element has a non-empty language attribute; let the script > block's type for this script element be the concatenation of the string > "text/" followed by the value of the language attribute. I'm not convinced that's a good thing... I'll have a look at supporting the others.
Assignee: nobody → Ms2ger
OS: Mac OS X → All
Hardware: x86 → All
So based on that testcase, browser engine support for the type values is like so ("IE" means all IE modes unless annotated otherwise: "application/ecmascript": Gecko, Presto, WebKit, IE (in IE9 Standards document mode only) "application/javascript": Gecko, Presto, WebKit, IE (in IE9 Standards document mode only) "application/x-ecmascript": Presto "application/x-javascript": Gecko, Presto, WebKit, IE (in IE9 Standards document mode only) "text/ecmascript": All "text/javascript": All "text/javascript1.0": None "text/javascript1.1": WebKit, IE "text/javascript1.2": WebKit, IE "text/javascript1.3": WebKit, IE "text/javascript1.4": None "text/javascript1.5": None "text/jscript": Presto, WebKit, IE "text/livescript": WebKit, IE "text/x-ecmascript": Presto "text/x-javascript": Presto, IE (in IE9 Standards document mode only)
Ms2ger tells me that the IE10 results match IE9.
Yeah, we look at the language attribute separately.
Made a bug for Presto as well. I'll be following this bug and the WebKit one.
Comment on attachment 644243 [details] [diff] [review] Part a: Move nsJSRuntime::ParseVersion to nsContentUtils Please rev the nsIScriptRuntime IID, and r=me.
Attachment #644243 - Flags: review?(bzbarsky) → review+
Comment on attachment 644244 [details] [diff] [review] Part b: Introduce nsContentUtils::IsJavascriptMIMEType The comment about survey data doesn't seem all that relevant anymore. r=me modulo that.
Attachment #644244 - Flags: review?(bzbarsky) → review+
Comment on attachment 644245 [details] [diff] [review] Part c: Remove the typeID variable in nsScriptLoader::ProcessScriptElement r=me
Attachment #644245 - Flags: review?(bzbarsky) → review+
Comment on attachment 644247 [details] [diff] [review] Part d: Move the type attribute parsing into a helper function r=me
Attachment #644247 - Flags: review?(bzbarsky) → review+
Comment on attachment 644248 [details] [diff] [review] Part e: Expand the set of JS mime types r=me
Attachment #644248 - Flags: review?(bzbarsky) → review+
Backed out with the mass tree revert to get rid of the OS X M5 orange: https://hg.mozilla.org/mozilla-central/rev/c801b99d726f
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: