The script language attribute

Hello!

While reviewing the 3.17. Scripting section [1] of the HTML 5  
specification, the "language" attribute got my attention.


1. The algorithm for running a script includes the usage of the "language"  
attribute. This attribute is, however, left undefined. The spec should  
"define" the attribute as a legacy attribute and non-conformant.


2. The algorithm for running a script says that the value of the  
"language" attribute is prefixed with "text/", and that the resulting  
string is the MIME type of the given script. However, I believe that's not  
a complete interpretation of the "language" attribute. It's known there  
are documents which use values such as "JavaScript", "Javascript",  
"JavaScript 1.2", "JScript", "javascript1.5", etc.

The value is generally a mess.


Two possible solutions:

a) The spec defines some "algorithm" in regards to the language attribute  
value. Something like:

"The language attribute value must be lower cased. If the value starts  
with 'jscript' or 'javascript', then set a new attribute value  
'javascript'. The script MIME type is the concatenation of the 'text/'  
string with the language attribute value."

That's probably still too simple, or maybe it works well enough, given  
current implementations. I don't think current major UAs really "care"  
what's the value of the language attribute.


b) Mention that the language attribute value may require additional  
parsing for legacy content, giving some examples "Javascript1.2",  
"javascript 1.5", being all simply interpreted as "javascript".





[1]  
http://www.whatwg.org/specs/web-apps/current-work/multipage/section-scripting0.html



-- 
http://www.robodesign.ro

Received on Saturday, 8 September 2007 12:09:32 UTC