HTML Tidy  5.4.0
The HTACG Tidy HTML Project
access.h
Go to the documentation of this file.
1 #ifndef __ACCESS_H__
2 #define __ACCESS_H__
3 
4 /* access.h -- carry out accessibility checks
5 
6  Copyright University of Toronto
7  Portions (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
8  See tidy.h for the copyright notice.
9 
10 */
11 
12 /*********************************************************************
13 * AccessibilityChecks
14 *
15 * Carries out processes for all accessibility checks. Traverses
16 * through all the content within the tree and evaluates the tags for
17 * accessibility.
18 *
19 * To perform the following checks, 'AccessibilityChecks' must be
20 * called AFTER the tree structure has been formed.
21 *
22 * If, in the command prompt, there is no specification of which
23 * accessibility priorities to check, no accessibility checks will be
24 * performed. (ie. '1' for priority 1, '2' for priorities 1 and 2,
25 * and '3') for priorities 1, 2 and 3.)
26 *
27 * Copyright University of Toronto
28 * Programmed by: Mike Lam and Chris Ridpath
29 * Modifications by : Terry Teague (TRT)
30 *
31 *********************************************************************/
32 
33 
34 #include "forward.h"
35 #include "message.h"
36 
37 #if SUPPORT_ACCESSIBILITY_CHECKS
38 
39 /* The accessibility checks to perform depending on user's desire.
40 
41  1. priority 1
42  2. priority 1 & 2
43  3. priority 1, 2, & 3
44 */
45 
46 /* Determines if the client-side text link is found within the document
47 typedef struct AreaLinks
48 {
49  struct AreaLinks* next;
50  char* link;
51  Bool HasBeenFound;
52 } AreaLinks;
53 */
54 
55 enum {
57 };
58 
59 struct _TidyAccessImpl;
60 typedef struct _TidyAccessImpl TidyAccessImpl;
61 
63 {
64  /* gets set from Tidy variable AccessibilityCheckLevel */
66 
67  /* Number of characters that are found within the concatenated text */
68  int counter;
69 
70  /* list of characters in the text nodes found within a container element */
72 
73  /* The list of characters found within one text node */
75 
76  /* Number of frame elements found within a frameset */
77  int numFrames;
78 
79  /* Number of 'longdesc' attributes found within a frameset */
81 
85 
86  /* For 'USEMAP' identifier */
90 
91  /* For tracking nodes that are deleted from the original parse tree - TRT */
92  /* Node *access_tree; */
93 
101  int ForID;
102 
103  /* List containing map-links
104  AreaLinks* links;
105  AreaLinks* start;
106  AreaLinks* current;
107  */
108 
109 };
110 
111 
112 /*
113  Determines which error/warning message should be displayed,
114  depending on the error code that was called.
115 
116  Offset accessibility error codes by FIRST_ACCESS_ERR to avoid conflict with
117  other error codes defined in message.h and used in localize.c.
118 
119  These accessErrorCodes are used throughout libtidy, and also
120  have associated localized strings to describe them.
121 
122  IMPORTANT: to maintain compatability with TidyMessageFilter3, if you add
123  or remove keys from this enum, ALSO add/remove the corresponding key
124  in language.c:tidyErrorFilterKeysStruct[]!
125  */
126 typedef enum
127 {
128  FIRST_ACCESS_ERR = CODES_TIDY_ERROR_LAST + 1, /* must be first */
129 
130  /* [1.1.1.1] */ IMG_MISSING_ALT,
134  /* [1.1.1.10] */ IMG_ALT_SUSPICIOUS_TOO_LONG,
135  /* [1.1.1.11] */ IMG_MISSING_ALT_BULLET,
136  /* [1.1.1.12] */ IMG_MISSING_ALT_H_RULE,
137  /* [1.1.2.1] */ IMG_MISSING_LONGDESC_DLINK,
138  /* [1.1.2.2] */ IMG_MISSING_DLINK,
139  /* [1.1.2.3] */ IMG_MISSING_LONGDESC,
140  /* [1.1.2.5] */ LONGDESC_NOT_REQUIRED,
141  /* [1.1.3.1] */ IMG_BUTTON_MISSING_ALT,
142  /* [1.1.4.1] */ APPLET_MISSING_ALT,
143  /* [1.1.5.1] */ OBJECT_MISSING_ALT,
144  /* [1.1.6.1] */ AUDIO_MISSING_TEXT_WAV,
145  /* [1.1.6.2] */ AUDIO_MISSING_TEXT_AU,
146  /* [1.1.6.3] */ AUDIO_MISSING_TEXT_AIFF,
147  /* [1.1.6.4] */ AUDIO_MISSING_TEXT_SND,
148  /* [1.1.6.5] */ AUDIO_MISSING_TEXT_RA,
149  /* [1.1.6.6] */ AUDIO_MISSING_TEXT_RM,
150  /* [1.1.8.1] */ FRAME_MISSING_LONGDESC,
151  /* [1.1.9.1] */ AREA_MISSING_ALT,
152  /* [1.1.10.1] */ SCRIPT_MISSING_NOSCRIPT,
153  /* [1.1.12.1] */ ASCII_REQUIRES_DESCRIPTION,
155  /* [1.4.1.1] */ MULTIMEDIA_REQUIRES_TEXT,
162  /* [2.2.1.1] */ COLOR_CONTRAST_TEXT,
163  /* [2.2.1.2] */ COLOR_CONTRAST_LINK,
164  /* [2.2.1.3] */ COLOR_CONTRAST_ACTIVE_LINK,
166  /* [3.2.1.1] */ DOCTYPE_MISSING,
168  /* [3.5.1.1] */ HEADERS_IMPROPERLY_NESTED,
169  /* [3.5.2.1] */ POTENTIAL_HEADER_BOLD,
170  /* [3.5.2.2] */ POTENTIAL_HEADER_ITALICS,
171  /* [3.5.2.3] */ POTENTIAL_HEADER_UNDERLINE,
172  /* [3.5.3.1] */ HEADER_USED_FORMAT_TEXT,
173  /* [3.6.1.1] */ LIST_USAGE_INVALID_UL,
174  /* [3.6.1.2] */ LIST_USAGE_INVALID_OL,
175  /* [3.6.1.4] */ LIST_USAGE_INVALID_LI,
177  /* [4.3.1.1] */ LANGUAGE_NOT_IDENTIFIED,
178  /* [4.3.1.1] */ LANGUAGE_INVALID,
179  /* [5.1.2.1] */ DATA_TABLE_MISSING_HEADERS,
186  /* [5.5.1.1] */ TABLE_MISSING_SUMMARY,
187  /* [5.5.1.2] */ TABLE_SUMMARY_INVALID_NULL,
190  /* [5.5.2.1] */ TABLE_MISSING_CAPTION,
197  /* [6.2.1.1] */ FRAME_SRC_INVALID,
205  /* [6.5.1.1] */ FRAME_MISSING_NOFRAMES,
206  /* [6.5.1.2] */ NOFRAMES_INVALID_NO_VALUE,
207  /* [6.5.1.3] */ NOFRAMES_INVALID_CONTENT,
208  /* [6.5.1.4] */ NOFRAMES_INVALID_LINK,
209  /* [7.1.1.1] */ REMOVE_FLICKER_SCRIPT,
210  /* [7.1.1.2] */ REMOVE_FLICKER_OBJECT,
211  /* [7.1.1.3] */ REMOVE_FLICKER_EMBED,
212  /* [7.1.1.4] */ REMOVE_FLICKER_APPLET,
214  /* [7.2.1.1] */ REMOVE_BLINK_MARQUEE,
215  /* [7.4.1.1] */ REMOVE_AUTO_REFRESH,
216  /* [7.5.1.1] */ REMOVE_AUTO_REDIRECT,
238  /* [11.2.1.4] */ REPLACE_DEPRECATED_HTML_DIR,
242  /* [11.2.1.8] */ REPLACE_DEPRECATED_HTML_S,
244  /* [11.2.1.10] */ REPLACE_DEPRECATED_HTML_U,
245  /* [12.1.1.1] */ FRAME_MISSING_TITLE,
246  /* [12.1.1.2] */ FRAME_TITLE_INVALID_NULL,
247  /* [12.1.1.3] */ FRAME_TITLE_INVALID_SPACES,
248  /* [12.4.1.1] */ ASSOCIATE_LABELS_EXPLICITLY,
251  /* [13.1.1.1] */ LINK_TEXT_NOT_MEANINGFUL,
252  /* [13.1.1.2] */ LINK_TEXT_MISSING,
253  /* [13.1.1.3] */ LINK_TEXT_TOO_LONG,
257  /* [13.2.1.1] */ METADATA_MISSING,
258  /* [13.2.1.2] */ METADATA_MISSING_LINK,
260  /* [13.10.1.1] */ SKIPOVER_ASCII_ART,
261 
262  LAST_ACCESS_ERR /* must be last */
264 
265 
266 void TY_(AccessibilityHelloMessage)( TidyDocImpl* doc );
267 void TY_(DisplayHTMLTableAlgorithm)( TidyDocImpl* doc );
268 
269 /************************************************************
270 * AccessibilityChecks
271 *
272 * Traverses through the individual nodes of the tree
273 * and checks attributes and elements for accessibility.
274 * after the tree structure has been formed.
275 ************************************************************/
276 
277 void TY_(AccessibilityChecks)( TidyDocImpl* doc );
278 
279 
280 #endif /* SUPPORT_ACCESSIBILITY_CHECKS */
281 #endif /* __ACCESS_H__ */
Definition: access.h:161
Definition: access.h:258
Definition: access.h:216
Definition: access.h:131
Definition: message.h:195
tmbchar text[TEXTBUF_SIZE]
Definition: access.h:74
Definition: access.h:228
Definition: access.h:251
int numFrames
Definition: access.h:77
Definition: access.h:156
Definition: access.h:241
Definition: access.h:132
Bool HasValidRowHeaders
Definition: access.h:97
Definition: access.h:140
Bool HasInvalidRowHeader
Definition: access.h:99
Definition: access.h:255
Definition: access.h:170
Definition: access.h:240
Bool HasValidColumnHeaders
Definition: access.h:98
Definition: access.h:179
Definition: access.h:162
Definition: access.h:178
Definition: access.h:236
Definition: access.h:245
Definition: access.h:128
Definition: access.h:235
Definition: access.h:244
Definition: access.h:193
Definition: access.h:248
Definition: access.h:151
Definition: access.h:238
tmbchar textNode[TEXTBUF_SIZE]
Definition: access.h:71
Definition: access.h:181
Definition: access.h:253
Definition: access.h:142
Definition: access.h:172
int ForID
Definition: access.h:101
Definition: access.h:211
Definition: access.h:130
Definition: access.h:246
Definition: access.h:149
Definition: access.h:232
Definition: access.h:137
Definition: access.h:164
Definition: access.h:135
Definition: access.h:155
Definition: access.h:262
Definition: access.h:141
Definition: access.h:160
int counter
Definition: access.h:68
Definition: access.h:239
Definition: access.h:209
Definition: access.h:185
Definition: access.h:229
Definition: access.h:174
Definition: access.h:173
Definition: access.h:210
Definition: access.h:192
Definition: access.h:139
Definition: access.h:159
Bool
Definition: tidyplatform.h:593
Definition: access.h:237
Bool HasTH
Definition: access.h:94
Definition: access.h:205
Definition: access.h:163
Definition: access.h:188
Definition: access.h:144
Definition: access.h:168
Definition: access.h:145
int OtherListElements
Definition: access.h:84
Definition: access.h:206
Definition: access.h:243
Definition: access.h:134
Definition: access.h:208
Definition: access.h:176
Definition: access.h:169
Definition: access.h:165
Definition: access.h:167
Definition: access.h:207
Definition: access.h:133
Definition: access.h:252
Bool HasName
Definition: access.h:88
Definition: access.h:186
Definition: access.h:214
Definition: access.h:138
Bool HasValidFor
Definition: access.h:95
Definition: access.h:184
Bool HasValidId
Definition: access.h:96
Definition: access.h:143
Definition: access.h:257
Bool HasUseMap
Definition: access.h:87
Definition: access.h:150
Definition: access.h:175
Bool HasMap
Definition: access.h:89
Definition: access.h:212
Definition: access.h:254
Definition: access.h:194
Definition: access.h:187
int ListElements
Definition: access.h:83
int CheckedHeaders
Definition: access.h:82
Definition: access.h:177
Definition: access.h:180
accessErrorCodes
Definition: access.h:126
char tmbchar
Definition: tidyplatform.h:553
Definition: access.h:146
Definition: access.h:247
Definition: access.h:242
Definition: access.h:171
Definition: access.h:157
Definition: access.h:189
Definition: access.h:166
Definition: access.h:158
Definition: access.h:62
Definition: access.h:250
Definition: access.h:215
Definition: access.h:152
Definition: access.h:148
Definition: access.h:136
Bool HasInvalidColumnHeader
Definition: access.h:100
Definition: access.h:213
#define TY_(str)
Definition: forward.h:23
Definition: access.h:191
int PRIORITYCHK
Definition: access.h:65
Definition: access.h:56
Definition: access.h:190
Definition: access.h:197
Definition: access.h:256
int HasCheckedLongDesc
Definition: access.h:80
Definition: access.h:147
Definition: access.h:260
Definition: access.h:154
Definition: access.h:153
Definition: access.h:249