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 8795 - The validator incorrectly accepts a self close for the script tag as valid html syntax.
Summary: The validator incorrectly accepts a self close for the script tag as valid ht...
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: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-21 19:55 UTC by Thomas Bayus
Modified: 2011-08-23 20:24 UTC (History)
0 users

See Also:


Attachments

Description Thomas Bayus 2010-01-21 19:55:19 UTC
The validator incorrectly accepts a self close for the script tag as valid html syntax.  However, the html specs require a </script> follow a <script ... > tag

ie.  <script ... />  is treated the same way as <script ... ></script>

All of the browsers will gobble up the entire rest of html page looking for the </script> close tag, and therefore display nothing.

I was cleaning up a web page changing all of the <br> tags to <br />, etc, and I absentmindedly collapsed a <script ... ></script> pair down to <script ... />.
The validator accepted the self close syntax, but the page no longer renders.
Comment 1 Ville Skyttä 2011-08-23 20:24:35 UTC
It is not a validation error to use <script ... /> in XHTML, but as you noted, doing so does have compatibility issues with browsers.