Closed Bug 392566 Opened 18 years ago Closed 18 years ago

XHTML anchors with closing tags in the wrong place

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: tomer, Unassigned)

Details

Attachments

(1 file)

I got noticed that anchors in XHTML do not behave as it should. If we specify anchors without any text, Gecko (including 1.9) won't trust the element closing tag, and this make the anchor live forever. I.e., "<a name="foo" id="foo" />bar" should not be rendered as "<a>bar</a>". I'm attaching a testcase for your pleasure. The testcase validate well in W3C XHTML, but tidy like it to be <a></a>, so maybe I'm wrong and Gecko should never behave like I want it to.
Attachment #277072 - Attachment mime type: text/html → application/xhtml+xml
Strange. As Alex Vincent changed the mime type to application/xhtml+xml the testcase returns the expected result. Gecko do not trust the xhtml-strict doctype?
No. It trusts whatever the server sent the document as. You filed it as text/html, and that means tag soup. http://72.14.253.104/search?q=cache:ioeUkb_PLJEJ:www.hixie.ch/advocacy/xhtml+XHTML+as+text/html&hl=en&ct=clnk&cd=3&gl=us&client=firefox-a
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
1. This problem only happens with anchors, but not with other XHTML tags like <p /> , <meta /> and <br />. I would expect Gecko to be consistent in its behavior. 2. So, on the practical side, this means (a) I need to change my web server default MIME type or (b) to supply files with different file extension and thus different MIME type. Personally I don't think both a good answers for the XHTML standard. 3. According to this bug, I can conclude that Gecko ignores the this file's DOCTYPE, which, as I see it, is problematic as we try to keep our pages w3c valid. Thanks.
Component: DOM: HTML → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: