DOCTYPE declaration should be leading over extension

RESOLVED INVALID

Status

()

Firefox
General
RESOLVED INVALID
11 years ago
11 years ago

People

(Reporter: Hendrik van der Linde, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
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
(Reporter)

Comment 1

11 years ago
Created attachment 253454 [details]
XHMTL containing SVG
(Reporter)

Comment 2

11 years ago
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
Last Resolved: 11 years ago
Component: Extension Compatibility → General
Resolution: --- → INVALID
(Reporter)

Comment 4

11 years ago
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.