• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/tidy-15.15/tidy/src/

Lines Matching defs:doc

873 static Bool UpdateCount( TidyDocImpl* doc, TidyReportLevel level )
876 Bool go = ( doc->errors < cfg(doc, TidyShowErrors) );
881 doc->infoMessages++;
884 doc->warnings++;
885 go = go && cfgBool( doc, TidyShowWarnings );
888 doc->optionErrors++;
891 doc->accessErrors++;
894 doc->errors++;
897 doc->docErrors++;
907 static char* ReportPosition(TidyDocImpl* doc, int line, int col, char* buf, size_t count)
912 if ( cfgBool(doc, TidyEmacs) && cfgStr(doc, TidyEmacsFile) )
914 cfgStr(doc, TidyEmacsFile), line, col);
931 static void messagePos( TidyDocImpl* doc, TidyReportLevel level,
937 static void messagePos( TidyDocImpl* doc, TidyReportLevel level,
941 Bool go = UpdateCount( doc, level );
946 if ( doc->mssgFilt )
948 TidyDoc tdoc = tidyImplToDoc( doc );
949 go = doc->mssgFilt( tdoc, level, line, col, messageBuf );
959 ReportPosition(doc, line, col, buf, sizeof(buf));
961 TY_(WriteChar)( *cp, doc->errout );
966 TY_(WriteChar)( *cp, doc->errout );
969 TY_(WriteChar)( *cp, doc->errout );
970 TY_(WriteChar)( '\n', doc->errout );
976 void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
984 void messageNode( TidyDocImpl* doc, TidyReportLevel level,
993 void messageLexer( TidyDocImpl* doc, TidyReportLevel level,
1011 void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... )
1018 void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
1022 messagePos( doc, level, 0, 0, msg, args );
1027 void messageLexer( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
1029 int line = ( doc->lexer ? doc->lexer->lines : 0 );
1030 int col = ( doc->lexer ? doc->lexer->columns : 0 );
1034 messagePos( doc, level, line, col, msg, args );
1038 void messageNode( TidyDocImpl* doc, TidyReportLevel level, Node* node,
1042 ( doc->lexer ? doc->lexer->lines : 0 ) );
1044 ( doc->lexer ? doc->lexer->columns : 0 ) );
1048 messagePos( doc, level, line, col, msg, args );
1052 void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... )
1054 if ( !cfgBool(doc, TidyQuiet) )
1065 TY_(WriteChar)( *cp, doc->errout );
1070 void ShowVersion( TidyDocImpl* doc )
1079 tidy_out( doc, "\nHTML Tidy%s%s (release date: %s; built on %s, at %s)\n"
1085 void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level )
1087 message( doc, level, "Can't open \"%s\"\n", file );
1112 void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option )
1115 message( doc, TidyConfig, "unknown option: %s", option );
1119 void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option )
1122 message( doc, TidyConfig,
1152 void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding)
1157 messageLexer(doc, TidyWarning, GetFormatFromCode(code),
1158 TY_(CharEncodingName)(doc->docIn->encoding),
1160 doc->badChars |= BC_ENCODING_MISMATCH;
1165 void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded)
1177 doc->badChars |= BC_VENDOR_SPECIFIC_CHARS;
1182 doc->badChars |= BC_INVALID_SGML_CHARS;
1187 doc->badChars |= BC_INVALID_UTF8;
1193 doc->badChars |= BC_INVALID_UTF16;
1199 doc->badChars |= BC_INVALID_NCR;
1204 messageLexer( doc, TidyWarning, fmt, action, buf );
1207 void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity,
1214 messageLexer( doc, TidyWarning, fmt, entityname );
1217 void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code)
1243 messageNode(doc, TidyWarning, node, fmt, tagdesc, name);
1249 messageNode(doc, TidyWarning, node, fmt, tagdesc, name, value);
1264 messageNode(doc, TidyWarning, node, fmt, tagdesc);
1271 messageNode(doc, TidyWarning, node, fmt, tagdesc, value);
1276 messageNode(doc, TidyWarning, node, fmt, tagdesc);
1277 doc->badAccess |= MISSING_IMAGE_MAP;
1281 messageNode(doc, TidyWarning, node, fmt, tagdesc, value, name);
1286 doc->lexer->lines = doc->docIn->curline;
1287 doc->lexer->columns = doc->docIn->curcol;
1288 messageLexer(doc, TidyWarning, fmt, tagdesc);
1293 void TY_(ReportMissingAttr)( TidyDocImpl* doc, Node* node, ctmbstr name )
1300 messageNode( doc, TidyWarning, node, fmt, tagdesc, name );
1316 void TY_(DisplayHTMLTableAlgorithm)( TidyDocImpl* doc )
1318 tidy_out(doc, " \n");
1319 tidy_out(doc, " - First, search left from the cell's position to find row header cells.\n");
1320 tidy_out(doc, " - Then search upwards to find column header cells.\n");
1321 tidy_out(doc, " - The search in a given direction stops when the edge of the table is\n");
1322 tidy_out(doc, " reached or when a data cell is found after a header cell.\n");
1323 tidy_out(doc, " - Row headers are inserted into the list in the order they appear in\n");
1324 tidy_out(doc, " the table. \n");
1325 tidy_out(doc, " - For left-to-right tables, headers are inserted from left to right.\n");
1326 tidy_out(doc, " - Column headers are inserted after row headers, in \n");
1327 tidy_out(doc, " the order they appear in the table, from top to bottom. \n");
1328 tidy_out(doc, " - If a header cell has the headers attribute set, then the headers \n");
1329 tidy_out(doc, " referenced by this attribute are inserted into the list and the \n");
1330 tidy_out(doc, " search stops for the current direction.\n");
1331 tidy_out(doc, " TD cells that set the axis attribute are also treated as header cells.\n");
1332 tidy_out(doc, " \n");
1335 void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code )
1338 doc->badAccess = yes;
1339 messageNode( doc, TidyAccess, node, fmt );
1342 void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code )
1345 doc->badAccess = yes;
1346 messageNode( doc, TidyAccess, node, fmt );
1351 void TY_(ReportWarning)(TidyDocImpl* doc, Node *element, Node *node, uint code)
1365 messageNode(doc, TidyWarning, rpt, fmt);
1370 messageNode(doc, TidyWarning, rpt, fmt, elemdesc, nodedesc);
1374 messageNode(doc, TidyWarning, rpt, fmt, nodedesc);
1377 messageNode(doc, TidyWarning, rpt, fmt, node->element, node->element);
1382 void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code)
1397 messageNode(doc, TidyWarning, element, fmt, elemdesc);
1402 messageNode(doc, TidyWarning, rpt, fmt, elemdesc, nodedesc);
1407 void TY_(ReportError)(TidyDocImpl* doc, Node *element, Node *node, uint code)
1424 messageNode(doc, TidyWarning, node, fmt, node->element);
1432 messageNode(doc, TidyWarning, node, fmt, nodedesc);
1446 messageNode(doc, TidyWarning, rpt, fmt);
1451 messageNode(doc, TidyWarning, rpt, fmt, node->element, node->element);
1456 messageNode(doc, TidyWarning, node, fmt, node->element, element->element);
1462 messageNode(doc, TidyWarning, node, fmt);
1470 messageNode(doc, TidyWarning, element, fmt, elemdesc);
1475 messageNode(doc, TidyWarning, rpt, fmt, element->element);
1479 messageNode(doc, TidyWarning, rpt, fmt, element->element, nodedesc);
1484 messageNode(doc, doc->badForm ? TidyError : TidyWarning, node, fmt, nodedesc);
1488 messageNode(doc, TidyWarning, rpt, fmt, nodedesc, element->element);
1493 messageNode(doc, TidyWarning, rpt, fmt, elemdesc, nodedesc);
1498 void TY_(ReportFatal)( TidyDocImpl* doc, Node *element, Node *node, uint code)
1508 messageNode(doc, TidyError, rpt, fmt);
1513 messageNode( doc, TidyError, node, fmt, nodedesc );
1517 messageNode(doc, TidyError, node, fmt, node->element, element->element);
1521 messageNode(doc, TidyError, node, fmt, node->element);
1526 void TY_(ErrorSummary)( TidyDocImpl* doc )
1530 int charenc = cfg( doc, TidyCharEncoding );
1540 if ( doc->badAccess & (USING_FRAMES | USING_NOFRAMES) )
1542 if (!((doc->badAccess & USING_FRAMES) && !(doc->badAccess & USING_NOFRAMES)))
1543 doc->badAccess &= ~(USING_FRAMES | USING_NOFRAMES);
1546 if (doc->badChars)
1549 if ( doc->badChars & WINDOWS_CHARS )
1551 tidy_out(doc, "Characters codes for the Microsoft Windows fonts in the range\n");
1552 tidy_out(doc, "128 - 159 may not be recognized on other platforms. You are\n");
1553 tidy_out(doc, "instead recommended to use named entities, e.g. &trade; rather\n");
1554 tidy_out(doc, "than Windows character code 153 (0x2122 in Unicode). Note that\n");
1555 tidy_out(doc, "as of February 1998 few browsers support the new entities.\n\n");
1558 if (doc->badChars & BC_VENDOR_SPECIFIC_CHARS)
1561 tidy_out(doc, "It is unlikely that vendor-specific, system-dependent encodings\n");
1562 tidy_out(doc, "work widely enough on the World Wide Web; you should avoid using the \n");
1563 tidy_out(doc, "%s", encnam );
1564 tidy_out(doc, " character encoding, instead you are recommended to\n" );
1565 tidy_out(doc, "use named entities, e.g. &trade;.\n\n");
1567 if ((doc->badChars & BC_INVALID_SGML_CHARS) || (doc->badChars & BC_INVALID_NCR))
1569 tidy_out(doc, "Character codes 128 to 159 (U+0080 to U+009F) are not allowed in HTML;\n");
1570 tidy_out(doc, "even if they were, they would likely be unprintable control characters.\n");
1571 tidy_out(doc, "Tidy assumed you wanted to refer to a character with the same byte value in the \n");
1572 tidy_out(doc, "%s", encnam );
1573 tidy_out(doc, " encoding and replaced that reference with the Unicode equivalent.\n\n" );
1575 if (doc->badChars & BC_INVALID_UTF8)
1577 tidy_out(doc, "Character codes for UTF-8 must be in the range: U+0000 to U+10FFFF.\n");
1578 tidy_out(doc, "The definition of UTF-8 in Annex D of ISO/IEC 10646-1:2000 also\n");
1579 tidy_out(doc, "allows for the use of five- and six-byte sequences to encode\n");
1580 tidy_out(doc, "characters that are outside the range of the Unicode character set;\n");
1581 tidy_out(doc, "those five- and six-byte sequences are illegal for the use of\n");
1582 tidy_out(doc, "UTF-8 as a transformation of Unicode characters. ISO/IEC 10646\n");
1583 tidy_out(doc, "does not allow mapping of unpaired surrogates, nor U+FFFE and U+FFFF\n");
1584 tidy_out(doc, "(but it does allow other noncharacters). For more information please refer to\n");
1585 tidy_out(doc, "http://www.unicode.org/unicode and http://www.cl.cam.ac.uk/~mgk25/unicode.html\n\n");
1590 if (doc->badChars & BC_INVALID_UTF16)
1592 tidy_out(doc, "Character codes for UTF-16 must be in the range: U+0000 to U+10FFFF.\n");
1593 tidy_out(doc, "The definition of UTF-16 in Annex C of ISO/IEC 10646-1:2000 does not allow the\n");
1594 tidy_out(doc, "mapping of unpaired surrogates. For more information please refer to\n");
1595 tidy_out(doc, "http://www.unicode.org/unicode and http://www.cl.cam.ac.uk/~mgk25/unicode.html\n\n");
1600 if (doc->badChars & BC_INVALID_URI)
1602 tidy_out(doc, "URIs must be properly escaped, they must not contain unescaped\n");
1603 tidy_out(doc, "characters below U+0021 including the space character and not\n");
1604 tidy_out(doc, "above U+007E. Tidy escapes the URI for you as recommended by\n");
1605 tidy_out(doc, "HTML 4.01 section B.2.1 and XML 1.0 section 4.2.2. Some user agents\n");
1606 tidy_out(doc, "use another algorithm to escape such URIs and some server-sided\n");
1607 tidy_out(doc, "scripts depend on that. If you want to depend on that, you must\n");
1608 tidy_out(doc, "escape the URI by your own. For more information please refer to\n");
1609 tidy_out(doc, "http://www.w3.org/International/O-URL-and-ident.html\n\n");
1613 if (doc->badForm)
1615 tidy_out(doc, "You may need to move one or both of the <form> and </form>\n");
1616 tidy_out(doc, "tags. HTML elements should be properly nested and form elements\n");
1617 tidy_out(doc, "are no exception. For instance you should not place the <form>\n");
1618 tidy_out(doc, "in one table cell and the </form> in another. If the <form> is\n");
1619 tidy_out(doc, "placed before a table, the </form> cannot be placed inside the\n");
1620 tidy_out(doc, "table! Note that one form can't be nested inside another!\n\n");
1623 if (doc->badAccess)
1625 if ( cfg(doc, TidyAccessibilityCheckLevel) > 0 )
1627 tidy_out(doc, "For further advice on how to make your pages accessible, see\n");
1628 tidy_out(doc, "%s", ACCESS_URL );
1629 tidy_out(doc, " and\n" );
1630 tidy_out(doc, "%s", ATRC_ACCESS_URL );
1631 tidy_out(doc, ".\n" );
1632 tidy_out(doc, "You may also want to try \"http://www.cast.org/bobby/\" which is a free Web-based\n");
1633 tidy_out(doc, "service for checking URLs for accessibility.\n\n");
1637 if (doc->badAccess & MISSING_SUMMARY)
1639 tidy_out(doc, "The table summary attribute should be used to describe\n");
1640 tidy_out(doc, "the table structure. It is very helpful for people using\n");
1641 tidy_out(doc, "non-visual browsers. The scope and headers attributes for\n");
1642 tidy_out(doc, "table cells are useful for specifying which headers apply\n");
1643 tidy_out(doc, "to each table cell, enabling non-visual browsers to provide\n");
1644 tidy_out(doc, "a meaningful context for each cell.\n\n");
1647 if (doc->badAccess & MISSING_IMAGE_ALT)
1649 tidy_out(doc, "The alt attribute should be used to give a short description\n");
1650 tidy_out(doc, "of an image; longer descriptions should be given with the\n");
1651 tidy_out(doc, "longdesc attribute which takes a URL linked to the description.\n");
1652 tidy_out(doc, "These measures are needed for people using non-graphical browsers.\n\n");
1655 if (doc->badAccess & MISSING_IMAGE_MAP)
1657 tidy_out(doc, "Use client-side image maps in preference to server-side image\n");
1658 tidy_out(doc, "maps as the latter are inaccessible to people using non-\n");
1659 tidy_out(doc, "graphical browsers. In addition, client-side maps are easier\n");
1660 tidy_out(doc, "to set up and provide immediate feedback to users.\n\n");
1663 if (doc->badAccess & MISSING_LINK_ALT)
1665 tidy_out(doc, "For hypertext links defined using a client-side image map, you\n");
1666 tidy_out(doc, "need to use the alt attribute to provide a textual description\n");
1667 tidy_out(doc, "of the link for people using non-graphical browsers.\n\n");
1670 if ((doc->badAccess & USING_FRAMES) && !(doc->badAccess & USING_NOFRAMES))
1672 tidy_out(doc, "Pages designed using frames presents problems for\n");
1673 tidy_out(doc, "people who are either blind or using a browser that\n");
1674 tidy_out(doc, "doesn't support frames. A frames-based page should always\n");
1675 tidy_out(doc, "include an alternative layout inside a NOFRAMES element.\n\n");
1678 tidy_out(doc, "For further advice on how to make your pages accessible\n");
1679 tidy_out(doc, "see " );
1680 tidy_out(doc, ACCESS_URL );
1681 tidy_out(doc, ". You may also want to try\n" );
1682 tidy_out(doc, "\"http://www.cast.org/bobby/\" which is a free Web-based\n");
1683 tidy_out(doc, "service for checking URLs for accessibility.\n\n");
1687 if (doc->badLayout)
1689 if (doc->badLayout & USING_LAYER)
1691 tidy_out(doc, "The Cascading Style Sheets (CSS) Positioning mechanism\n");
1692 tidy_out(doc, "is recommended in preference to the proprietary <LAYER>\n");
1693 tidy_out(doc, "element due to limited vendor support for LAYER.\n\n");
1696 if (doc->badLayout & USING_SPACER)
1698 tidy_out(doc, "You are recommended to use CSS for controlling white\n");
1699 tidy_out(doc, "space (e.g. for indentation, margins and line spacing).\n");
1700 tidy_out(doc, "The proprietary <SPACER> element has limited vendor support.\n\n");
1703 if (doc->badLayout & USING_FONT)
1705 tidy_out(doc, "You are recommended to use CSS to specify the font and\n");
1706 tidy_out(doc, "properties such as its size and color. This will reduce\n");
1707 tidy_out(doc, "the size of HTML files and make them easier to maintain\n");
1708 tidy_out(doc, "compared with using <FONT> elements.\n\n");
1711 if (doc->badLayout & USING_NOBR)
1713 tidy_out(doc, "You are recommended to use CSS to control line wrapping.\n");
1714 tidy_out(doc, "Use \"white-space: nowrap\" to inhibit wrapping in place\n");
1715 tidy_out(doc, "of inserting <NOBR>...</NOBR> into the markup.\n\n");
1718 if (doc->badLayout & USING_BODY)
1720 tidy_out(doc, "You are recommended to use CSS to specify page and link colors\n");
1726 void TY_(UnknownOption)( TidyDocImpl* doc, char c )
1728 message( doc, TidyConfig,
1732 void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file )
1734 message( doc, TidyConfig,
1739 void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc )
1741 tidy_out(doc, "This document has errors that must be fixed before\n");
1742 tidy_out(doc, "using HTML Tidy to generate a tidied up version.\n\n");
1745 void TY_(GeneralInfo)( TidyDocImpl* doc )
1747 tidy_out(doc, "To learn more about HTML Tidy see http://tidy.sourceforge.net\n");
1748 tidy_out(doc, "Please send bug reports to html-tidy@w3.org\n");
1749 tidy_out(doc, "HTML and CSS specifications are available from http://www.w3.org/\n");
1750 tidy_out(doc, "Lobby your company to join W3C, see http://www.w3.org/Consortium\n");
1755 void TY_(AccessibilityHelloMessage)( TidyDocImpl* doc )
1757 tidy_out( doc, "\n" );
1758 tidy_out( doc, "Accessibility Checks: Version 0.1\n" );
1759 tidy_out( doc, "\n" );
1765 void TY_(HelloMessage)( TidyDocImpl* doc, ctmbstr date, ctmbstr filename )
1786 tidy_out( doc, buf );
1790 void TY_(ReportMarkupVersion)( TidyDocImpl* doc )
1792 if (doc->givenDoctype)
1795 message(doc, TidyInfo, "Doctype given is \"%s\"", doc->givenDoctype);
1798 if ( ! cfgBool(doc, TidyXmlTags) )
1800 Bool isXhtml = doc->lexer->isvoyager;
1804 apparentVers = TY_(ApparentVersion)( doc );
1811 message( doc, TidyInfo, "Document content looks like %s", vers );
1814 if ( TY_(WarnMissingSIInEmittedDocType)( doc ) )
1815 message( doc, TidyInfo, "No system identifier in emitted doctype" );
1819 void TY_(ReportNumWarnings)( TidyDocImpl* doc )
1821 if ( doc->warnings > 0 || doc->errors > 0 )
1823 tidy_out( doc, "%u %s, %u %s were found!",
1824 doc->warnings, doc->warnings == 1 ? "warning" : "warnings",
1825 doc->errors, doc->errors == 1 ? "error" : "errors" );
1827 if ( doc->errors > cfg(doc, TidyShowErrors) ||
1828 !cfgBool(doc, TidyShowWarnings) )
1829 tidy_out( doc, " Not all warnings/errors were shown.\n\n" );
1831 tidy_out( doc, "\n\n" );
1834 tidy_out( doc, "No warnings or errors were found.\n\n" );