This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3413 - If <META http-equiv="Content-Script-Type" content="text/javascript"> is set, then <SCRIPT src="foo.js"></SCRIPT> should be accepted without the "type" attribut.
Summary: If <META http-equiv="Content-Script-Type" content="text/javascript"> is set, ...
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: HEAD
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://www.uqtr.ca/~fortierc/meta-and...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-28 17:34 UTC by Claude Fortier
Modified: 2007-01-04 14:26 UTC (History)
1 user (show)

See Also:


Attachments

Description Claude Fortier 2006-06-28 17:34:09 UTC
In a web page where the element
<META http-equiv="Content-Script-Type" content="text/javascript">
is present, the validator gives an error when the element 
<SCRIPT>
is used without the attribut "type=".
(see http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.uqtr.ca%2F~fortierc%2Fmeta-and-script-test.html)

When a I read the HTML 4.01 Specification at section 18.2.1 "The SCRIPT element" (http://www.w3.org/TR/html4/interact/scripts.html#edef-SCRIPT), it seem to me that if the META tag is there, there is no need to put the "type=" attribut in the tag SCRIPT.

But the validator mark it as "This page is not Valid HTML 4.01 Strict!".

Am I wrong? Or it's a bug?
Comment 1 Mars 2006-10-02 15:02:04 UTC
Created attachment 440 [details]
Cyber Script
Comment 2 Claude Fortier 2006-10-02 20:03:53 UTC
Comment on attachment 440 [details]
Cyber Script

This is a virus. Don't download the file. Can someone remove this attachment?
Comment 3 Olivier Thereaux 2006-10-02 22:54:49 UTC
Thank you Claude, I removed the attachment.
Comment 4 Patrick Garies 2007-01-04 06:23:36 UTC
> Am I wrong? Or it's a bug?

The "Content-Script-Type" only refers to the content of event attributes such as "onmouseover", "onmouseout", "onchange", "onkeypress", et cetera, not the "script" element. That's similar to the way "Content-Style-Type" refers to "style" attributes, not the "style" element. In any case, the "type" attribute is required by the DTD, so it must be present for the document to be valid.

From the part of the specification you referred to:
"Documents that do not specify default scripting language information and that contain elements that specify an intrinsic event script are incorrect. User agents may still attempt to interpret incorrectly specified scripts but are not required to."

In other words, if you use event attributes, you should specify "Content-Script-Type" or face the (unlikely, but justified) event that a browser will simply ignore that attribute's content because it doesn't know the content type.
Comment 5 Claude Fortier 2007-01-04 14:26:15 UTC
(In reply to comment #4)

Thanks you Patrick for the explanation. I understand now.

Happy new year!

Claude Fortier