Ticket #775 (closed defect: fixed)
MooTools modules should mention standards mode, not XHTML, as a special requirement
| Reported by: | benjaminhawkeslewis | Owned by: | |
|---|---|---|---|
| Type: | defect | Priority: | minor |
| Milestone: | Mootools version 1.3 | Component: | Core |
| Keywords: | XHTML, standards mode, doctype | Cc: |
Description
Some MooTools modules, such as Drag and Drop, are singled out as requiring an XHTML doctype. The reason suggested for this was that without an XHTML doctype, Internet Explorer reports different values for various JavaScript? properties connected with on-screen positioning. PPK's test cases were offered as evidence:
http://www.quirksmode.org/js/doctypes.html
But this reasoning seems to be based on a misunderstanding of what PPK was saying and what the reality of doctype switching is. IE6 and IE7 have two rendering modes (quirks and "standards"). Other popular browsers have three rendering modes (quirks, almost standards, and standards). The triggers for the various rendering modes are well documented:
http://msdn2.microsoft.com/en-us/library/bb250395.aspx
http://msdn2.microsoft.com/en-us/library/bb250496.aspx
http://developer.mozilla.org/en/docs/Mozilla's_DOCTYPE_sniffing
http://www.opera.com/docs/specs/doctype/
http://developer.apple.com/internet/webcontent/bestwebdev.html
http://hsivonen.iki.fi/doctype/
http://www.webstandards.org/learn/reference/charts/doctype-switch/
http://www.alistapart.com/articles/doctype/
To summarize, IE's "standards" mode can be triggered by HTML doctypes as well as XHTML doctypes. Conversely, IE's quirks mode can be triggered by XHTML doctypes as well as HTML doctypes (for example, by including an XML declaration).
PPK offered two test cases, which demonstrate the differences in what IE6 reported in quirks mode (triggered by no doctype in this case) and "standards" mode (triggered by <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> in this case):
http://www.quirksmode.org/js/doctype_off.html
http://www.quirksmode.org/js/doctype_on.html
If we swap in an HTML 4.01 Strict doctype, we can demonstrate that IE6 reports the very same values when standards mode is triggered by an HTML doctype rather than an XHTML doctype:
http://benjaminhawkeslewis.com/www/test-cases/bhl-html-strict-positioning.html
Likewise if we take the MooTools Drag and Drop demo and convert it to HTML 4.01 Strict, it appears to operate the same as with its original XHTML doctype:
http://benjaminhawkeslewis.com/www/test-cases/mootools-drag-drop-demo-html.html
I recommend updating the documentation for these modules to indicate that they require "standards" mode rather than XHTML per se.
Please let me know the details of any further test cases required.
N.B. This is an entirely separate issue from what markup language the MooTools team wish to officially support (currently XHTML, from what I understand). I'm only talking about modules singled out as having a genuine special requirement.