3 ms·
As far as I recall the HTML 4.0 and XHTML 1.0 specs were drafted side by side and which one you want to give credit for introducing the different DTD "modes" is
by WorldMaker 4y ago
As far as I recall the HTML 4.0 and XHTML 1.0 specs were drafted side by side and which one you want to give credit for introducing the different DTD "modes" is a matter of perspective. My perspective from that time was that because the "modes" affected XHTML parsing (and mime types) so much more than they affected HTML 4 they always seemed to me designed for XHTML and back-ported/side-ported to HTML 4.
The DTDs were a signal designed to opt into different parsing and rendering modes, including CSS rendering differences (and as I recall even differences in ES3 mode "option strict"/proto-ES5; though memory is hazy and I don't remember which browser I think did that in my testing at the time) and DTDs were a simpler signal than most of the other alternatives at the time and since (META tags/Headers). They were never independent concerns in practice, though sure they could have been in theory. Rendering changes were one of the reasons few developers opted into XHTML 1.x Strict.
- goto11 4y agoAccording to Wikipedia, HTML 4 was published in 1997, XML in 1998 and XHTML 1.0 in 2000, so it is unlikely there was any backporting from XHTML 1.0 to HTML 4. The issue around DTD's is confusing because browsers use the <!DOCTYPE>-tag as a signal to switch between quirks and standards rendering modes. This might suggest a connection between the DTD's and the rendering modes, but in reality browsers have always ignored the DTDs. They just match the <!DOCTYPE> against some predefined strings to determine the mode. And the DTD's was never designed for this purpose, it was just a hack introduced by browser vendors. > Rendering changes were one of the reasons few developers opted into XHTML 1.x Strict. XHTML 1.x strict was rendered the same way as the corresponding HTML in standards mode. But given the confusion around the issues, it is possible some developers thought it would render differently.