165acc4f3e
- Consolidated all output string definitions enums into `tidyenum.h`, which is where they belong, and where they have proper visibility. - Re-arranged `messages.c/h` with several comments useful to developers. - Properly added the key lookup functions and the language localization functions into tidy.h/tidylib.c with proper name-spacing. - Previous point restored a *lot* of sanity to the #include pollution that's been introduced in light of these. - Note that opaque types have been (properly) introduced. Look at the updated headers for `language.h`. In particular only an opaque structure is passed outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName to poll these objects. - Console application updated as a result of this. - Removed dead code: - void TY_(UnknownOption)( TidyDocImpl* doc, char c ); - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); - Redundant strings were removed with the removal of this dead code. - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER depend on enum values. `TidyReportLevel` is an example of such. - Some enums were removed as a result of this. `TidyReportLevel` now has matching strings, so the redundant `TidyReportLevelStrings` was removed. - All of the PO's and language header files were regenerated as a result of the string cleanup and header cleanup. - Made the interface to the library version and release date consistent. - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to be able to remove console-only code from LibTidy (for LibTidy users). - Updated README/MESSAGES.md, which is *vastly* more simple now.
101 lines
2.9 KiB
C
101 lines
2.9 KiB
C
#ifndef __ACCESS_H__
|
|
#define __ACCESS_H__
|
|
|
|
/*********************************************************************
|
|
* carry out accessibility checks
|
|
*
|
|
* This module is an add-on to HTML Tidy and is enabled or disabled via
|
|
* the SUPPORT_ACCESSIBILITY_CHECKS macro, which is defined by default
|
|
* in `tidyplatform.h`. Search this code for this macro to determine
|
|
* other locations supporting code exists.
|
|
*
|
|
* This module carries out processes for all accessibility checks. It
|
|
* traverses through all the content within the tree and evaluates the
|
|
* tags for accessibility.
|
|
*
|
|
* To perform the following checks, 'AccessibilityChecks' must be
|
|
* called AFTER the tree structure has been formed.
|
|
*
|
|
* If, in the command prompt or configuration file, there is no
|
|
* specification of which accessibility priorities to check, then no
|
|
* accessibility checks will be performed.
|
|
*
|
|
* The accessibility checks to perform depending on user's desire:
|
|
* 1. priority 1
|
|
* 2. priority 1 & 2
|
|
* 3. priority 1, 2, & 3
|
|
*
|
|
* Reference document: http://www.w3.org/TR/WAI-WEBCONTENT/
|
|
*
|
|
* Copyright University of Toronto
|
|
* Portions (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
|
|
* See `tidy.h` for the copyright notice.
|
|
* Programmed by: Mike Lam and Chris Ridpath
|
|
* Modifications by: Terry Teague (TRT)
|
|
* Further modifications: consult git log.
|
|
*********************************************************************/
|
|
|
|
#include "forward.h"
|
|
|
|
#if SUPPORT_ACCESSIBILITY_CHECKS
|
|
|
|
|
|
enum {
|
|
TEXTBUF_SIZE=128u
|
|
};
|
|
|
|
struct _TidyAccessImpl;
|
|
typedef struct _TidyAccessImpl TidyAccessImpl;
|
|
|
|
struct _TidyAccessImpl
|
|
{
|
|
/* gets set from Tidy variable AccessibilityCheckLevel */
|
|
int PRIORITYCHK; /**< */
|
|
|
|
/* Number of characters that are found within the concatenated text */
|
|
int counter;
|
|
|
|
/* list of characters in the text nodes found within a container element */
|
|
tmbchar textNode[ TEXTBUF_SIZE ];
|
|
|
|
/* The list of characters found within one text node */
|
|
tmbchar text[ TEXTBUF_SIZE ];
|
|
|
|
/* Number of frame elements found within a frameset */
|
|
int numFrames;
|
|
|
|
/* Number of 'longdesc' attributes found within a frameset */
|
|
int HasCheckedLongDesc;
|
|
|
|
int CheckedHeaders;
|
|
int ListElements;
|
|
int OtherListElements;
|
|
|
|
/* For 'USEMAP' identifier */
|
|
Bool HasUseMap;
|
|
Bool HasName;
|
|
Bool HasMap;
|
|
|
|
/* For tracking nodes that are deleted from the original parse tree - TRT */
|
|
/* Node *access_tree; */
|
|
|
|
Bool HasTH;
|
|
Bool HasValidFor;
|
|
Bool HasValidId;
|
|
Bool HasValidRowHeaders;
|
|
Bool HasValidColumnHeaders;
|
|
Bool HasInvalidRowHeader;
|
|
Bool HasInvalidColumnHeader;
|
|
int ForID;
|
|
|
|
};
|
|
|
|
|
|
void TY_(AccessibilityHelloMessage)( TidyDocImpl* doc ); /* impl. message.c */
|
|
void TY_(DisplayHTMLTableAlgorithm)( TidyDocImpl* doc ); /* impl. message.c */
|
|
void TY_(AccessibilityChecks)( TidyDocImpl* doc );
|
|
|
|
|
|
#endif /* SUPPORT_ACCESSIBILITY_CHECKS */
|
|
#endif /* __ACCESS_H__ */
|