Closed Bug 368800 Opened 18 years ago Closed 18 years ago

DOCTYPE declaration should be leading over extension

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: h.vanderlinde, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

The extension of a document should not be leading over the DOCTYPE declaration. This means that is should be possible to create an XHTML document in a file that has the extension .html (or .html).

When the XHTML references other namespaces, like svg, it must be interpreted as XHTML and not HTML (4.x?), because this functionality is otherwise lost.

Reproducible: Always

Steps to Reproduce:
1. Create an XHTML containing SVG (see attachment)
2. Open this with the extension .xhtml
3. Verify that is renders correctly
4. Change the extensiotn to .html
5. Reopen and notice that all namespaces are ignored, while the DOCTYPE is still XHTML!

Actual Results:  
ignored SVG

Expected Results:  
document rendering according to the DOCTYPE
Attached file XHMTL containing SVG
The attachment is a nice example of the problem. When opened it is renderd as HTML 4, all XHTML namespaces are ignored. Save with .xhtml extension and reopen.
A file extension doesn't matter for a browser unless you open it from a local Filesystem or from a http0.9 server.

For usual servers the mime-type matters and a differnt doctype can't override a mime-type because you told the browser already that you this is a html document and no xhtml one. (that is by design).

"This means that is should be possible to create an XHTML document in a file
that has the extension .html (or .html)"
That is no problem at all, just let your server serve the document with the xhtml mime-type application/xhtml+xml.

Please read http://lists.w3.org/Archives/Public/www-html/2000Sep/0024.html
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Component: Extension Compatibility → General
Resolution: --- → INVALID
The discussion above is outdated. As I understand this interpreting .html not as XHTML (despite DOCTYPE)was to let older UAs render XHTML(1.0).

RFC3236 (http://www.ietf.org/rfc/rfc3236.txt) comes with some suggestions on how differentiate between HTML and XHTML. One of the methods is looking at the MIME type, but since .HTML is a common extension for XHTML other methods could be used as well (paragraph 5).

http://www.w3.org/TR/xhtml1/#issues is interesting as well.

I think FF should be looking at the doctype for all HMTL (including XHTML) since it is a modern browser that can handle XHTML.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: