package Whatpm::HTML;
use strict;
our $VERSION=do{my @r=(q$Revision: 1.193 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
use Error qw(:try);
## NOTE: This module don't check all HTML5 parse errors; character
## encoding related parse errors are expected to be handled by relevant
## modules.
## Parse errors for control characters that are not allowed in HTML5
## documents, for surrogate code points, and for noncharacter code
## points, as well as U+FFFD substitions for characters whose code points
## is higher than U+10FFFF may be detected by combining the parser with
## the checker implemented by Whatpm::Charset::UnicodeChecker (for its
## usage example, see |t/HTML-tree.t| in the Whatpm package or the
## WebHACC::Language::HTML module in the WebHACC package).
## ISSUE:
## var doc = implementation.createDocument (null, null, null);
## doc.write ('');
## alert (doc.compatMode);
require IO::Handle;
my $HTML_NS = q;
my $MML_NS = q;
my $SVG_NS = q;
my $XLINK_NS = q;
my $XML_NS = q;
my $XMLNS_NS = q;
sub A_EL () { 0b1 }
sub ADDRESS_EL () { 0b10 }
sub BODY_EL () { 0b100 }
sub BUTTON_EL () { 0b1000 }
sub CAPTION_EL () { 0b10000 }
sub DD_EL () { 0b100000 }
sub DIV_EL () { 0b1000000 }
sub DT_EL () { 0b10000000 }
sub FORM_EL () { 0b100000000 }
sub FORMATTING_EL () { 0b1000000000 }
sub FRAMESET_EL () { 0b10000000000 }
sub HEADING_EL () { 0b100000000000 }
sub HTML_EL () { 0b1000000000000 }
sub LI_EL () { 0b10000000000000 }
sub NOBR_EL () { 0b100000000000000 }
sub OPTION_EL () { 0b1000000000000000 }
sub OPTGROUP_EL () { 0b10000000000000000 }
sub P_EL () { 0b100000000000000000 }
sub SELECT_EL () { 0b1000000000000000000 }
sub TABLE_EL () { 0b10000000000000000000 }
sub TABLE_CELL_EL () { 0b100000000000000000000 }
sub TABLE_ROW_EL () { 0b1000000000000000000000 }
sub TABLE_ROW_GROUP_EL () { 0b10000000000000000000000 }
sub MISC_SCOPING_EL () { 0b100000000000000000000000 }
sub MISC_SPECIAL_EL () { 0b1000000000000000000000000 }
sub FOREIGN_EL () { 0b10000000000000000000000000 }
sub FOREIGN_FLOW_CONTENT_EL () { 0b100000000000000000000000000 }
sub MML_AXML_EL () { 0b1000000000000000000000000000 }
sub RUBY_EL () { 0b10000000000000000000000000000 }
sub RUBY_COMPONENT_EL () { 0b100000000000000000000000000000 }
sub TABLE_ROWS_EL () {
TABLE_EL |
TABLE_ROW_EL |
TABLE_ROW_GROUP_EL
}
## NOTE: Used in "generate implied end tags" algorithm.
## NOTE: There is a code where a modified version of
## END_TAG_OPTIONAL_EL is used in "generate implied end tags"
## implementation (search for the algorithm name).
sub END_TAG_OPTIONAL_EL () {
DD_EL |
DT_EL |
LI_EL |
OPTION_EL |
OPTGROUP_EL |
P_EL |
RUBY_COMPONENT_EL
}
## NOTE: Used in