W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2001

Accessibility checking in Tidy

From: Terry Teague <terry_teague@users.sourceforge.net>
Date: Sun, 4 Nov 2001 13:36:16 -0800
Message-Id: <l03130300b80b4e4d222b@[17.219.108.57]>
To: tidy-develop@lists.sourceforge.net
Cc: html-tidy@w3.org, chris.ridpath@utoronto.ca, mikes.lam@utoronto.ca
Dear Folks,

Several months ago, a programmer from the University of Toronto, Mike Lam,
approached me about integrating some changes he had developed for Tidy.
These changes provide accessibility checking beyond what Tidy does already.

In case you aren't familiar with accessibility checking, US law (the
Rehabilition Act) now requires that Federal agencies electronic and
information technology is accessible to people with disabilities. This
requirement is known as Section 508. For more info, visit :
<http://www.section508.gov>. Also the W3C has made recommendations in the
form of the Web Content Accessibility Guidelines - see
<http://www.w3.org/TR/WAI-WEBCONTENT/>.

I integrated these changes into my local copy of the current Tidy source
code, so I could evaluate its usefulness and appropriateness.

After a few discussions between Mike and myself, we had something that
worked reasonably well with the current Tidy code. Then I got busy, and I
was sort of waiting on Mike to check that the code worked on his platform
(I built him a binary) as good as his original (which I believe he based on
the 30 Apr 00 version of Tidy).

Recently Mike and his supervisor Chris Ridpath contacted me again to find
out the current state of the accessibility code, and when it would appear
in a release version of Tidy. After a couple more discussions about the
approaches we could take to integrate the changes into Tidy, I promised I
would write this EMail, and see where it took us.

My original thought was to wait until we had released the current version
of Tidy, and to release the accessibility changes as a SourceForge Patch
tracker item (using diffs) - I was waiting for the current code to settle
down before making any diff files.

Part of the justification of not releasing the accessibility changes as
part of the current Tidy source was due to timing - at the time I was
contacted, we were trying not to add new features to Tidy, but just fix
critical bugs, so we could release this thing.

However, since I have already got the changes made, and they are quite
separate from the rest of the code, there is little risk in adding the
changes at this stage (plus the fact I have them all conditionally compiled
just like the new encodings support).

One thought I had was to check in these changes on a CVS branch, so that
others could at least check out the source code, and determine for
themselves if they wished to merge the changes into their products. (I will
have to figure out how to do branches with my GUI CVS client).

The changes are briefly as follows (currently) :

1) A new file "AccessibilityChecks.c" that contains the bulk of the code.
If the name "AccessibilityChecks.c" is problem for your platform, would
something like "access.c" be a more suitable name?

2) A new command line option "-access" and a new config option
"--accessibility-check" :

-access <n>
--accessibility-check <n>

where <n> = priorities 1, 2 and 3 (as defined in
<http://www.w3.org/TR/UAAG10-TECHS/guidelines.html#Priorities> -
corresponding to conformity checking levels A, AA, AAA).

Minor changes to "config.c", "tidy.c", "html.h".

3) Conditionally compile all required modifications to existing code.

/* Enable/disable support for additional accessibility checks */
#ifndef SUPPORT_ACCESSIBILITY_CHECKS
#define SUPPORT_ACCESSIBILITY_CHECKS 1
#endif

Minor change to "platform.h".

4) A minor change to the Node structure :

#if SUPPORT_ACCESSIBILITY_CHECKS
	uint line; /* current line of document */
	uint column; /* current column of document */
#endif

Minor changes to "lexer.c" and "html.h".

5) A minor change to the NewNode() function :

#if SUPPORT_ACCESSIBILITY_CHECKS
Node *NewNode(Lexer *lexer);
#else
Node *NewNode(void);
#endif

Minor changes to "lexer.c" and "html.h".

6) The bulk of the changes are calling NewNode() with the additional
parameter :

#if SUPPORT_ACCESSIBILITY_CHECKS
    node = NewNode(lexer);
#else
    node = NewNode();
#endif

Minor changes to "clean.c", "istack.c", "lexer.c", "parser.c"

7) Minor changes to "localize.c" :

