Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.8
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Terms: Create pages and objects thereon using technology defined by formal grammars published in the most recent versions available, when they are supported by user programs. Use elements and attributes so that they conform to specifications, respecting the semantic aspect. In particular, for HTML (HyperText Markup Language) markup languages and XHTML (eXtensible HyperText Markup Language):
      a) for all new sites, use at least version 4.01 of HTML, or preferably version 1.0 of XHTM, in any case, with Strict DTD (Document Type Definition);
      b) for existing sites, instead of the first application, where it is not possible to comply with point a), it shall be permitted to use the version of the above-mentioned languages with Transitional DTD, but with the following cautions:
      1. avoid using, within the markup language in which the page is coded, elements and attributes to define the page's presentation characteristics (for example, characteristics of the text characters, colours of the text and the background, etc.), and use CSS (Cascading Style Sheets) to achieve the same graphic effect instead;
      2. avoid generating new windows. Where this is not possible, explicitly warn the user of the change of focus;
      3. plan the transition of the entire site to the Strict DTD version of the language used, informing the Prime Minister's Office - Department for Innovation and Technology, and the National Centre for Computing in Public Administration.

      WCAG 1.0 References: 3.1, 3.2, 3.5, 3.6, 3.7, 11.1, 11.2
      Sec. 508 References: None

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            nfreear Nick Freear added a comment -

            My patch for MDL-7883 would 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.

            Show
            nfreear Nick Freear added a comment - My patch for MDL-7883 would 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 .
            Hide
            dougiamas Martin Dougiamas added a comment -

            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?

            Show
            dougiamas Martin Dougiamas added a comment - 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?
            Hide
            nfreear Nick Freear added a comment -

            Hi martin. Thanks for using the patch so quickly Did you purposefully leave out this bit out of the new function 'debug_header'?

            + 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/, so again useful for debugging if we are going the 'Strict' route, not disastrous but not ideal in production mode.

            Cheers Nick

            Show
            nfreear Nick Freear added a comment - Hi martin. Thanks for using the patch so quickly Did you purposefully leave out this bit out of the new function 'debug_header'? + 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/ , so again useful for debugging if we are going the 'Strict' route, not disastrous but not ideal in production mode. Cheers Nick
            Hide
            skodak Petr Skoda added a comment -

            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 broke validation because name and id attributes are not the same, committing fix, please review

            Show
            skodak Petr Skoda added a comment - 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 broke validation because name and id attributes are not the same, committing fix, please review
            Hide
            dougiamas Martin Dougiamas added a comment -

            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
            2) Serving XHTML Strict normally in all other debugging modes
            3) Serving XHTML Transitional in DEBUG_NONE mode (and we can look at making this strict later too)

            Show
            dougiamas Martin Dougiamas added a comment - 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 2) Serving XHTML Strict normally in all other debugging modes 3) Serving XHTML Transitional in DEBUG_NONE mode (and we can look at making this strict later too)
            Hide
            dougiamas Martin Dougiamas added a comment -

            Further correction to (3), it now serves STRICT even in DEBUG_NONE, at least until release.

            Show
            dougiamas Martin Dougiamas added a comment - Further correction to (3), it now serves STRICT even in DEBUG_NONE, at least until release.
            Hide
            dougiamas Martin Dougiamas added a comment -

            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.

            Show
            dougiamas Martin Dougiamas added a comment - 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.
            Hide
            dougiamas Martin Dougiamas added a comment -

            Note that we are now definitely aiming for XHTML Strict 1.0 compliance!!!!

            Show
            dougiamas Martin Dougiamas added a comment - Note that we are now definitely aiming for XHTML Strict 1.0 compliance!!!!
            Hide
            dougiamas Martin Dougiamas added a comment -

            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.

            Show
            dougiamas Martin Dougiamas added a comment - 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.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            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.
            2) Processing them in get_string()...

            Or am I wrong? Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - 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. 2) Processing them in get_string()... Or am I wrong? Ciao
            Hide
            dougiamas Martin Dougiamas added a comment -

            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).

            Show
            dougiamas Martin Dougiamas added a comment - 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).
            Hide
            david.horat David Horat added a comment -

            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.

            Show
            david.horat David Horat added a comment - 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.
            Hide
            david.horat David Horat added a comment -

            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
            127.0.0.1/moodle/help.php?file=text.html:123:32:3085817492.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?module=wiki&file=howtowiki.html:118:66:3086960276.108:E: there is no attribute "target"
            127.0.0.1/moodle/help.php?module=data&file=usepreset.html:112:95:3087222420.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?module=data&file=participants.html:112:95:3087009428.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?module=moodle&file=textformat.html:137:4:3087730324.79:E: end tag for element "ul" which is not open
            127.0.0.1/moodle/help.php?module=wiki&file=htmlmode.html:115:3:3087165076.65:E: document type does not allow element "dl" here; missing one of "object", "ins", "del", "map", "button" start-tag
            127.0.0.1/moodle/help.php?module=data&file=savepreset.html:112:95:3087554196.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?module=data&file=fields.html:112:95:3087738516.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?file=participantswithselectedusers.html:113:9:3086415508.108:E: there is no attribute "align"
            127.0.0.1/moodle/help.php?module=resource&file=window.html:127:4:3086124692.65:E: document type does not allow element "b" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

            Show
            david.horat David Horat added a comment - 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 127.0.0.1/moodle/help.php?file=text.html:123:32:3085817492.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?module=wiki&file=howtowiki.html:118:66:3086960276.108:E: there is no attribute "target" 127.0.0.1/moodle/help.php?module=data&file=usepreset.html:112:95:3087222420.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?module=data&file=participants.html:112:95:3087009428.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?module=moodle&file=textformat.html:137:4:3087730324.79:E: end tag for element "ul" which is not open 127.0.0.1/moodle/help.php?module=wiki&file=htmlmode.html:115:3:3087165076.65:E: document type does not allow element "dl" here; missing one of "object", "ins", "del", "map", "button" start-tag 127.0.0.1/moodle/help.php?module=data&file=savepreset.html:112:95:3087554196.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?module=data&file=fields.html:112:95:3087738516.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?file=participantswithselectedusers.html:113:9:3086415508.108:E: there is no attribute "align" 127.0.0.1/moodle/help.php?module=resource&file=window.html:127:4:3086124692.65:E: document type does not allow element "b" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
            Hide
            david.horat David Horat added a comment -

            Sorry for opening this issue. I reopened it as a new bug in: MDL-17697, MDL-17698, etc.

            Show
            david.horat David Horat added a comment - Sorry for opening this issue. I reopened it as a new bug in: MDL-17697 , MDL-17698 , etc.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Closing this. Let's go to related bugs... thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Closing this. Let's go to related bugs... thanks!
            Hide
            jk3us Jay Knight added a comment -

            It looks like there's some leftover debug statements from this commit. See MDL-23580

            Show
            jk3us Jay Knight added a comment - It looks like there's some leftover debug statements from this commit. See MDL-23580

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  31/Mar/07