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

RESOLVED FIXED in mozilla17

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: bz, Assigned: Ms2ger)

Tracking

({dev-doc-needed})

Trunk
mozilla17
dev-doc-needed
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(7 attachments)

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
(Assignee)

Comment 1

6 years ago
http://www.w3c-test.org/html/tests/submission/Ms2ger/the-elements-of-html/scripting/the-script-element/script-languages-02.html
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?
Duplicate of this bug: 758640
(Assignee)

Comment 4

5 years ago
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
Created attachment 627261 [details]
Testcase for determining which script @type a browser supports
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.
(Assignee)

Comment 10

5 years ago
Created attachment 644243 [details] [diff] [review]
Part a: Move nsJSRuntime::ParseVersion to nsContentUtils
Attachment #644243 - Flags: review?(bzbarsky)
(Assignee)

Comment 11

5 years ago
Created attachment 644244 [details] [diff] [review]
Part b: Introduce nsContentUtils::IsJavascriptMIMEType
Attachment #644244 - Flags: review?(bzbarsky)
(Assignee)

Comment 12

5 years ago
Created attachment 644245 [details] [diff] [review]
Part c: Remove the typeID variable in nsScriptLoader::ProcessScriptElement
Attachment #644245 - Flags: review?(bzbarsky)
(Assignee)

Comment 13

5 years ago
Created attachment 644246 [details] [diff] [review]
Part c (diff -w)
(Assignee)

Comment 14

5 years ago
Created attachment 644247 [details] [diff] [review]
Part d: Move the type attribute parsing into a helper function
Attachment #644247 - Flags: review?(bzbarsky)
(Assignee)

Comment 15

5 years ago
Created attachment 644248 [details] [diff] [review]
Part e: Expand the set of JS mime types
Attachment #644248 - Flags: review?(bzbarsky)
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+
(Assignee)

Comment 21

5 years ago
https://hg.mozilla.org/mozilla-central/rev/39877da5d9dd
https://hg.mozilla.org/mozilla-central/rev/a246a4b88efb
https://hg.mozilla.org/mozilla-central/rev/ad10220d8093
https://hg.mozilla.org/mozilla-central/rev/7bdb887fadcf
https://hg.mozilla.org/mozilla-central/rev/8d520e1c2936
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
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 → ---
https://hg.mozilla.org/integration/mozilla-inbound/rev/48977890b1b8
https://hg.mozilla.org/integration/mozilla-inbound/rev/db7c6b522dcf
https://hg.mozilla.org/integration/mozilla-inbound/rev/72823d80a566
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b9b6c46393f
https://hg.mozilla.org/integration/mozilla-inbound/rev/7641d18552a6
https://hg.mozilla.org/mozilla-central/rev/48977890b1b8
https://hg.mozilla.org/mozilla-central/rev/db7c6b522dcf
https://hg.mozilla.org/mozilla-central/rev/72823d80a566
https://hg.mozilla.org/mozilla-central/rev/2b9b6c46393f
https://hg.mozilla.org/mozilla-central/rev/7641d18552a6
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.