From a1e4dcc066a3bf87eb2a459d370e55df72c568d8 Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Tue, 3 Oct 2017 12:45:34 -0400 Subject: [PATCH] Removed option for SUPPORT_ACCESSIBILITY_CHECKS, regen'd strings. --- CMakeLists.txt | 1 - console/tidy.c | 5 ----- include/tidyenum.h | 4 ---- include/tidyplatform.h | 5 ----- localize/translations/language_en_gb.po | 2 +- localize/translations/language_es.po | 2 +- localize/translations/language_es_mx.po | 2 +- localize/translations/language_fr.po | 2 +- localize/translations/language_pt_br.po | 2 +- localize/translations/language_zh_cn.po | 2 +- localize/translations/tidy.pot | 2 +- src/access.c | 13 ------------- src/access.h | 8 -------- src/config.c | 9 +-------- src/language_en.h | 4 +--- src/language_en_gb.h | 6 +----- src/language_es.h | 2 +- src/language_es_mx.h | 2 +- src/language_fr.h | 6 +----- src/language_pt_br.h | 6 +----- src/language_zh_cn.h | 2 +- src/message.c | 5 ----- src/message.h | 3 --- src/parser.c | 4 ---- src/tidy-int.h | 4 ---- 25 files changed, 15 insertions(+), 88 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7fda78..cbda3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,6 @@ endif () # Macro Values # These additional macros are set in Tidy's source code. #------------------------------------------------------------------------ -add_definitions ( -DSUPPORT_ACCESSIBILITY_CHECKS=1 ) add_definitions ( -DLIBTIDY_VERSION="${LIBTIDY_VERSION}" ) add_definitions ( -DRELEASE_DATE="${tidy_YEAR}/${tidy_MONTH}/${tidy_DAY}" ) diff --git a/console/tidy.c b/console/tidy.c index aeccf4e..665d112 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -362,9 +362,7 @@ static const CmdOptDesc cmdopt_defs[] = { { CmdOptProcDir, "-xml", TC_OPT_XML, 0, "input-xml: yes" }, { CmdOptProcDir, "-asxml", TC_OPT_ASXML, 0, "output-xhtml: yes", "-asxhtml" }, { CmdOptProcDir, "-ashtml", TC_OPT_ASHTML, 0, "output-html: yes" }, -#if SUPPORT_ACCESSIBILITY_CHECKS { CmdOptProcDir, "-access <%s>", TC_OPT_ACCESS, TC_LABEL_LEVL, "accessibility-check: <%s>" }, -#endif { CmdOptCharEnc, "-raw", TC_OPT_RAW, 0, NULL }, { CmdOptCharEnc, "-ascii", TC_OPT_ASCII, 0, NULL }, { CmdOptCharEnc, "-latin0", TC_OPT_LATIN0, 0, NULL }, @@ -2357,8 +2355,6 @@ int main( int argc, char** argv ) --argc; } } - -#if SUPPORT_ACCESSIBILITY_CHECKS else if ( strcasecmp(arg, "access") == 0 ) { if ( argc >= 3 ) @@ -2373,7 +2369,6 @@ int main( int argc, char** argv ) } } } -#endif else { diff --git a/include/tidyenum.h b/include/tidyenum.h index 8d41dcd..4ddace1 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -1406,11 +1406,7 @@ typedef enum FOREACH_FOOTNOTE_MSG(MAKE_ENUM) FOREACH_DIALOG_MSG(MAKE_ENUM) FOREACH_REPORT_MSG(MAKE_ENUM) - -#if SUPPORT_ACCESSIBILITY_CHECKS - /* Defined in `access.h` */ FOREACH_ACCESS_MSG(MAKE_ENUM) -#endif #if SUPPORT_CONSOLE_APP FOREACH_MSG_CONSOLE(MAKE_ENUM) diff --git a/include/tidyplatform.h b/include/tidyplatform.h index 707cb6e..19c055c 100644 --- a/include/tidyplatform.h +++ b/include/tidyplatform.h @@ -77,11 +77,6 @@ extern "C" { * Optional Tidy features support *===========================================================================*/ -/* Enable/disable support for additional accessibility checks */ -#ifndef SUPPORT_ACCESSIBILITY_CHECKS -# define SUPPORT_ACCESSIBILITY_CHECKS 1 -#endif - /* Enable/disable support for additional languages */ #ifndef SUPPORT_LOCALIZATIONS # define SUPPORT_LOCALIZATIONS 1 diff --git a/localize/translations/language_en_gb.po b/localize/translations/language_en_gb.po index 1a09f12..196d86b 100644 --- a/localize/translations/language_en_gb.po +++ b/localize/translations/language_en_gb.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/language_es.po b/localize/translations/language_es.po index b152ea4..444d0e7 100644 --- a/localize/translations/language_es.po +++ b/localize/translations/language_es.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/language_es_mx.po b/localize/translations/language_es_mx.po index 1dce7ce..d1c4bdf 100644 --- a/localize/translations/language_es_mx.po +++ b/localize/translations/language_es_mx.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/language_fr.po b/localize/translations/language_fr.po index f061857..d35f7dc 100644 --- a/localize/translations/language_fr.po +++ b/localize/translations/language_fr.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/language_pt_br.po b/localize/translations/language_pt_br.po index 2cc3a89..49a9080 100644 --- a/localize/translations/language_pt_br.po +++ b/localize/translations/language_pt_br.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/language_zh_cn.po b/localize/translations/language_zh_cn.po index 47fc76a..40a1d7b 100644 --- a/localize/translations/language_zh_cn.po +++ b/localize/translations/language_zh_cn.po @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"PO-Revision-Date: 2017-10-03 12:37:01\n" +"PO-Revision-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/localize/translations/tidy.pot b/localize/translations/tidy.pot index 130a797..2428107 100644 --- a/localize/translations/tidy.pot +++ b/localize/translations/tidy.pot @@ -5,7 +5,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: HTML Tidy poconvert.rb\n" "Project-Id-Version: \n" -"POT-Creation-Date: 2017-10-03 12:37:01\n" +"POT-Creation-Date: 2017-10-03 12:44:37\n" "Last-Translator: jderry\n" "Language-Team: \n" diff --git a/src/access.c b/src/access.c index f519481..5f5beba 100644 --- a/src/access.c +++ b/src/access.c @@ -8,9 +8,6 @@ #include "tidy-int.h" - -#if SUPPORT_ACCESSIBILITY_CHECKS - #include "access.h" #include "message.h" #include "tags.h" @@ -3321,13 +3318,3 @@ void TY_(AccessibilityChecks)( TidyDocImpl* doc ) FreeAccessibilityChecks( doc ); } -#endif - -/* - * local variables: - * mode: c - * indent-tabs-mode: nil - * c-basic-offset: 4 - * eval: (c-set-offset 'substatement-open 0) - * end: - */ diff --git a/src/access.h b/src/access.h index 04f003b..cbb6257 100644 --- a/src/access.h +++ b/src/access.h @@ -4,11 +4,6 @@ /********************************************************************* * 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. @@ -37,8 +32,6 @@ #include "forward.h" -#if SUPPORT_ACCESSIBILITY_CHECKS - enum { TEXTBUF_SIZE=128u @@ -94,5 +87,4 @@ struct _TidyAccessImpl void TY_(AccessibilityChecks)( TidyDocImpl* doc ); -#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ #endif /* __ACCESS_H__ */ diff --git a/src/config.c b/src/config.c index 804d64e..0667f3c 100644 --- a/src/config.c +++ b/src/config.c @@ -156,13 +156,6 @@ static PickListItems attributeCasePicks = { #define DLF DEFAULT_NL_CONFIG -/* If Accessibility checks not supported, make config setting read-only */ -#if SUPPORT_ACCESSIBILITY_CHECKS -#define ParseAcc ParsePickList -#else -#define ParseAcc NULL -#endif - static void AdjustConfig( TidyDocImpl* doc ); /* parser for integer values */ @@ -203,7 +196,7 @@ static ParseProperty ParsePickList; static const TidyOptionImpl option_defs[] = { { TidyUnknownOption, MS, "unknown!", IN, 0, NULL, NULL }, - { TidyAccessibilityCheckLevel, DG, "accessibility-check", IN, 0, ParseAcc, &accessPicks }, + { TidyAccessibilityCheckLevel, DG, "accessibility-check", IN, 0, ParsePickList, &accessPicks }, { TidyAltText, MU, "alt-text", ST, 0, ParseString, NULL }, { TidyAnchorAsName, MU, "anchor-as-name", BL, yes, ParsePickList, &boolPicks }, { TidyAsciiChars, CE, "ascii-chars", BL, no, ParsePickList, &boolPicks }, diff --git a/src/language_en.h b/src/language_en.h index b3e970e..16a1913 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1953,8 +1953,7 @@ static languageDefinition language_en = { whichPluralForm_en, { { XML_DECLARATION_DETECTED, 0, "An XML declaration was detected. Did you mean to use input-xml?" }, { XML_ID_SYNTAX, 0, "%s ID \"%s\" uses XML ID syntax" }, -#if SUPPORT_ACCESSIBILITY_CHECKS - + /*************************************** ** Report Output -- Accessibility ***************************************/ @@ -2077,7 +2076,6 @@ static languageDefinition language_en = { whichPluralForm_en, { { METADATA_MISSING, 0, "[13.2.1.1]: Metadata missing." }, { METADATA_MISSING_REDIRECT_AUTOREFRESH, 0, "[13.2.1.3]: Metadata missing (redirect/auto-refresh)." }, { SKIPOVER_ASCII_ART, 0, "[13.10.1.1]: skip over ascii art." }, -#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ #if SUPPORT_CONSOLE_APP diff --git a/src/language_en_gb.h b/src/language_en_gb.h index 5c2287f..97cc696 100644 --- a/src/language_en_gb.h +++ b/src/language_en_gb.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER @@ -147,8 +147,6 @@ static languageDefinition language_en_gb = { whichPluralForm_en_gb, { }, { UNKNOWN_ELEMENT_LOOKS_CUSTOM, 0, "%s is not recognised! Did you mean to enable the custom-tags option?" }, { UNKNOWN_ELEMENT, 0, "%s is not recognised!" }, - -#if SUPPORT_ACCESSIBILITY_CHECKS { MULTIMEDIA_REQUIRES_TEXT, 0, "[1.4.1.1]: multimedia requires synchronised text equivalents." }, { INFORMATION_NOT_CONVEYED_IMAGE, 0, "[2.1.1.1]: ensure information not conveyed through colour alone (image)." }, { INFORMATION_NOT_CONVEYED_APPLET, 0, "[2.1.1.2]: ensure information not conveyed through colour alone (applet)." }, @@ -160,8 +158,6 @@ static languageDefinition language_en_gb = { whichPluralForm_en_gb, { { COLOR_CONTRAST_ACTIVE_LINK, 0, "[2.2.1.3]: poor colour contrast (active link)." }, { COLOR_CONTRAST_VISITED_LINK, 0, "[2.2.1.4]: poor colour contrast (visited link)." }, { LAYOUT_TABLES_LINEARIZE_PROPERLY, 0, "[5.3.1.1]: verify layout tables linearise properly." }, -#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ - #if SUPPORT_CONSOLE_APP { TC_TXT_HELP_LANG_2, 0, diff --git a/src/language_es.h b/src/language_es.h index 4792385..eff66e4 100644 --- a/src/language_es.h +++ b/src/language_es.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER diff --git a/src/language_es_mx.h b/src/language_es_mx.h index 40c3f96..7f061b6 100644 --- a/src/language_es_mx.h +++ b/src/language_es_mx.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER diff --git a/src/language_fr.h b/src/language_fr.h index 19e091c..4bb6c16 100644 --- a/src/language_fr.h +++ b/src/language_fr.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER @@ -864,8 +864,6 @@ static languageDefinition language_fr = { whichPluralForm_fr, { { WHITE_IN_URI, 0, "%s rejet des espaces dans la référence URI" }, { XML_DECLARATION_DETECTED, 0, "Une déclaration XML a été détectée. Voulez-vous utiliser l'option input-xml?" }, { XML_ID_SYNTAX, 0, "%s ID « %s » utilise la syntaxe XML ID" }, - -#if SUPPORT_ACCESSIBILITY_CHECKS { IMG_MISSING_ALT, 0, "[1.1.1.1]: texte manquant 'alt'." }, { IMG_ALT_SUSPICIOUS_FILENAME, 0, "[1.1.1.2]: texte 'alt' suspect (nom de fichier)." }, { IMG_ALT_SUSPICIOUS_FILE_SIZE, 0, "[1.1.1.3]: texte 'alt' suspect (taille de fichier)." }, @@ -988,8 +986,6 @@ static languageDefinition language_fr = { whichPluralForm_fr, { { METADATA_MISSING, 0, "[13.2.1.1]: Métadonnées manquantes." }, { METADATA_MISSING_REDIRECT_AUTOREFRESH, 0, "[13.2.1.3]: Métadonnées manquantes (redirect/auto-refresh)." }, { SKIPOVER_ASCII_ART, 0, "[13.10.1.1]: ignore l'ascii art." }, -#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ - #if SUPPORT_CONSOLE_APP { TC_LABEL_COL, 0, "colonne" }, diff --git a/src/language_pt_br.h b/src/language_pt_br.h index c0ce050..48bcdf0 100644 --- a/src/language_pt_br.h +++ b/src/language_pt_br.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER @@ -971,8 +971,6 @@ static languageDefinition language_pt_br = { whichPluralForm_pt_br, { { WHITE_IN_URI, 0, "%s descartando espaço em branco na referência de URI" }, { XML_DECLARATION_DETECTED, 0, "Uma declaração XML foi detectada. Você queria usar input-xml?" }, { XML_ID_SYNTAX, 0, "%s ID \"%s\" usa sintaxe de ID de XML" }, - -#if SUPPORT_ACCESSIBILITY_CHECKS { IMG_MISSING_ALT, 0, "[1.1.1.1]: carece de texto 'alt'." }, { IMG_ALT_SUSPICIOUS_FILENAME, 0, "[1.1.1.2]: texto 'alt' suspeito (nome de arquivo)." }, { IMG_ALT_SUSPICIOUS_FILE_SIZE, 0, "[1.1.1.3]: texto 'alt' suspeito (tamanho de arquivo)." }, @@ -1098,8 +1096,6 @@ static languageDefinition language_pt_br = { whichPluralForm_pt_br, { { METADATA_MISSING, 0, "[13.2.1.1]: faltando metadados." }, { METADATA_MISSING_REDIRECT_AUTOREFRESH, 0, "[13.2.1.3]: faltando metadados (redirecionamento/autorrenovação)." }, { SKIPOVER_ASCII_ART, 0, "[13.10.1.1]: pular arte em ascii." }, -#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ - #if SUPPORT_CONSOLE_APP { TC_LABEL_COL, 0, "coluna" }, diff --git a/src/language_zh_cn.h b/src/language_zh_cn.h index 28bb5ce..2321974 100644 --- a/src/language_zh_cn.h +++ b/src/language_zh_cn.h @@ -28,7 +28,7 @@ * * Orginating PO file metadata: * PO_LAST_TRANSLATOR=jderry - * PO_REVISION_DATE=2017-10-03 12:37:01 + * PO_REVISION_DATE=2017-10-03 12:44:37 */ #ifdef _MSC_VER diff --git a/src/message.c b/src/message.c index c3ec995..4fa1c9b 100644 --- a/src/message.c +++ b/src/message.c @@ -920,12 +920,10 @@ void TY_(Report)(TidyDocImpl* doc, Node *element, Node *node, uint code, ...) * rest of Tidy's code. *********************************************************************/ -#if SUPPORT_ACCESSIBILITY_CHECKS void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ) { TY_(Report)( doc, NULL, node, code ); } -#endif void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code) @@ -1316,10 +1314,7 @@ static const tidyStringsKeyItem tidyStringsKeys[] = { { "TIDYSTRINGS_FIRST", TIDYSTRINGS_FIRST }, -#if SUPPORT_ACCESSIBILITY_CHECKS FOREACH_ACCESS_MSG(MAKE_STRUCT) -#endif - #if SUPPORT_CONSOLE_APP FOREACH_MSG_CONSOLE(MAKE_STRUCT) diff --git a/src/message.h b/src/message.h index 75a0cd9..f12ee95 100644 --- a/src/message.h +++ b/src/message.h @@ -116,10 +116,7 @@ void TY_(Report)(TidyDocImpl* doc, Node *element, Node *node, uint code, ...); /** @{ */ -#if SUPPORT_ACCESSIBILITY_CHECKS void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ); -#endif - void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code); void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option ); void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c ); diff --git a/src/parser.c b/src/parser.c index 5cbf107..9e6fab6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -4404,11 +4404,9 @@ void TY_(ParseFrameSet)(TidyDocImpl* doc, Node *frameset, GetTokenMode ARG_UNUSE } /* discard unexpected tags */ -#if SUPPORT_ACCESSIBILITY_CHECKS /* WAI [6.5.1.4] link is being discarded outside of NOFRAME */ if ( nodeIsA(node) ) doc->badAccess |= BA_INVALID_LINK_NOFRAMES; -#endif TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED); TY_(FreeNode)( doc, node); @@ -4908,11 +4906,9 @@ void TY_(ParseDocument)(TidyDocImpl* doc) break; } -#if SUPPORT_ACCESSIBILITY_CHECKS /* do this before any more document fixes */ if ( cfg( doc, TidyAccessibilityCheckLevel ) > 0 ) TY_(AccessibilityChecks)( doc ); -#endif /* #if SUPPORT_ACCESSIBILITY_CHECKS */ if (!TY_(FindHTML)(doc)) { diff --git a/src/tidy-int.h b/src/tidy-int.h index 91ced4b..6edb2ec 100644 --- a/src/tidy-int.h +++ b/src/tidy-int.h @@ -43,11 +43,7 @@ struct _TidyDocImpl TidyConfigImpl config; TidyTagImpl tags; TidyAttribImpl attribs; - -#if SUPPORT_ACCESSIBILITY_CHECKS - /* Accessibility Checks state */ TidyAccessImpl access; -#endif /* The Pretty Print buffer */ TidyPrintImpl pprint;