Currently only a help msg for the "-access" command line option. Additional
work for summary recommendations for accessibility repair to be done (see
below). Possibly move all msgs from "AccessibilityChecks.c" to "localize.c".

Currently the accessibility checking code provides appropriate error msgs,
but little in the way of more verbose text that explains how to fix any
accessibility problems. I have asked Mike and Chris to provide me with
documentation (similar to the "Overview.html" document that comes with
Tidy), and sample test cases with more verbose recommendation text. If all
works out, I plan to integrate the verbose recommendation text into
"localize.c" similar to what Tidy does now in its summary. A future change
might move the error msgs from "AccessibilityChecks.c" to "localize.c" (for
the purposes of localization).

Now that I have explained all that, how do others feel about the direction
the integration of the accessibility changes into Tidy proper should take?

I can provide command line binaries of the current code for Mac OS and
Windows if people want to experiment (I can't build for other platforms
until SourceForge fixes my access to the compile farm).

The work on the accessibility code for Tidy was based on earlier work done
at the Adaptive Technology Resource Centre at the University of Toronto - a
program called A-Prompt. Check out <http://www.aprompt.ca> and
<http://www.utoronto.ca/atrc> for more details.

Mike/Chris also suggest that Tidy itself outputs HTML that violates the W3C
accessibility guidelines - I have asked them to write up appropriate bug
reports.

Please copy Mike and Chris directly on any EMail you send to the list(s).

Below is output from Tidy using "-access 3 --show-errors 1000 Overview.html".

Regards, Terry


HTML Tidy for Mac OS (vers 1st September 2001; built on Sep 29 2001, at
14:03:00)
Parsing console input (stdin)

Accessibility Checks: Version 0.1

