Doctype switching for SGML comments

Back to the HTML and SGML comments article.

This article is now being made obsolete

Due to the problems pointed out by this article, SGML comments have been removed from Acid 2, and future HTML versions will not require SGML comments. Browsers that have implemented them are now expected to remove their support for SGML comments, for all HTML versions.

O
B
S
O
L
E
T
E

Opera 9+ and Mozilla 1.5+ tie SGML comments to their strict modes, and as a result, their response is very similar. In all the places where it counts, they are the same. Konqeror 3.4.9+, and Safari 2.0.2+ are more cautious, and enable SGML comments only on pages that trigger strict mode, unless the page uses either a transitional or frameset doctype (even with XHTML). iCab 3.0.1+ is even more restrictive. It only enables SGML comments on pages with HTML strict doctypes, and all XHTML doctypes except frameset.

Note: if you use a browser that supports CSS 2 selectors, this table will look better. I could fix it with classes, but I am not going to litter my document with an extra 150 class attributes, just to make up for the shortcomings of your browser. There are better browsers available that work properly. I recommend Opera, but you could also use Mozilla/Firefox, Konqueror, Safari, OmniWeb, iCab, and a few other browsers too. See my browser list for more details. It's your choice, no-one is forcing you, but you only have yourself to blame.

Don't see your browser listed in the table? That's because your browser does not correctly support SGML comments in HTML.

Table of what doctypes cause browsers to enable support for SGML comments. This is not the same as CSS response to doctypes, please do not read it as such.
Language Version Variant URL Opera Firefox Konqueror
Safari
iCab Test Comments
None Quirks Quirks Quirks Quirks Test
Not HTML
(Unknown)
SGML Quirks Quirks Quirks Test Used for WML (and early HTML 5) - not supported by anything except Opera so the response of other browsers is not really important - should use strict here for WML support
HTML None No Quirks SGML SGML Quirks Test
Yes Quirks SGML SGML Quirks Test
3 Quirks Quirks Quirks Quirks Test
4.0 Transitional No Quirks Quirks Quirks Quirks Test
Yes Quirks Quirks Quirks Quirks Test
Frameset No Quirks Quirks Quirks Quirks Test
Yes Quirks Quirks Quirks Quirks Test
Strict No SGML SGML SGML SGML Test
Yes SGML SGML SGML SGML Test
4.01 Transitional No Quirks Quirks Quirks Quirks Test
Yes SGML SGML Quirks Quirks Test
Date SGML SGML Quirks Quirks Test
Frameset No Quirks Quirks Quirks Quirks Test
Yes SGML SGML Quirks Quirks Test
Date SGML SGML Quirks Quirks Test
Strict No SGML SGML SGML SGML Test
Yes SGML SGML SGML SGML Test
5 SGML SGML SGML Quirks Test
ISO 1999 Short Quirks SGML SGML Quirks Test Not used on the Web - included only for interest - response is not important
Long SGML SGML SGML Quirks Test
ISO 2000 Short Quirks SGML SGML Quirks Test
Long SGML SGML SGML Quirks Test
XHTML 1.0 Transitional No SGML SGML Quirks SGML Test
Yes SGML SGML Quirks SGML Test
Frameset No SGML SGML Quirks Quirks Test
Yes SGML SGML Quirks Quirks Test
Strict No SGML SGML SGML SGML Test
yes SGML SGML SGML SGML Test
1.1 No SGML SGML SGML SGML Test
Yes SGML SGML SGML SGML Test
Basic 1.0 No SGML SGML SGML SGML Test
Yes SGML SGML SGML SGML Test

Back to the HTML and SGML comments article.