911 |
|
|
912 |
INITIAL: { |
INITIAL: { |
913 |
if ($token->{type} == DOCTYPE_TOKEN) { |
if ($token->{type} == DOCTYPE_TOKEN) { |
914 |
## NOTE: Conformance checkers MAY, instead of reporting "not HTML5" |
## NOTE: Conformance checkers MAY, instead of reporting "not |
915 |
## error, switch to a conformance checking mode for another |
## HTML5" error, switch to a conformance checking mode for |
916 |
## language. |
## another language. (We don't support such mode switchings; it |
917 |
|
## is nonsense to do anything different from what browsers do.) |
918 |
my $doctype_name = $token->{name}; |
my $doctype_name = $token->{name}; |
919 |
$doctype_name = '' unless defined $doctype_name; |
$doctype_name = '' unless defined $doctype_name; |
920 |
|
my $doctype = $self->{document}->create_document_type_definition |
921 |
|
($doctype_name); |
922 |
|
|
923 |
$doctype_name =~ tr/a-z/A-Z/; # ASCII case-insensitive |
$doctype_name =~ tr/a-z/A-Z/; # ASCII case-insensitive |
924 |
if (not defined $token->{name} or # <!DOCTYPE> |
if (not defined $token->{name} or # <!DOCTYPE> |
925 |
defined $token->{sysid}) { |
defined $token->{sysid}) { |
941 |
# |
# |
942 |
} |
} |
943 |
|
|
|
my $doctype = $self->{document}->create_document_type_definition |
|
|
($token->{name}); ## ISSUE: If name is missing (e.g. <!DOCTYPE>)? |
|
944 |
## NOTE: Default value for both |public_id| and |system_id| attributes |
## NOTE: Default value for both |public_id| and |system_id| attributes |
945 |
## are empty strings, so that we don't set any value in missing cases. |
## are empty strings, so that we don't set any value in missing cases. |
946 |
$doctype->public_id ($token->{pubid}) if defined $token->{pubid}; |
$doctype->public_id ($token->{pubid}) if defined $token->{pubid}; |
947 |
$doctype->system_id ($token->{sysid}) if defined $token->{sysid}; |
$doctype->system_id ($token->{sysid}) if defined $token->{sysid}; |
948 |
|
|
949 |
## NOTE: Other DocumentType attributes are null or empty lists. |
## NOTE: Other DocumentType attributes are null or empty lists. |
950 |
## In Firefox3, |internalSubset| attribute is set to the empty |
## In Firefox3, |internalSubset| attribute is set to the empty |
951 |
## string, while |null| is an allowed value for the attribute |
## string, while |null| is an allowed value for the attribute |