708 |
my $class = shift; |
my $class = shift; |
709 |
my $self = bless { |
my $self = bless { |
710 |
level => {must => 'm', |
level => {must => 'm', |
711 |
|
should => 's', |
712 |
warn => 'w', |
warn => 'w', |
713 |
info => 'i', |
info => 'i', |
714 |
uncertain => 'u'}, |
uncertain => 'u'}, |
3155 |
## language. |
## language. |
3156 |
my $doctype_name = $token->{name}; |
my $doctype_name = $token->{name}; |
3157 |
$doctype_name = '' unless defined $doctype_name; |
$doctype_name = '' unless defined $doctype_name; |
3158 |
$doctype_name =~ tr/a-z/A-Z/; |
$doctype_name =~ tr/a-z/A-Z/; # ASCII case-insensitive |
3159 |
if (not defined $token->{name} or # <!DOCTYPE> |
if (not defined $token->{name} or # <!DOCTYPE> |
|
defined $token->{public_identifier} or |
|
3160 |
defined $token->{system_identifier}) { |
defined $token->{system_identifier}) { |
3161 |
!!!cp ('t1'); |
!!!cp ('t1'); |
3162 |
!!!parse-error (type => 'not HTML5', token => $token); |
!!!parse-error (type => 'not HTML5', token => $token); |
3163 |
} elsif ($doctype_name ne 'HTML') { |
} elsif ($doctype_name ne 'HTML') { |
3164 |
!!!cp ('t2'); |
!!!cp ('t2'); |
|
## ISSUE: ASCII case-insensitive? (in fact it does not matter) |
|
3165 |
!!!parse-error (type => 'not HTML5', token => $token); |
!!!parse-error (type => 'not HTML5', token => $token); |
3166 |
|
} elsif (defined $token->{public_identifier}) { |
3167 |
|
if ($token->{public_identifier} eq 'XSLT-compat') { |
3168 |
|
!!!cp ('t1.2'); |
3169 |
|
!!!parse-error (type => 'XSLT-compat', token => $token, |
3170 |
|
level => $self->{level}->{should}); |
3171 |
|
} else { |
3172 |
|
!!!parse-error (type => 'not HTML5', token => $token); |
3173 |
|
} |
3174 |
} else { |
} else { |
3175 |
!!!cp ('t3'); |
!!!cp ('t3'); |
3176 |
|
# |
3177 |
} |
} |
3178 |
|
|
3179 |
my $doctype = $self->{document}->create_document_type_definition |
my $doctype = $self->{document}->create_document_type_definition |