Last Comment Bug 672814 - Increase the set of script @type values that nsScriptLoader treats as JavaScript
: Increase the set of script @type values that nsScriptLoader treats as JavaScript
Status: RESOLVED FIXED
: dev-doc-needed
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla17
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
: Andrew Overholt [:overholt]
Mentors:
http://www.whatwg.org/specs/web-apps/...
: 758640 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-20 08:40 PDT by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2012-08-04 18:41 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase for determining which script @type a browser supports (2.06 KB, text/html)
2012-05-25 09:42 PDT, Boris Zbarsky [:bz] (still a bit busy)
no flags Details
Part a: Move nsJSRuntime::ParseVersion to nsContentUtils (11.33 KB, patch)
2012-07-20 03:28 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review
Part b: Introduce nsContentUtils::IsJavascriptMIMEType (4.82 KB, patch)
2012-07-20 03:29 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review
Part c: Remove the typeID variable in nsScriptLoader::ProcessScriptElement (4.79 KB, patch)
2012-07-20 03:30 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review
Part c (diff -w) (4.08 KB, patch)
2012-07-20 03:31 PDT, :Ms2ger (⌚ UTC+1/+2)
no flags Details | Diff | Splinter Review
Part d: Move the type attribute parsing into a helper function (4.33 KB, patch)
2012-07-20 03:32 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review
Part e: Expand the set of JS mime types (1.01 KB, patch)
2012-07-20 03:33 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] (still a bit busy) 2011-07-20 08:40:10 PDT
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
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2011-07-20 10:15:29 PDT
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?
Comment 3 Boris Zbarsky [:bz] (still a bit busy) 2012-05-25 09:24:51 PDT
*** Bug 758640 has been marked as a duplicate of this bug. ***
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2012-05-25 09:30:50 PDT
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.
Comment 5 Boris Zbarsky [:bz] (still a bit busy) 2012-05-25 09:42:24 PDT
Created attachment 627261 [details]
Testcase for determining which script @type a browser supports
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2012-05-25 09:54:28 PDT
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)
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2012-05-25 09:54:42 PDT
Ms2ger tells me that the IE10 results match IE9.
Comment 8 Boris Zbarsky [:bz] (still a bit busy) 2012-05-25 10:00:05 PDT
Yeah, we look at the language attribute separately.
Comment 9 Odin Hørthe Omdal (odinho, Opera) 2012-05-29 02:40:01 PDT
Made a bug for Presto as well. I'll be following this bug and the WebKit one.
Comment 10 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:28:40 PDT
Created attachment 644243 [details] [diff] [review]
Part a: Move nsJSRuntime::ParseVersion to nsContentUtils
Comment 11 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:29:26 PDT
Created attachment 644244 [details] [diff] [review]
Part b: Introduce nsContentUtils::IsJavascriptMIMEType
Comment 12 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:30:49 PDT
Created attachment 644245 [details] [diff] [review]
Part c: Remove the typeID variable in nsScriptLoader::ProcessScriptElement
Comment 13 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:31:37 PDT
Created attachment 644246 [details] [diff] [review]
Part c (diff -w)
Comment 14 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:32:58 PDT
Created attachment 644247 [details] [diff] [review]
Part d: Move the type attribute parsing into a helper function
Comment 15 :Ms2ger (⌚ UTC+1/+2) 2012-07-20 03:33:36 PDT
Created attachment 644248 [details] [diff] [review]
Part e: Expand the set of JS mime types
Comment 16 Boris Zbarsky [:bz] (still a bit busy) 2012-07-20 14:29:06 PDT
Comment on attachment 644243 [details] [diff] [review]
Part a: Move nsJSRuntime::ParseVersion to nsContentUtils

Please rev the nsIScriptRuntime IID, and r=me.
Comment 17 Boris Zbarsky [:bz] (still a bit busy) 2012-07-20 14:31:18 PDT
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.
Comment 18 Boris Zbarsky [:bz] (still a bit busy) 2012-07-20 14:35:26 PDT
Comment on attachment 644245 [details] [diff] [review]
Part c: Remove the typeID variable in nsScriptLoader::ProcessScriptElement

r=me
Comment 19 Boris Zbarsky [:bz] (still a bit busy) 2012-07-20 14:37:41 PDT
Comment on attachment 644247 [details] [diff] [review]
Part d: Move the type attribute parsing into a helper function

r=me
Comment 20 Boris Zbarsky [:bz] (still a bit busy) 2012-07-20 14:38:12 PDT
Comment on attachment 644248 [details] [diff] [review]
Part e: Expand the set of JS mime types

r=me
Comment 22 Ed Morley [:emorley] 2012-08-04 11:29:29 PDT
Backed out with the mass tree revert to get rid of the OS X M5 orange:
https://hg.mozilla.org/mozilla-central/rev/c801b99d726f

Note You need to log in before you can comment on or make changes to this bug.