line 3 column 1 - Error: Language not identified.
line 4 column 1 - Error: document missing title.
line 5 column 1 - Error: <meta> lacks 'http-equiv' attribute.
line 5 column 1 - Error: <meta> lacks 'content' attribute.
line 6 column 8 - Warning: language changes must be indicated.
line 7 column 1 - Error: <meta> lacks 'http-equiv' attribute.
line 7 column 1 - Error: <meta> lacks 'content' attribute.
line 9 column 1 - Error: <meta> lacks 'http-equiv' attribute.
line 9 column 1 - Error: <meta> lacks 'content' attribute.
line 10 column 1 - Warning: stylesheets require testing. (for layout control).
line 10 column 1 - Warning: stylesheets require testing. (for layout control).
line 45 column 2 - Warning: stylesheets require testing. (for layout control).
line 56 column 2 - Warning: stylesheets require testing. (for layout control).
line 62 column 1 - Warning: headers not properly nested.
line 62 column 16 - Warning: flicker should be avoided.
line 62 column 16 - Warning: information with color is available without color.
line 62 column 16 - Error: <img> lacks 'alt' attribute.
line 63 column 26 - Warning: <img> missing descriptive text (longdesc/dlink).
line 65 column 2 - Warning: headers may require markup.
line 66 column 2 - Warning: headers may require markup.
line 66 column 51 - Warning: 'href' may reference to sound file.
line 67 column 41 - Error: suspicious 'href': has invalid file extension.
line 67 column 41 - Error: missing link description for sound/text file.
line 69 column 35 - Warning: 'href' may reference to sound file.
line 69 column 35 - Error: missing link description for sound/text file.
line 73 column 1 - Warning: headers may require markup.
line 73 column 15 - Warning: 'href' may reference to sound file.
line 73 column 15 - Error: missing link description for sound/text file.
line 73 column 54 - Warning: 'href' may reference to sound file.
line 73 column 54 - Error: missing link description for sound/text file.
line 74 column 42 - Error: missing link description for sound/text file.
line 76 column 3 - Warning: 'href' may reference to sound file.
line 76 column 3 - Error: missing link description for sound/text file.
line 76 column 59 - Warning: 'href' may reference to sound file.
line 76 column 59 - Error: missing link description for sound/text file.
line 80 column 27 - Warning: 'href' may reference to sound file.
line 80 column 27 - Error: missing link description for sound/text file.
line 86 column 17 - Error: <input> lacks 'id' attribute.
line 89 column 57 - Error: suspicious 'href': has invalid file extension.
line 89 column 57 - Error: missing link description for sound/text file.
line 93 column 32 - Warning: 'href' may reference to sound file.
line 93 column 32 - Error: missing link description for sound/text file.
line 96 column 49 - Error: missing link description for sound/text file.
line 103 column 15 - Warning: 'href' may reference to sound file.
line 103 column 15 - Error: missing link description for sound/text file.
line 107 column 43 - Warning: 'href' may reference to sound file.
line 107 column 43 - Error: missing link description for sound/text file.
line 115 column 49 - Warning: 'href' may reference to sound file.
line 115 column 49 - Error: missing link description for sound/text file.
line 135 column 2 - Warning: headers may require markup.
line 135 column 36 - Error: missing link description for sound/text file.
line 147 column 3 - Warning: <pre> missing description (ascii art).
line 147 column 3 - Error: 'ascii art' missing skipover link.
line 151 column 2 - Warning: headers may require markup.
line 152 column 2 - Warning: <pre> missing description (ascii art).
line 152 column 2 - Error: 'ascii art' missing skipover link.
line 158 column 3 - Warning: <pre> missing description (ascii art).
line 158 column 3 - Error: 'ascii art' missing skipover link.
line 161 column 2 - Warning: headers may require markup.
line 162 column 2 - Warning: <pre> missing description (ascii art).
line 162 column 2 - Error: 'ascii art' missing skipover link.
line 167 column 3 - Warning: <pre> missing description (ascii art).
line 167 column 3 - Error: 'ascii art' missing skipover link.
line 174 column 2 - Warning: headers may require markup.
line 175 column 2 - Warning: <pre> missing description (ascii art).
line 175 column 2 - Error: 'ascii art' missing skipover link.
line 181 column 3 - Warning: <pre> missing description (ascii art).
line 181 column 3 - Error: 'ascii art' missing skipover link.
line 186 column 2 - Warning: headers may require markup.
line 187 column 2 - Warning: <pre> missing description (ascii art).
line 187 column 2 - Error: 'ascii art' missing skipover link.
line 194 column 3 - Warning: <pre> missing description (ascii art).
line 194 column 3 - Error: 'ascii art' missing skipover link.
line 198 column 2 - Warning: headers may require markup.
line 199 column 2 - Warning: <pre> missing description (ascii art).
line 199 column 2 - Error: 'ascii art' missing skipover link.
line 208 column 3 - Warning: <pre> missing description (ascii art).
line 208 column 3 - Error: 'ascii art' missing skipover link.
line 211 column 2 - Warning: headers may require markup.
line 212 column 2 - Warning: <pre> missing description (ascii art).
line 212 column 2 - Error: 'ascii art' missing skipover link.
line 217 column 3 - Warning: <pre> missing description (ascii art).
line 217 column 3 - Error: 'ascii art' missing skipover link.
line 222 column 2 - Warning: headers may require markup.
line 223 column 2 - Warning: <pre> missing description (ascii art).
line 223 column 2 - Error: 'ascii art' missing skipover link.
line 269 column 2 - Warning: <pre> missing description (ascii art).
line 269 column 2 - Error: 'ascii art' missing skipover link.
line 281 column 2 - Warning: <pre> missing description (ascii art).
line 281 column 2 - Error: 'ascii art' missing skipover link.
line 285 column 2 - Warning: headers may require markup.
line 286 column 2 - Warning: <pre> missing description (ascii art).
line 286 column 2 - Error: 'ascii art' missing skipover link.
line 326 column 2 - Warning: <pre> missing description (ascii art).
line 326 column 2 - Error: 'ascii art' missing skipover link.
line 344 column 38 - Warning: 'href' may reference to sound file.
line 344 column 38 - Error: missing link description for sound/text file.
line 359 column 2 - Error: 'ascii art' missing skipover link.
line 374 column 2 - Warning: <pre> missing description (ascii art).
line 374 column 2 - Error: 'ascii art' missing skipover link.
line 386 column 2 - Warning: <pre> missing description (ascii art).
line 386 column 2 - Error: 'ascii art' missing skipover link.
line 392 column 2 - Warning: headers may require markup.
line 394 column 2 - Error: 'ascii art' missing skipover link.
line 414 column 2 - Warning: headers may require markup.
line 431 column 2 - Error: 'ascii art' missing skipover link.
line 455 column 2 - Error: 'ascii art' missing skipover link.
line 481 column 6 - Error: <a> lacks 'href' attribute.
line 481 column 6 - Error: missing link description for sound/text file.
line 482 column 2 - Warning: <pre> missing description (ascii art).
line 482 column 2 - Error: 'ascii art' missing skipover link.
line 497 column 2 - Warning: headers may require markup.
line 498 column 2 - Warning: <pre> missing description (ascii art).
line 498 column 2 - Error: 'ascii art' missing skipover link.
line 513 column 2 - Warning: <pre> missing description (ascii art).
line 513 column 2 - Error: 'ascii art' missing skipover link.
line 517 column 2 - Warning: headers may require markup.
line 518 column 2 - Warning: <pre> missing description (ascii art).
line 518 column 2 - Error: 'ascii art' missing skipover link.
line 523 column 2 - Warning: <pre> missing description (ascii art).
line 523 column 2 - Error: 'ascii art' missing skipover link.
line 529 column 2 - Warning: headers may require markup.
line 529 column 21 - Error: suspicious 'href': has invalid file extension.
line 529 column 21 - Error: missing link description for sound/text file.
line 531 column 4 - Error: suspicious 'href': has invalid file extension.
line 531 column 4 - Error: missing link description for sound/text file.
line 533 column 19 - Warning: 'href' may reference to sound file.
line 533 column 19 - Error: missing link description for sound/text file.
line 535 column 6 - Error: <a> lacks 'href' attribute.
line 535 column 6 - Error: missing link description for sound/text file.
line 542 column 2 - Warning: <pre> missing description (ascii art).
line 542 column 2 - Error: 'ascii art' missing skipover link.
line 554 column 2 - Warning: <pre> missing description (ascii art).
line 554 column 2 - Error: 'ascii art' missing skipover link.
line 557 column 2 - Warning: headers may require markup.
line 585 column 3 - Warning: <pre> missing description (ascii art).
line 585 column 3 - Error: 'ascii art' missing skipover link.
line 668 column 1 - Warning: <pre> missing description (ascii art).
line 668 column 1 - Error: 'ascii art' missing skipover link.
line 726 column 6 - Error: <a> lacks 'href' attribute.
line 726 column 6 - Error: missing link description for sound/text file.
line 736 column 23 - Error: missing link description for sound/text file.
line 822 column 2 - Warning: 'href' may reference to sound file.
line 822 column 2 - Error: missing link description for sound/text file.
line 844 column 34 - Error: missing link description for sound/text file.
line 855 column 2 - Warning: headers may require markup.
line 856 column 2 - Error: 'ascii art' missing skipover link.
line 880 column 6 - Error: <a> lacks 'href' attribute.
line 880 column 6 - Error: missing link description for sound/text file.
line 887 column 2 - Error: 'ascii art' missing skipover link.
line 901 column 6 - Error: <a> lacks 'href' attribute.
line 901 column 6 - Error: missing link description for sound/text file.
line 909 column 2 - Warning: headers may require markup.
line 909 column 8 - Error: suspicious 'href': has invalid file extension.
line 909 column 8 - Error: missing link description for sound/text file.
line 915 column 2 - Warning: headers may require markup.
line 915 column 8 - Warning: 'href' may reference to sound file.
line 915 column 8 - Error: missing link description for sound/text file.
line 919 column 2 - Warning: headers may require markup.
line 919 column 8 - Warning: 'href' may reference to sound file.
line 919 column 8 - Error: missing link description for sound/text file.
line 922 column 43 - Warning: 'href' may reference to sound file.
line 922 column 43 - Error: missing link description for sound/text file.
line 926 column 2 - Warning: headers may require markup.
line 926 column 8 - Warning: 'href' may reference to sound file.
line 926 column 8 - Error: missing link description for sound/text file.
line 931 column 2 - Warning: headers may require markup.
line 931 column 8 - Warning: 'href' may reference to sound file.
line 931 column 8 - Error: missing link description for sound/text file.
line 936 column 23 - Error: missing link description for sound/text file.
line 940 column 49 - Error: suspicious 'href': has invalid file extension.
line 940 column 49 - Error: missing link description for sound/text file.
line 942 column 32 - Error: suspicious 'href': has invalid file extension.
line 942 column 32 - Error: missing link description for sound/text file.
line 948 column 2 - Warning: headers may require markup.
line 948 column 38 - Error: suspicious 'href': has invalid file extension.
line 948 column 38 - Error: missing link description for sound/text file.
line 951 column 2 - Warning: headers may require markup.
line 951 column 49 - Error: missing link description for sound/text file.
line 955 column 2 - Warning: headers may require markup.
line 955 column 36 - Error: missing link description for sound/text file.
line 960 column 2 - Warning: headers may require markup.
line 960 column 34 - Warning: 'href' may reference to sound file.
line 960 column 34 - Error: missing link description for sound/text file.
line 965 column 2 - Warning: headers may require markup.
line 965 column 39 - Warning: 'href' may reference to sound file.
line 965 column 39 - Error: missing link description for sound/text file.
line 968 column 33 - Warning: 'href' may reference to sound file.
line 968 column 33 - Error: missing link description for sound/text file.
line 982 column 2 - Warning: headers may require markup.
line 982 column 24 - Error: suspicious 'href': has invalid file extension.
line 982 column 24 - Error: missing link description for sound/text file.
line 984 column 4 - Warning: 'href' may reference to sound file.
line 984 column 4 - Error: missing link description for sound/text file.
line 987 column 62 - Error: missing link description for sound/text file.
line 989 column 26 - Error: missing link description for sound/text file.
line 993 column 2 - Warning: headers may require markup.
line 993 column 24 - Warning: 'href' may reference to sound file.
line 993 column 24 - Error: missing link description for sound/text file.
line 998 column 2 - Warning: headers may require markup.
line 998 column 41 - Warning: 'href' may reference to sound file.
line 998 column 41 - Error: missing link description for sound/text file.
line 1002 column 2 - Warning: headers may require markup.
line 1002 column 20 - Error: suspicious 'href': has invalid file extension.
line 1002 column 20 - Error: missing link description for sound/text file.
line 1004 column 5 - Error: missing link description for sound/text file.
line 1008 column 2 - Warning: headers may require markup.
line 1008 column 29 - Error: missing link description for sound/text file.
line 1012 column 2 - Warning: headers may require markup.
line 1012 column 5 - Error: suspicious 'href': has invalid file extension.
line 1012 column 5 - Error: missing link description for sound/text file.
line 1013 column 24 - Error: <a> lacks 'href' attribute.
line 1013 column 24 - Error: missing link description for sound/text file.
line 1017 column 2 - Warning: headers may require markup.
line 1017 column 5 - Error: suspicious 'href': has invalid file extension.
line 1017 column 5 - Error: missing link description for sound/text file.
line 1018 column 14 - Error: missing link description for sound/text file.
line 1026 column 6 - Error: <a> lacks 'href' attribute.
line 1026 column 6 - Error: missing link description for sound/text file.
line 1041 column 35 - Error: suspicious 'href': has invalid file extension.
line 1041 column 35 - Error: missing link description for sound/text file.
line 1044 column 2 - Warning: headers may require markup.
line 1044 column 32 - Error: missing link description for sound/text file.
line 1051 column 6 - Error: <a> lacks 'href' attribute.
line 1051 column 6 - Error: missing link description for sound/text file.
line 1052 column 2 - Warning: headers may require markup.
line 1052 column 21 - Error: suspicious 'href': has invalid file extension.
line 1052 column 21 - Error: missing link description for sound/text file.
line 1056 column 50 - Warning: 'href' may reference to sound file.
line 1056 column 50 - Error: missing link description for sound/text file.
line 1059 column 6 - Error: <a> lacks 'href' attribute.
line 1059 column 6 - Error: missing link description for sound/text file.
line 1069 column 2 - Warning: headers may require markup.
line 1069 column 40 - Error: suspicious 'href': has invalid file extension.
line 1069 column 40 - Error: missing link description for sound/text file.
line 1072 column 5 - Error: suspicious 'href': has invalid file extension.
line 1072 column 5 - Error: missing link description for sound/text file.
line 1074 column 6 - Error: suspicious 'href': has invalid file extension.
line 1074 column 6 - Error: missing link description for sound/text file.
line 1076 column 6 - Error: suspicious 'href': has invalid file extension.
line 1076 column 6 - Error: missing link description for sound/text file.
line 1076 column 44 - Error: suspicious 'href': has invalid file extension.
line 1076 column 44 - Error: missing link description for sound/text file.
line 1079 column 6 - Error: suspicious 'href': has invalid file extension.
line 1079 column 6 - Error: missing link description for sound/text file.
line 1081 column 6 - Error: suspicious 'href': has invalid file extension.
line 1081 column 6 - Error: missing link description for sound/text file.
line 1083 column 6 - Error: suspicious 'href': has invalid file extension.
line 1083 column 6 - Error: missing link description for sound/text file.
line 1085 column 6 - Error: suspicious 'href': has invalid file extension.
line 1085 column 6 - Error: missing link description for sound/text file.
line 1087 column 6 - Error: suspicious 'href': has invalid file extension.
line 1087 column 6 - Error: missing link description for sound/text file.
line 1089 column 6 - Error: suspicious 'href': has invalid file extension.
line 1089 column 6 - Error: missing link description for sound/text file.
line 1091 column 6 - Error: suspicious 'href': has invalid file extension.
line 1091 column 6 - Error: missing link description for sound/text file.
line 1093 column 6 - Error: suspicious 'href': has invalid file extension.
line 1093 column 6 - Error: missing link description for sound/text file.
line 1095 column 6 - Error: suspicious 'href': has invalid file extension.
line 1095 column 6 - Error: missing link description for sound/text file.
line 1097 column 6 - Error: suspicious 'href': has invalid file extension.
line 1097 column 6 - Error: missing link description for sound/text file.
line 1099 column 6 - Error: suspicious 'href': has invalid file extension.
line 1099 column 6 - Error: missing link description for sound/text file.
line 1101 column 6 - Warning: 'href' may reference to sound file.
line 1101 column 6 - Error: missing link description for sound/text file.
line 1103 column 6 - Error: suspicious 'href': has invalid file extension.
line 1103 column 6 - Error: missing link description for sound/text file.
line 1111 column 2 - Warning: <pre> missing description (ascii art).
line 1111 column 2 - Error: 'ascii art' missing skipover link.
line 1119 column 2 - Error: 'ascii art' missing skipover link.
line 1141 column 2 - Warning: headers may require markup.
line 1144 column 6 - Error: <a> lacks 'href' attribute.
line 1144 column 6 - Error: missing link description for sound/text file.
line 1197 column 6 - Error: <a> lacks 'href' attribute.
line 1197 column 6 - Error: missing link description for sound/text file.
line 1198 column 2 - Warning: <pre> missing description (ascii art).
line 1198 column 2 - Error: 'ascii art' missing skipover link.
line 1205 column 2 - Warning: headers may require markup.
line 1205 column 12 - Warning: 'href' may reference to sound file.
line 1205 column 12 - Error: missing link description for sound/text file.
line 1206 column 18 - Error: suspicious 'href': has invalid file extension.
line 1206 column 18 - Error: missing link description for sound/text file.
line 1207 column 19 - Warning: 'href' may reference to sound file.
line 1207 column 19 - Error: missing link description for sound/text file.
line 1208 column 16 - Error: suspicious 'href': has invalid file extension.
line 1208 column 16 - Error: missing link description for sound/text file.

stdin: Doctype given is "-//W3C//DTD XHTML 1.0 Transitional//EN"
stdin: Document content looks like XHTML 1.0 Transitional
110 warnings, 178 errors were found!

This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.

HTML and CSS specifications are available from http://www.w3.org/
To learn more about HTML Tidy see http://www.w3.org/People/Raggett/tidy/
Please send bug reports to Dave Raggett care of <html-tidy@w3.org>
Lobby your company to join W3C, see http://www.w3.org/Consortium
Received on Sunday, 4 November 2001 16:36:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:46 GMT