W3C home > Mailing lists > Public > public-html@w3.org > April 2009

Re: [Bug 6684] Disregard of RFC 4329 and IANA MIME Media Types

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 20 Apr 2009 12:10:16 -0400
Message-ID: <49EC9E68.3000201@mit.edu>
To: Julian Reschke <julian.reschke@gmx.de>, HTML WG <public-html@w3.org>
Julian Reschke wrote:
> Q: do we have information about whether the type attribute is honored 
> for external scripts?

The Gecko code for @type on <script> is something like this, in pseudocode:

if (@type not set or empty) {
   if (@language not set or empty) {
     // Treat as default script language; what this is depends on the
     // content-script-type HTTP header or equivalent META tag
   } else {
     if (@language is one of "javascript", "livescript", "mocha",
                             "javascript1.0", "javascript1.1",
                             "javascript1.2", "javascript1.3",
                             "javascript1.4", "javascript1.5",
                             "javascript1.6", "javascript1.7",
                             "javascript1.8") {
       // Treat as javascript
     } else {
       // Treat as unknown script language; do not execute
     }
   }
} else {
   if (@type is one of "text/javascript", "text/ecmascript",
                       "application/javascript",
                       "application/ecmascript",
                       "application/x-javascript") {
     // Treat as javascript
   } else {
     // Treat as specified (e.g. if pyxpcom is installed and
     // python script is allowed in this context and the type
     // is one that the python runtime claims to handle, use that).
     // If we don't have a runtime for this type, do not execute.
   }
}

There is no difference between inline and internal scripts at this 
stage; this code executes for all <html:script> and <svg:script> 
elements.  <xul:script> might have other weirdness associated with it, 
but I don't think that should affect the HTML specification.

-Boris
Received on Monday, 20 April 2009 16:11:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:02 UTC