Closed Bug 420728 Opened 16 years ago Closed 16 years ago

Closing tag '/>' for XHTML displayed as an error

Categories

(Toolkit :: View Source, defect)

defect
Not set
trivial

Tracking

()

RESOLVED DUPLICATE of bug 162653

People

(Reporter: dazjorz, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12

When opening an XHTML page and viewing the source, for non-container tags like:
<link rel="stylesheet" href="style.css" type="text/css"/>
the last '/' is red, which is normally used to describe errors. This gives the illusion the closing /> is wrong, while it is standard XML syntax.

Reproducible: Always

Steps to Reproduce:
1. Go to an XHTML page such as http://bugs.dazjorz.com/
2. View source
3. Look at a non-container tag like <link/>. See how the last '/' is red.
Actual Results:  
The '/' at the end (in '/>') is red.

Expected Results:  
I expected the '/' at the end to be black, just like the / in </title>, for example, and the > which comes after the / in for example <link/>.
It seems that server is reporting "text/html" so that why you get that "/" is red.
text/html is a valid mime type for XHTML 1.0; next to that, I have an XHTML doctype, so Firefox knows it's XML... Right?
(In reply to comment #2)
> text/html is a valid mime type for XHTML 1.0; next to that, I have an XHTML
> doctype, so Firefox knows it's XML... Right?
> 

if it is under "text/html", you are using the HTML parser instead XML parser.
But that's not right, because I have an XHTML doctype, so the file *must* be parsed by an XML parser. Isn't that a bug in Firefox itself, then?
Files are parsed according to their MIME type.  If the file is marked as text/html, then it's parsed as HTML.  Mark it as text/plain and it's not parsed at all.

The DOCTYPE is only examined for text/html, and then only to switch between HTML parsing modes--see http://developer.mozilla.org/en/docs/Mozilla%27s_DOCTYPE_sniffing for the details.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.