3142 |
} elsif (defined $token->{public_identifier}) { |
} elsif (defined $token->{public_identifier}) { |
3143 |
my $pubid = $token->{public_identifier}; |
my $pubid = $token->{public_identifier}; |
3144 |
$pubid =~ tr/a-z/A-z/; |
$pubid =~ tr/a-z/A-z/; |
3145 |
if ({ |
my $prefix = [ |
3146 |
"+//SILMARIL//DTD HTML PRO V0R11 19970101//EN" => 1, |
"+//SILMARIL//DTD HTML PRO V0R11 19970101//", |
3147 |
"-//ADVASOFT LTD//DTD HTML 3.0 ASWEDIT + EXTENSIONS//EN" => 1, |
"-//ADVASOFT LTD//DTD HTML 3.0 ASWEDIT + EXTENSIONS//", |
3148 |
"-//AS//DTD HTML 3.0 ASWEDIT + EXTENSIONS//EN" => 1, |
"-//AS//DTD HTML 3.0 ASWEDIT + EXTENSIONS//", |
3149 |
"-//IETF//DTD HTML 2.0 LEVEL 1//EN" => 1, |
"-//IETF//DTD HTML 2.0 LEVEL 1//", |
3150 |
"-//IETF//DTD HTML 2.0 LEVEL 2//EN" => 1, |
"-//IETF//DTD HTML 2.0 LEVEL 2//", |
3151 |
"-//IETF//DTD HTML 2.0 STRICT LEVEL 1//EN" => 1, |
"-//IETF//DTD HTML 2.0 STRICT LEVEL 1//", |
3152 |
"-//IETF//DTD HTML 2.0 STRICT LEVEL 2//EN" => 1, |
"-//IETF//DTD HTML 2.0 STRICT LEVEL 2//", |
3153 |
"-//IETF//DTD HTML 2.0 STRICT//EN" => 1, |
"-//IETF//DTD HTML 2.0 STRICT//", |
3154 |
"-//IETF//DTD HTML 2.0//EN" => 1, |
"-//IETF//DTD HTML 2.0//", |
3155 |
"-//IETF//DTD HTML 2.1E//EN" => 1, |
"-//IETF//DTD HTML 2.1E//", |
3156 |
"-//IETF//DTD HTML 3.0//EN" => 1, |
"-//IETF//DTD HTML 3.0//", |
3157 |
"-//IETF//DTD HTML 3.0//EN//" => 1, |
"-//IETF//DTD HTML 3.2 FINAL//", |
3158 |
"-//IETF//DTD HTML 3.2 FINAL//EN" => 1, |
"-//IETF//DTD HTML 3.2//", |
3159 |
"-//IETF//DTD HTML 3.2//EN" => 1, |
"-//IETF//DTD HTML 3//", |
3160 |
"-//IETF//DTD HTML 3//EN" => 1, |
"-//IETF//DTD HTML LEVEL 0//", |
3161 |
"-//IETF//DTD HTML LEVEL 0//EN" => 1, |
"-//IETF//DTD HTML LEVEL 1//", |
3162 |
"-//IETF//DTD HTML LEVEL 0//EN//2.0" => 1, |
"-//IETF//DTD HTML LEVEL 2//", |
3163 |
"-//IETF//DTD HTML LEVEL 1//EN" => 1, |
"-//IETF//DTD HTML LEVEL 3//", |
3164 |
"-//IETF//DTD HTML LEVEL 1//EN//2.0" => 1, |
"-//IETF//DTD HTML STRICT LEVEL 0//", |
3165 |
"-//IETF//DTD HTML LEVEL 2//EN" => 1, |
"-//IETF//DTD HTML STRICT LEVEL 1//", |
3166 |
"-//IETF//DTD HTML LEVEL 2//EN//2.0" => 1, |
"-//IETF//DTD HTML STRICT LEVEL 2//", |
3167 |
"-//IETF//DTD HTML LEVEL 3//EN" => 1, |
"-//IETF//DTD HTML STRICT LEVEL 3//", |
3168 |
"-//IETF//DTD HTML LEVEL 3//EN//3.0" => 1, |
"-//IETF//DTD HTML STRICT//", |
3169 |
"-//IETF//DTD HTML STRICT LEVEL 0//EN" => 1, |
"-//IETF//DTD HTML//", |
3170 |
"-//IETF//DTD HTML STRICT LEVEL 0//EN//2.0" => 1, |
"-//METRIUS//DTD METRIUS PRESENTATIONAL//", |
3171 |
"-//IETF//DTD HTML STRICT LEVEL 1//EN" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 HTML STRICT//", |
3172 |
"-//IETF//DTD HTML STRICT LEVEL 1//EN//2.0" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 HTML//", |
3173 |
"-//IETF//DTD HTML STRICT LEVEL 2//EN" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 TABLES//", |
3174 |
"-//IETF//DTD HTML STRICT LEVEL 2//EN//2.0" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 HTML STRICT//", |
3175 |
"-//IETF//DTD HTML STRICT LEVEL 3//EN" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 HTML//", |
3176 |
"-//IETF//DTD HTML STRICT LEVEL 3//EN//3.0" => 1, |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 TABLES//", |
3177 |
"-//IETF//DTD HTML STRICT//EN" => 1, |
"-//NETSCAPE COMM. CORP.//DTD HTML//", |
3178 |
"-//IETF//DTD HTML STRICT//EN//2.0" => 1, |
"-//NETSCAPE COMM. CORP.//DTD STRICT HTML//", |
3179 |
"-//IETF//DTD HTML STRICT//EN//3.0" => 1, |
"-//O'REILLY AND ASSOCIATES//DTD HTML 2.0//", |
3180 |
"-//IETF//DTD HTML//EN" => 1, |
"-//O'REILLY AND ASSOCIATES//DTD HTML EXTENDED 1.0//", |
3181 |
"-//IETF//DTD HTML//EN//2.0" => 1, |
"-//O'REILLY AND ASSOCIATES//DTD HTML EXTENDED RELAXED 1.0//", |
3182 |
"-//IETF//DTD HTML//EN//3.0" => 1, |
"-//SOFTQUAD SOFTWARE//DTD HOTMETAL PRO 6.0::19990601::EXTENSIONS TO HTML 4.0//", |
3183 |
"-//METRIUS//DTD METRIUS PRESENTATIONAL//EN" => 1, |
"-//SOFTQUAD//DTD HOTMETAL PRO 4.0::19971010::EXTENSIONS TO HTML 4.0//", |
3184 |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 HTML STRICT//EN" => 1, |
"-//SPYGLASS//DTD HTML 2.0 EXTENDED//", |
3185 |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 HTML//EN" => 1, |
"-//SQ//DTD HTML 2.0 HOTMETAL + EXTENSIONS//", |
3186 |
"-//MICROSOFT//DTD INTERNET EXPLORER 2.0 TABLES//EN" => 1, |
"-//SUN MICROSYSTEMS CORP.//DTD HOTJAVA HTML//", |
3187 |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 HTML STRICT//EN" => 1, |
"-//SUN MICROSYSTEMS CORP.//DTD HOTJAVA STRICT HTML//", |
3188 |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 HTML//EN" => 1, |
"-//W3C//DTD HTML 3 1995-03-24//", |
3189 |
"-//MICROSOFT//DTD INTERNET EXPLORER 3.0 TABLES//EN" => 1, |
"-//W3C//DTD HTML 3.2 DRAFT//", |
3190 |
"-//NETSCAPE COMM. CORP.//DTD HTML//EN" => 1, |
"-//W3C//DTD HTML 3.2 FINAL//", |
3191 |
"-//NETSCAPE COMM. CORP.//DTD STRICT HTML//EN" => 1, |
"-//W3C//DTD HTML 3.2//", |
3192 |
"-//O'REILLY AND ASSOCIATES//DTD HTML 2.0//EN" => 1, |
"-//W3C//DTD HTML 3.2S DRAFT//", |
3193 |
"-//O'REILLY AND ASSOCIATES//DTD HTML EXTENDED 1.0//EN" => 1, |
"-//W3C//DTD HTML 4.0 FRAMESET//", |
3194 |
"-//O'REILLY AND ASSOCIATES//DTD HTML EXTENDED RELAXED 1.0//EN" => 1, |
"-//W3C//DTD HTML 4.0 TRANSITIONAL//", |
3195 |
"-//SOFTQUAD SOFTWARE//DTD HOTMETAL PRO 6.0::19990601::EXTENSIONS TO HTML 4.0//EN" => 1, |
"-//W3C//DTD HTML EXPERIMETNAL 19960712//", |
3196 |
"-//SOFTQUAD//DTD HOTMETAL PRO 4.0::19971010::EXTENSIONS TO HTML 4.0//EN" => 1, |
"-//W3C//DTD HTML EXPERIMENTAL 970421//", |
3197 |
"-//SPYGLASS//DTD HTML 2.0 EXTENDED//EN" => 1, |
"-//W3C//DTD W3 HTML//", |
3198 |
"-//SQ//DTD HTML 2.0 HOTMETAL + EXTENSIONS//EN" => 1, |
"-//W3O//DTD W3 HTML 3.0//", |
3199 |
"-//SUN MICROSYSTEMS CORP.//DTD HOTJAVA HTML//EN" => 1, |
"-//WEBTECHS//DTD MOZILLA HTML 2.0//", |
3200 |
"-//SUN MICROSYSTEMS CORP.//DTD HOTJAVA STRICT HTML//EN" => 1, |
"-//WEBTECHS//DTD MOZILLA HTML//", |
3201 |
"-//W3C//DTD HTML 3 1995-03-24//EN" => 1, |
]; # $prefix |
3202 |
"-//W3C//DTD HTML 3.2 DRAFT//EN" => 1, |
my $match; |
3203 |
"-//W3C//DTD HTML 3.2 FINAL//EN" => 1, |
for (@$prefix) { |
3204 |
"-//W3C//DTD HTML 3.2//EN" => 1, |
if (substr ($prefix, 0, length $_) eq $_) { |
3205 |
"-//W3C//DTD HTML 3.2S DRAFT//EN" => 1, |
$match = 1; |
3206 |
"-//W3C//DTD HTML 4.0 FRAMESET//EN" => 1, |
last; |
3207 |
"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN" => 1, |
} |
3208 |
"-//W3C//DTD HTML EXPERIMETNAL 19960712//EN" => 1, |
} |
3209 |
"-//W3C//DTD HTML EXPERIMENTAL 970421//EN" => 1, |
if ($match or |
3210 |
"-//W3C//DTD W3 HTML//EN" => 1, |
$pubid eq "-//W3O//DTD W3 HTML STRICT 3.0//EN//" or |
3211 |
"-//W3O//DTD W3 HTML 3.0//EN" => 1, |
$pubid eq "-/W3C/DTD HTML 4.0 TRANSITIONAL/EN" or |
3212 |
"-//W3O//DTD W3 HTML 3.0//EN//" => 1, |
$pubid eq "HTML") { |
|
"-//W3O//DTD W3 HTML STRICT 3.0//EN//" => 1, |
|
|
"-//WEBTECHS//DTD MOZILLA HTML 2.0//EN" => 1, |
|
|
"-//WEBTECHS//DTD MOZILLA HTML//EN" => 1, |
|
|
"-/W3C/DTD HTML 4.0 TRANSITIONAL/EN" => 1, |
|
|
"HTML" => 1, |
|
|
}->{$pubid}) { |
|
3213 |
!!!cp ('t5'); |
!!!cp ('t5'); |
3214 |
$self->{document}->manakai_compat_mode ('quirks'); |
$self->{document}->manakai_compat_mode ('quirks'); |
3215 |
} elsif ($pubid eq "-//W3C//DTD HTML 4.01 FRAMESET//EN" or |
} elsif ($pubid =~ m[^-//W3C//DTD HTML 4.01 FRAMESET//] or |
3216 |
$pubid eq "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN") { |
$pubid =~ m[^-//W3C//DTD HTML 4.01 TRANSITIONAL//]) { |
3217 |
if (defined $token->{system_identifier}) { |
if (defined $token->{system_identifier}) { |
3218 |
!!!cp ('t6'); |
!!!cp ('t6'); |
3219 |
$self->{document}->manakai_compat_mode ('quirks'); |
$self->{document}->manakai_compat_mode ('quirks'); |
3221 |
!!!cp ('t7'); |
!!!cp ('t7'); |
3222 |
$self->{document}->manakai_compat_mode ('limited quirks'); |
$self->{document}->manakai_compat_mode ('limited quirks'); |
3223 |
} |
} |
3224 |
} elsif ($pubid eq "-//W3C//DTD XHTML 1.0 FRAMESET//EN" or |
} elsif ($pubid =~ m[^-//W3C//DTD XHTML 1.0 FRAMESET//] or |
3225 |
$pubid eq "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN") { |
$pubid =~ m[^-//W3C//DTD XHTML 1.0 TRANSITIONAL//]) { |
3226 |
!!!cp ('t8'); |
!!!cp ('t8'); |
3227 |
$self->{document}->manakai_compat_mode ('limited quirks'); |
$self->{document}->manakai_compat_mode ('limited quirks'); |
3228 |
} else { |
} else { |
3235 |
my $sysid = $token->{system_identifier}; |
my $sysid = $token->{system_identifier}; |
3236 |
$sysid =~ tr/A-Z/a-z/; |
$sysid =~ tr/A-Z/a-z/; |
3237 |
if ($sysid eq "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") { |
if ($sysid eq "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") { |
3238 |
## TODO: Check the spec: PUBLIC "(limited quirks)" "(quirks)" |
## NOTE: Ensure that |PUBLIC "(limited quirks)" "(quirks)"| is |
3239 |
|
## marked as quirks. |
3240 |
$self->{document}->manakai_compat_mode ('quirks'); |
$self->{document}->manakai_compat_mode ('quirks'); |
3241 |
!!!cp ('t11'); |
!!!cp ('t11'); |
3242 |
} else { |
} else { |