|
My major worry about using Strict is dealing with user-entered data.
How accessible is a web site that barfs the browser on every little missing character? Not very. I think we are aiming here for option b) which is compliance with strict in all except name. So Nick's patch is very good for testing in strict and removing non-strict code from Moodle itself, but pages served to Moodle users in general should continue being labelled XHTML 1.0 Transitional, for usability reasons. Does that sound reasonable to everyone? Hi martin. Thanks for using the patch so quickly
+ if (debugging()) { + // Substitute document-type, s (PCRE_DOTALL) + $output = preg_replace('/(<!DOCTYPE.+?>)/s', $strict, $output); + } I'm not sure I was clear explaining the patch - there are 2 separate issues: 1. Serving as 'application/xhtml+xml' (or application/xml in Win IE 5+) forces the browser into XHTML mode, where it 'barfs' (displays a parser error in place of the page) at you for XML-well formedness errors - not closing elements <p> </p>, not closing empty elements <img />, stray reserved characters & or < and so on. As you say, until we can consistently process user-entered data this would not be good for production mode, only for debugging. 2. Substituting the Strict document-type (code above), serving with either 'application/xhtml+xml' or 'text/html' does NOT cause the browser to 'barf' if you use a deprecated or non-standard element or attribute - something not in the DTD. You WILL get errors in the W3C validator, or a tool like HTML Validator for Firefox, http://users.skynet.be/mgueury/mozilla/ Cheers Nick I have noticed that the last change in weblib.php http://moodle.cvs.sourceforge.net/moodle/moodle/lib/weblib.php?r1=1.722&r2=1.723
Nick, my mistake, I did misunderstand this. It's nice to know that the barfing is optional
I've brought that functionality back in, so that Moodle is currently: 1) Browser barfing on XHTML Strict errors in DEBUG_DEVELOPER debugging mode Further correction to (3), it now serves STRICT even in DEBUG_NONE, at least until release.
WARNING: the HTML W3C Tidy browser extension is much more forgiving than the online W3C checker!
I've added some subtasks we might have missed. Note that we are now definitely aiming for XHTML Strict 1.0 compliance!!!!
A great deal of work has been done on this recently, and Moodle it validating pretty well.
There are still a few corners here and there where errors may happen, but these sorts of errors do not cause browser problems OR accessibility problems. Nevertheless, we continue to work on them. Hi. Recently I added some minor changes in some scripts to be correct XML.
Well I was doing that I detected that a lot of lang-based strings contain the "forbidden" chars (quotes,ampersands...). How are we going to handle them? 1) Converting all the lang files. Or am I wrong? Ciao I'm closing this bug because Moodle is validating pretty well now generally. We can file new bugs for anything new that comes up (such as the strings issue which seems to only affect some languages).
I have found several validation errors at least in Moodle version: 1.9.3+ (19/12/2008). I will post them as comments in this issue.
Help files (at least en_utf8) that do not comply with XHTML 1.0 Strict and the first error found for each file:
127.0.0.1/moodle/help.php?file=reading.html:124:37:3086136980.65:E: document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag Closing this. Let's go to related bugs... thanks!
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MDL-7883would help us move towards XHTML Strict. It would be useful to document which system (and pedagocical) standards Moodle conforms with, http://docs.moodle.org/en/Standards