| 66 |
} |
} |
| 67 |
|
|
| 68 |
## NOTE: Used in "generate implied end tags" algorithm. |
## NOTE: Used in "generate implied end tags" algorithm. |
| 69 |
## NOTE: There is a code where a modified version of END_TAG_OPTIONAL_EL |
## NOTE: There is a code where a modified version of |
| 70 |
## is used in "generate implied end tags" implementation (search for the |
## END_TAG_OPTIONAL_EL is used in "generate implied end tags" |
| 71 |
## function mae). |
## implementation (search for the algorithm name). |
| 72 |
sub END_TAG_OPTIONAL_EL () { |
sub END_TAG_OPTIONAL_EL () { |
| 73 |
DD_EL | |
DD_EL | |
| 74 |
DT_EL | |
DT_EL | |
| 75 |
LI_EL | |
LI_EL | |
| 76 |
|
OPTION_EL | |
| 77 |
|
OPTGROUP_EL | |
| 78 |
P_EL | |
P_EL | |
| 79 |
RUBY_COMPONENT_EL |
RUBY_COMPONENT_EL |
| 80 |
} |
} |
| 86 |
LI_EL | |
LI_EL | |
| 87 |
P_EL | |
P_EL | |
| 88 |
|
|
| 89 |
|
## ISSUE: option, optgroup, rt, rp? |
| 90 |
|
|
| 91 |
BODY_EL | |
BODY_EL | |
| 92 |
HTML_EL | |
HTML_EL | |
| 93 |
TABLE_CELL_EL | |
TABLE_CELL_EL | |
| 132 |
FORM_EL | |
FORM_EL | |
| 133 |
FRAMESET_EL | |
FRAMESET_EL | |
| 134 |
HEADING_EL | |
HEADING_EL | |
|
OPTION_EL | |
|
|
OPTGROUP_EL | |
|
| 135 |
SELECT_EL | |
SELECT_EL | |
| 136 |
TABLE_ROW_EL | |
TABLE_ROW_EL | |
| 137 |
TABLE_ROW_GROUP_EL | |
TABLE_ROW_GROUP_EL | |
| 143 |
address => ADDRESS_EL, |
address => ADDRESS_EL, |
| 144 |
applet => MISC_SCOPING_EL, |
applet => MISC_SCOPING_EL, |
| 145 |
area => MISC_SPECIAL_EL, |
area => MISC_SPECIAL_EL, |
| 146 |
|
article => MISC_SPECIAL_EL, |
| 147 |
|
aside => MISC_SPECIAL_EL, |
| 148 |
b => FORMATTING_EL, |
b => FORMATTING_EL, |
| 149 |
base => MISC_SPECIAL_EL, |
base => MISC_SPECIAL_EL, |
| 150 |
basefont => MISC_SPECIAL_EL, |
basefont => MISC_SPECIAL_EL, |
| 158 |
center => MISC_SPECIAL_EL, |
center => MISC_SPECIAL_EL, |
| 159 |
col => MISC_SPECIAL_EL, |
col => MISC_SPECIAL_EL, |
| 160 |
colgroup => MISC_SPECIAL_EL, |
colgroup => MISC_SPECIAL_EL, |
| 161 |
|
command => MISC_SPECIAL_EL, |
| 162 |
|
datagrid => MISC_SPECIAL_EL, |
| 163 |
dd => DD_EL, |
dd => DD_EL, |
| 164 |
|
details => MISC_SPECIAL_EL, |
| 165 |
|
dialog => MISC_SPECIAL_EL, |
| 166 |
dir => MISC_SPECIAL_EL, |
dir => MISC_SPECIAL_EL, |
| 167 |
div => DIV_EL, |
div => DIV_EL, |
| 168 |
dl => MISC_SPECIAL_EL, |
dl => MISC_SPECIAL_EL, |
| 169 |
dt => DT_EL, |
dt => DT_EL, |
| 170 |
em => FORMATTING_EL, |
em => FORMATTING_EL, |
| 171 |
embed => MISC_SPECIAL_EL, |
embed => MISC_SPECIAL_EL, |
| 172 |
|
eventsource => MISC_SPECIAL_EL, |
| 173 |
fieldset => MISC_SPECIAL_EL, |
fieldset => MISC_SPECIAL_EL, |
| 174 |
|
figure => MISC_SPECIAL_EL, |
| 175 |
font => FORMATTING_EL, |
font => FORMATTING_EL, |
| 176 |
|
footer => MISC_SPECIAL_EL, |
| 177 |
form => FORM_EL, |
form => FORM_EL, |
| 178 |
frame => MISC_SPECIAL_EL, |
frame => MISC_SPECIAL_EL, |
| 179 |
frameset => FRAMESET_EL, |
frameset => FRAMESET_EL, |
| 184 |
h5 => HEADING_EL, |
h5 => HEADING_EL, |
| 185 |
h6 => HEADING_EL, |
h6 => HEADING_EL, |
| 186 |
head => MISC_SPECIAL_EL, |
head => MISC_SPECIAL_EL, |
| 187 |
|
header => MISC_SPECIAL_EL, |
| 188 |
hr => MISC_SPECIAL_EL, |
hr => MISC_SPECIAL_EL, |
| 189 |
html => HTML_EL, |
html => HTML_EL, |
| 190 |
i => FORMATTING_EL, |
i => FORMATTING_EL, |
| 191 |
iframe => MISC_SPECIAL_EL, |
iframe => MISC_SPECIAL_EL, |
| 192 |
img => MISC_SPECIAL_EL, |
img => MISC_SPECIAL_EL, |
| 193 |
|
#image => MISC_SPECIAL_EL, ## NOTE: Commented out in the spec. |
| 194 |
input => MISC_SPECIAL_EL, |
input => MISC_SPECIAL_EL, |
| 195 |
isindex => MISC_SPECIAL_EL, |
isindex => MISC_SPECIAL_EL, |
| 196 |
li => LI_EL, |
li => LI_EL, |
| 199 |
marquee => MISC_SCOPING_EL, |
marquee => MISC_SCOPING_EL, |
| 200 |
menu => MISC_SPECIAL_EL, |
menu => MISC_SPECIAL_EL, |
| 201 |
meta => MISC_SPECIAL_EL, |
meta => MISC_SPECIAL_EL, |
| 202 |
|
nav => MISC_SPECIAL_EL, |
| 203 |
nobr => NOBR_EL | FORMATTING_EL, |
nobr => NOBR_EL | FORMATTING_EL, |
| 204 |
noembed => MISC_SPECIAL_EL, |
noembed => MISC_SPECIAL_EL, |
| 205 |
noframes => MISC_SPECIAL_EL, |
noframes => MISC_SPECIAL_EL, |
| 218 |
s => FORMATTING_EL, |
s => FORMATTING_EL, |
| 219 |
script => MISC_SPECIAL_EL, |
script => MISC_SPECIAL_EL, |
| 220 |
select => SELECT_EL, |
select => SELECT_EL, |
| 221 |
|
section => MISC_SPECIAL_EL, |
| 222 |
small => FORMATTING_EL, |
small => FORMATTING_EL, |
| 223 |
spacer => MISC_SPECIAL_EL, |
spacer => MISC_SPECIAL_EL, |
| 224 |
strike => FORMATTING_EL, |
strike => FORMATTING_EL, |
| 249 |
mtext => FOREIGN_FLOW_CONTENT_EL, |
mtext => FOREIGN_FLOW_CONTENT_EL, |
| 250 |
}, |
}, |
| 251 |
$SVG_NS => { |
$SVG_NS => { |
| 252 |
foreignObject => FOREIGN_FLOW_CONTENT_EL, |
foreignObject => FOREIGN_FLOW_CONTENT_EL | MISC_SCOPING_EL, |
| 253 |
desc => FOREIGN_FLOW_CONTENT_EL, |
desc => FOREIGN_FLOW_CONTENT_EL, |
| 254 |
title => FOREIGN_FLOW_CONTENT_EL, |
title => FOREIGN_FLOW_CONTENT_EL, |
| 255 |
}, |
}, |
| 338 |
|
|
| 339 |
## ISSUE: xmlns:xlink="non-xlink-ns" is not an error. |
## ISSUE: xmlns:xlink="non-xlink-ns" is not an error. |
| 340 |
|
|
| 341 |
my $c1_entity_char = { |
my $charref_map = { |
| 342 |
|
0x0D => 0x000A, |
| 343 |
0x80 => 0x20AC, |
0x80 => 0x20AC, |
| 344 |
0x81 => 0xFFFD, |
0x81 => 0xFFFD, |
| 345 |
0x82 => 0x201A, |
0x82 => 0x201A, |
| 372 |
0x9D => 0xFFFD, |
0x9D => 0xFFFD, |
| 373 |
0x9E => 0x017E, |
0x9E => 0x017E, |
| 374 |
0x9F => 0x0178, |
0x9F => 0x0178, |
| 375 |
}; # $c1_entity_char |
}; # $charref_map |
| 376 |
|
$charref_map->{$_} = 0xFFFD |
| 377 |
|
for 0x0000..0x0008, 0x000B, 0x000E..0x001F, 0x007F, |
| 378 |
|
0xD800..0xDFFF, 0xFDD0..0xFDDF, ## ISSUE: 0xFDEF |
| 379 |
|
0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, |
| 380 |
|
0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, |
| 381 |
|
0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, |
| 382 |
|
0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, |
| 383 |
|
0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, 0x10FFFF; |
| 384 |
|
|
| 385 |
|
## TODO: Invoke the reset algorithm when a resettable element is |
| 386 |
|
## created (cf. HTML5 revision 2259). |
| 387 |
|
|
| 388 |
sub parse_byte_string ($$$$;$) { |
sub parse_byte_string ($$$$;$) { |
| 389 |
my $self = shift; |
my $self = shift; |
| 428 |
## TODO: Is this ok? Transfer protocol's parameter should be |
## TODO: Is this ok? Transfer protocol's parameter should be |
| 429 |
## interpreted in its semantics? |
## interpreted in its semantics? |
| 430 |
|
|
|
## ISSUE: Unsupported encoding is not ignored according to the spec. |
|
| 431 |
($char_stream, $e_status) = $charset->get_decode_handle |
($char_stream, $e_status) = $charset->get_decode_handle |
| 432 |
($byte_stream, allow_error_reporting => 1, |
($byte_stream, allow_error_reporting => 1, |
| 433 |
allow_fallback => 1); |
allow_fallback => 1); |
| 435 |
$self->{confident} = 1; |
$self->{confident} = 1; |
| 436 |
last SNIFFING; |
last SNIFFING; |
| 437 |
} else { |
} else { |
| 438 |
## TODO: unsupported error |
!!!parse-error (type => 'charset:not supported', |
| 439 |
|
layer => 'encode', |
| 440 |
|
line => 1, column => 1, |
| 441 |
|
value => $charset_name, |
| 442 |
|
level => $self->{level}->{uncertain}); |
| 443 |
} |
} |
| 444 |
} |
} |
| 445 |
|
|
| 488 |
if (defined $charset_name) { |
if (defined $charset_name) { |
| 489 |
$charset = Message::Charset::Info->get_by_html_name ($charset_name); |
$charset = Message::Charset::Info->get_by_html_name ($charset_name); |
| 490 |
|
|
|
## ISSUE: Unsupported encoding is not ignored according to the spec. |
|
| 491 |
require Whatpm::Charset::DecodeHandle; |
require Whatpm::Charset::DecodeHandle; |
| 492 |
$buffer = Whatpm::Charset::DecodeHandle::ByteBuffer->new |
$buffer = Whatpm::Charset::DecodeHandle::ByteBuffer->new |
| 493 |
($byte_stream); |
($byte_stream); |
| 882 |
sub MD_HYPHEN_STATE () { 36 } # "markup declaration open state" in the spec |
sub MD_HYPHEN_STATE () { 36 } # "markup declaration open state" in the spec |
| 883 |
sub MD_DOCTYPE_STATE () { 37 } # "markup declaration open state" in the spec |
sub MD_DOCTYPE_STATE () { 37 } # "markup declaration open state" in the spec |
| 884 |
sub MD_CDATA_STATE () { 38 } # "markup declaration open state" in the spec |
sub MD_CDATA_STATE () { 38 } # "markup declaration open state" in the spec |
| 885 |
sub CDATA_PCDATA_CLOSE_TAG_STATE () { 39 } # "close tag open state" in the spec |
sub CDATA_RCDATA_CLOSE_TAG_STATE () { 39 } # "close tag open state" in the spec |
| 886 |
sub CDATA_SECTION_MSE1_STATE () { 40 } # "CDATA section state" in the spec |
sub CDATA_SECTION_MSE1_STATE () { 40 } # "CDATA section state" in the spec |
| 887 |
sub CDATA_SECTION_MSE2_STATE () { 41 } # "CDATA section state" in the spec |
sub CDATA_SECTION_MSE2_STATE () { 41 } # "CDATA section state" in the spec |
| 888 |
sub PUBLIC_STATE () { 42 } # "after DOCTYPE name state" in the spec |
sub PUBLIC_STATE () { 42 } # "after DOCTYPE name state" in the spec |
| 896 |
sub HEXREF_X_STATE () { 47 } |
sub HEXREF_X_STATE () { 47 } |
| 897 |
sub HEXREF_HEX_STATE () { 48 } |
sub HEXREF_HEX_STATE () { 48 } |
| 898 |
sub ENTITY_NAME_STATE () { 49 } |
sub ENTITY_NAME_STATE () { 49 } |
| 899 |
|
sub PCDATA_STATE () { 50 } # "data state" in the spec |
| 900 |
|
|
| 901 |
sub DOCTYPE_TOKEN () { 1 } |
sub DOCTYPE_TOKEN () { 1 } |
| 902 |
sub COMMENT_TOKEN () { 2 } |
sub COMMENT_TOKEN () { 2 } |
| 995 |
## TODO: Polytheistic slash SHOULD NOT be used. (Applied only to atheists.) |
## TODO: Polytheistic slash SHOULD NOT be used. (Applied only to atheists.) |
| 996 |
## (This requirement was dropped from HTML5 spec, unfortunately.) |
## (This requirement was dropped from HTML5 spec, unfortunately.) |
| 997 |
|
|
| 998 |
|
my $is_space = { |
| 999 |
|
0x0009 => 1, # CHARACTER TABULATION (HT) |
| 1000 |
|
0x000A => 1, # LINE FEED (LF) |
| 1001 |
|
#0x000B => 0, # LINE TABULATION (VT) |
| 1002 |
|
0x000C => 1, # FORM FEED (FF) |
| 1003 |
|
#0x000D => 1, # CARRIAGE RETURN (CR) |
| 1004 |
|
0x0020 => 1, # SPACE (SP) |
| 1005 |
|
}; |
| 1006 |
|
|
| 1007 |
sub _get_next_token ($) { |
sub _get_next_token ($) { |
| 1008 |
my $self = shift; |
my $self = shift; |
| 1009 |
|
|
| 1021 |
} |
} |
| 1022 |
|
|
| 1023 |
A: { |
A: { |
| 1024 |
if ($self->{state} == DATA_STATE) { |
if ($self->{state} == PCDATA_STATE) { |
| 1025 |
|
## NOTE: Same as |DATA_STATE|, but only for |PCDATA| content model. |
| 1026 |
|
|
| 1027 |
|
if ($self->{nc} == 0x0026) { # & |
| 1028 |
|
!!!cp (0.1); |
| 1029 |
|
## NOTE: In the spec, the tokenizer is switched to the |
| 1030 |
|
## "entity data state". In this implementation, the tokenizer |
| 1031 |
|
## is switched to the |ENTITY_STATE|, which is an implementation |
| 1032 |
|
## of the "consume a character reference" algorithm. |
| 1033 |
|
$self->{entity_add} = -1; |
| 1034 |
|
$self->{prev_state} = DATA_STATE; |
| 1035 |
|
$self->{state} = ENTITY_STATE; |
| 1036 |
|
!!!next-input-character; |
| 1037 |
|
redo A; |
| 1038 |
|
} elsif ($self->{nc} == 0x003C) { # < |
| 1039 |
|
!!!cp (0.2); |
| 1040 |
|
$self->{state} = TAG_OPEN_STATE; |
| 1041 |
|
!!!next-input-character; |
| 1042 |
|
redo A; |
| 1043 |
|
} elsif ($self->{nc} == -1) { |
| 1044 |
|
!!!cp (0.3); |
| 1045 |
|
!!!emit ({type => END_OF_FILE_TOKEN, |
| 1046 |
|
line => $self->{line}, column => $self->{column}}); |
| 1047 |
|
last A; ## TODO: ok? |
| 1048 |
|
} else { |
| 1049 |
|
!!!cp (0.4); |
| 1050 |
|
# |
| 1051 |
|
} |
| 1052 |
|
|
| 1053 |
|
# Anything else |
| 1054 |
|
my $token = {type => CHARACTER_TOKEN, |
| 1055 |
|
data => chr $self->{nc}, |
| 1056 |
|
line => $self->{line}, column => $self->{column}, |
| 1057 |
|
}; |
| 1058 |
|
$self->{read_until}->($token->{data}, q[<&], length $token->{data}); |
| 1059 |
|
|
| 1060 |
|
## Stay in the state. |
| 1061 |
|
!!!next-input-character; |
| 1062 |
|
!!!emit ($token); |
| 1063 |
|
redo A; |
| 1064 |
|
} elsif ($self->{state} == DATA_STATE) { |
| 1065 |
|
$self->{s_kwd} = '' unless defined $self->{s_kwd}; |
| 1066 |
if ($self->{nc} == 0x0026) { # & |
if ($self->{nc} == 0x0026) { # & |
| 1067 |
delete $self->{s_kwd}; |
$self->{s_kwd} = ''; |
| 1068 |
if ($self->{content_model} & CM_ENTITY and # PCDATA | RCDATA |
if ($self->{content_model} & CM_ENTITY and # PCDATA | RCDATA |
| 1069 |
not $self->{escape}) { |
not $self->{escape}) { |
| 1070 |
!!!cp (1); |
!!!cp (1); |
| 1083 |
} |
} |
| 1084 |
} elsif ($self->{nc} == 0x002D) { # - |
} elsif ($self->{nc} == 0x002D) { # - |
| 1085 |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
| 1086 |
if (defined $self->{s_kwd}) { |
$self->{s_kwd} .= '-'; |
| 1087 |
!!!cp (2.1); |
|
|
$self->{s_kwd} .= '-'; |
|
|
} else { |
|
|
!!!cp (2.2); |
|
|
$self->{s_kwd} = '-'; |
|
|
} |
|
|
|
|
| 1088 |
if ($self->{s_kwd} eq '<!--') { |
if ($self->{s_kwd} eq '<!--') { |
| 1089 |
!!!cp (3); |
!!!cp (3); |
| 1090 |
$self->{escape} = 1; # unless $self->{escape}; |
$self->{escape} = 1; # unless $self->{escape}; |
| 1102 |
|
|
| 1103 |
# |
# |
| 1104 |
} elsif ($self->{nc} == 0x0021) { # ! |
} elsif ($self->{nc} == 0x0021) { # ! |
| 1105 |
if (defined $self->{s_kwd}) { |
if (length $self->{s_kwd}) { |
| 1106 |
!!!cp (5.1); |
!!!cp (5.1); |
| 1107 |
$self->{s_kwd} .= '!'; |
$self->{s_kwd} .= '!'; |
| 1108 |
# |
# |
| 1109 |
} else { |
} else { |
| 1110 |
!!!cp (5.2); |
!!!cp (5.2); |
| 1111 |
|
#$self->{s_kwd} = ''; |
| 1112 |
# |
# |
| 1113 |
} |
} |
| 1114 |
# |
# |
| 1115 |
} elsif ($self->{nc} == 0x003C) { # < |
} elsif ($self->{nc} == 0x003C) { # < |
|
delete $self->{s_kwd}; |
|
| 1116 |
if ($self->{content_model} & CM_FULL_MARKUP or # PCDATA |
if ($self->{content_model} & CM_FULL_MARKUP or # PCDATA |
| 1117 |
(($self->{content_model} & CM_LIMITED_MARKUP) and # CDATA | RCDATA |
(($self->{content_model} & CM_LIMITED_MARKUP) and # CDATA | RCDATA |
| 1118 |
not $self->{escape})) { |
not $self->{escape})) { |
| 1122 |
redo A; |
redo A; |
| 1123 |
} else { |
} else { |
| 1124 |
!!!cp (7); |
!!!cp (7); |
| 1125 |
|
$self->{s_kwd} = ''; |
| 1126 |
# |
# |
| 1127 |
} |
} |
| 1128 |
} elsif ($self->{nc} == 0x003E) { # > |
} elsif ($self->{nc} == 0x003E) { # > |
| 1129 |
if ($self->{escape} and |
if ($self->{escape} and |
| 1130 |
($self->{content_model} & CM_LIMITED_MARKUP)) { # RCDATA | CDATA |
($self->{content_model} & CM_LIMITED_MARKUP)) { # RCDATA | CDATA |
| 1131 |
if (defined $self->{s_kwd} and $self->{s_kwd} eq '--') { |
if ($self->{s_kwd} eq '--') { |
| 1132 |
!!!cp (8); |
!!!cp (8); |
| 1133 |
delete $self->{escape}; |
delete $self->{escape}; |
| 1134 |
} else { |
} else { |
| 1138 |
!!!cp (10); |
!!!cp (10); |
| 1139 |
} |
} |
| 1140 |
|
|
| 1141 |
delete $self->{s_kwd}; |
$self->{s_kwd} = ''; |
| 1142 |
# |
# |
| 1143 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
| 1144 |
!!!cp (11); |
!!!cp (11); |
| 1145 |
delete $self->{s_kwd}; |
$self->{s_kwd} = ''; |
| 1146 |
!!!emit ({type => END_OF_FILE_TOKEN, |
!!!emit ({type => END_OF_FILE_TOKEN, |
| 1147 |
line => $self->{line}, column => $self->{column}}); |
line => $self->{line}, column => $self->{column}}); |
| 1148 |
last A; ## TODO: ok? |
last A; ## TODO: ok? |
| 1149 |
} else { |
} else { |
| 1150 |
!!!cp (12); |
!!!cp (12); |
| 1151 |
delete $self->{s_kwd}; |
$self->{s_kwd} = ''; |
| 1152 |
# |
# |
| 1153 |
} |
} |
| 1154 |
|
|
| 1159 |
}; |
}; |
| 1160 |
if ($self->{read_until}->($token->{data}, q[-!<>&], |
if ($self->{read_until}->($token->{data}, q[-!<>&], |
| 1161 |
length $token->{data})) { |
length $token->{data})) { |
| 1162 |
delete $self->{s_kwd}; |
$self->{s_kwd} = ''; |
| 1163 |
} |
} |
| 1164 |
|
|
| 1165 |
## Stay in the data state |
## Stay in the data state. |
| 1166 |
|
if ($self->{content_model} == PCDATA_CONTENT_MODEL) { |
| 1167 |
|
!!!cp (13); |
| 1168 |
|
$self->{state} = PCDATA_STATE; |
| 1169 |
|
} else { |
| 1170 |
|
!!!cp (14); |
| 1171 |
|
## Stay in the state. |
| 1172 |
|
} |
| 1173 |
!!!next-input-character; |
!!!next-input-character; |
| 1174 |
!!!emit ($token); |
!!!emit ($token); |
| 1175 |
redo A; |
redo A; |
| 1274 |
} |
} |
| 1275 |
} elsif ($self->{state} == CLOSE_TAG_OPEN_STATE) { |
} elsif ($self->{state} == CLOSE_TAG_OPEN_STATE) { |
| 1276 |
## NOTE: The "close tag open state" in the spec is implemented as |
## NOTE: The "close tag open state" in the spec is implemented as |
| 1277 |
## |CLOSE_TAG_OPEN_STATE| and |CDATA_PCDATA_CLOSE_TAG_STATE|. |
## |CLOSE_TAG_OPEN_STATE| and |CDATA_RCDATA_CLOSE_TAG_STATE|. |
| 1278 |
|
|
| 1279 |
my ($l, $c) = ($self->{line_prev}, $self->{column_prev} - 1); # "<"of"</" |
my ($l, $c) = ($self->{line_prev}, $self->{column_prev} - 1); # "<"of"</" |
| 1280 |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
| 1281 |
if (defined $self->{last_stag_name}) { |
if (defined $self->{last_stag_name}) { |
| 1282 |
$self->{state} = CDATA_PCDATA_CLOSE_TAG_STATE; |
$self->{state} = CDATA_RCDATA_CLOSE_TAG_STATE; |
| 1283 |
$self->{s_kwd} = ''; |
$self->{s_kwd} = ''; |
| 1284 |
## Reconsume. |
## Reconsume. |
| 1285 |
redo A; |
redo A; |
| 1350 |
## "bogus comment state" entry. |
## "bogus comment state" entry. |
| 1351 |
redo A; |
redo A; |
| 1352 |
} |
} |
| 1353 |
} elsif ($self->{state} == CDATA_PCDATA_CLOSE_TAG_STATE) { |
} elsif ($self->{state} == CDATA_RCDATA_CLOSE_TAG_STATE) { |
| 1354 |
my $ch = substr $self->{last_stag_name}, length $self->{s_kwd}, 1; |
my $ch = substr $self->{last_stag_name}, length $self->{s_kwd}, 1; |
| 1355 |
if (length $ch) { |
if (length $ch) { |
| 1356 |
my $CH = $ch; |
my $CH = $ch; |
| 1374 |
redo A; |
redo A; |
| 1375 |
} |
} |
| 1376 |
} else { # after "<{tag-name}" |
} else { # after "<{tag-name}" |
| 1377 |
unless ({ |
unless ($is_space->{$self->{nc}} or |
| 1378 |
0x0009 => 1, # HT |
{ |
|
0x000A => 1, # LF |
|
|
0x000B => 1, # VT |
|
|
0x000C => 1, # FF |
|
|
0x0020 => 1, # SP |
|
| 1379 |
0x003E => 1, # > |
0x003E => 1, # > |
| 1380 |
0x002F => 1, # / |
0x002F => 1, # / |
| 1381 |
-1 => 1, # EOF |
-1 => 1, # EOF |
| 1402 |
} |
} |
| 1403 |
} |
} |
| 1404 |
} elsif ($self->{state} == TAG_NAME_STATE) { |
} elsif ($self->{state} == TAG_NAME_STATE) { |
| 1405 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1406 |
!!!cp (34); |
!!!cp (34); |
| 1407 |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
| 1408 |
!!!next-input-character; |
!!!next-input-character; |
| 1474 |
redo A; |
redo A; |
| 1475 |
} |
} |
| 1476 |
} elsif ($self->{state} == BEFORE_ATTRIBUTE_NAME_STATE) { |
} elsif ($self->{state} == BEFORE_ATTRIBUTE_NAME_STATE) { |
| 1477 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1478 |
!!!cp (45); |
!!!cp (45); |
| 1479 |
## Stay in the state |
## Stay in the state |
| 1480 |
!!!next-input-character; |
!!!next-input-character; |
| 1570 |
} |
} |
| 1571 |
}; # $before_leave |
}; # $before_leave |
| 1572 |
|
|
| 1573 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1574 |
!!!cp (59); |
!!!cp (59); |
| 1575 |
$before_leave->(); |
$before_leave->(); |
| 1576 |
$self->{state} = AFTER_ATTRIBUTE_NAME_STATE; |
$self->{state} = AFTER_ATTRIBUTE_NAME_STATE; |
| 1653 |
redo A; |
redo A; |
| 1654 |
} |
} |
| 1655 |
} elsif ($self->{state} == AFTER_ATTRIBUTE_NAME_STATE) { |
} elsif ($self->{state} == AFTER_ATTRIBUTE_NAME_STATE) { |
| 1656 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1657 |
!!!cp (71); |
!!!cp (71); |
| 1658 |
## Stay in the state |
## Stay in the state |
| 1659 |
!!!next-input-character; |
!!!next-input-character; |
| 1740 |
redo A; |
redo A; |
| 1741 |
} |
} |
| 1742 |
} elsif ($self->{state} == BEFORE_ATTRIBUTE_VALUE_STATE) { |
} elsif ($self->{state} == BEFORE_ATTRIBUTE_VALUE_STATE) { |
| 1743 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1744 |
!!!cp (83); |
!!!cp (83); |
| 1745 |
## Stay in the state |
## Stay in the state |
| 1746 |
!!!next-input-character; |
!!!next-input-character; |
| 1921 |
redo A; |
redo A; |
| 1922 |
} |
} |
| 1923 |
} elsif ($self->{state} == ATTRIBUTE_VALUE_UNQUOTED_STATE) { |
} elsif ($self->{state} == ATTRIBUTE_VALUE_UNQUOTED_STATE) { |
| 1924 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # HT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 1925 |
!!!cp (107); |
!!!cp (107); |
| 1926 |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
| 1927 |
!!!next-input-character; |
!!!next-input-character; |
| 2003 |
redo A; |
redo A; |
| 2004 |
} |
} |
| 2005 |
} elsif ($self->{state} == AFTER_ATTRIBUTE_VALUE_QUOTED_STATE) { |
} elsif ($self->{state} == AFTER_ATTRIBUTE_VALUE_QUOTED_STATE) { |
| 2006 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 2007 |
!!!cp (118); |
!!!cp (118); |
| 2008 |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
$self->{state} = BEFORE_ATTRIBUTE_NAME_STATE; |
| 2009 |
!!!next-input-character; |
!!!next-input-character; |
| 2444 |
redo A; |
redo A; |
| 2445 |
} |
} |
| 2446 |
} elsif ($self->{state} == DOCTYPE_STATE) { |
} elsif ($self->{state} == DOCTYPE_STATE) { |
| 2447 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 2448 |
!!!cp (155); |
!!!cp (155); |
| 2449 |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
| 2450 |
!!!next-input-character; |
!!!next-input-character; |
| 2457 |
redo A; |
redo A; |
| 2458 |
} |
} |
| 2459 |
} elsif ($self->{state} == BEFORE_DOCTYPE_NAME_STATE) { |
} elsif ($self->{state} == BEFORE_DOCTYPE_NAME_STATE) { |
| 2460 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 2461 |
!!!cp (157); |
!!!cp (157); |
| 2462 |
## Stay in the state |
## Stay in the state |
| 2463 |
!!!next-input-character; |
!!!next-input-character; |
| 2484 |
!!!cp (160); |
!!!cp (160); |
| 2485 |
$self->{ct}->{name} = chr $self->{nc}; |
$self->{ct}->{name} = chr $self->{nc}; |
| 2486 |
delete $self->{ct}->{quirks}; |
delete $self->{ct}->{quirks}; |
|
## ISSUE: "Set the token's name name to the" in the spec |
|
| 2487 |
$self->{state} = DOCTYPE_NAME_STATE; |
$self->{state} = DOCTYPE_NAME_STATE; |
| 2488 |
!!!next-input-character; |
!!!next-input-character; |
| 2489 |
redo A; |
redo A; |
| 2490 |
} |
} |
| 2491 |
} elsif ($self->{state} == DOCTYPE_NAME_STATE) { |
} elsif ($self->{state} == DOCTYPE_NAME_STATE) { |
| 2492 |
## ISSUE: Redundant "First," in the spec. |
## ISSUE: Redundant "First," in the spec. |
| 2493 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 2494 |
!!!cp (161); |
!!!cp (161); |
| 2495 |
$self->{state} = AFTER_DOCTYPE_NAME_STATE; |
$self->{state} = AFTER_DOCTYPE_NAME_STATE; |
| 2496 |
!!!next-input-character; |
!!!next-input-character; |
| 2522 |
redo A; |
redo A; |
| 2523 |
} |
} |
| 2524 |
} elsif ($self->{state} == AFTER_DOCTYPE_NAME_STATE) { |
} elsif ($self->{state} == AFTER_DOCTYPE_NAME_STATE) { |
| 2525 |
if ($self->{nc} == 0x0009 or # HT |
if ($is_space->{$self->{nc}}) { |
|
$self->{nc} == 0x000A or # LF |
|
|
$self->{nc} == 0x000B or # VT |
|
|
$self->{nc} == 0x000C or # FF |
|
|
$self->{nc} == 0x0020) { # SP |
|
| 2526 |
!!!cp (165); |
!!!cp (165); |
| 2527 |
## Stay in the state |
## Stay in the state |
| 2528 |
!!!next-input-character; |
!!!next-input-character; |
| 2645 |
redo A; |
redo A; |
| 2646 |
} |
} |
| 2647 |
} elsif ($self->{state} == BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE) { |
} elsif ($self->{state} == BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE) { |
| 2648 |
if ({ |
if ($is_space->{$self->{nc}}) { |
|
0x0009 => 1, 0x000A => 1, 0x000B => 1, 0x000C => 1, 0x0020 => 1, |
|
|
#0x000D => 1, # HT, LF, VT, FF, SP, CR |
|
|
}->{$self->{nc}}) { |
|
| 2649 |
!!!cp (181); |
!!!cp (181); |
| 2650 |
## Stay in the state |
## Stay in the state |
| 2651 |
!!!next-input-character; |
!!!next-input-character; |
| 2772 |
redo A; |
redo A; |
| 2773 |
} |
} |
| 2774 |
} elsif ($self->{state} == AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE) { |
} elsif ($self->{state} == AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE) { |
| 2775 |
if ({ |
if ($is_space->{$self->{nc}}) { |
|
0x0009 => 1, 0x000A => 1, 0x000B => 1, 0x000C => 1, 0x0020 => 1, |
|
|
#0x000D => 1, # HT, LF, VT, FF, SP, CR |
|
|
}->{$self->{nc}}) { |
|
| 2776 |
!!!cp (195); |
!!!cp (195); |
| 2777 |
## Stay in the state |
## Stay in the state |
| 2778 |
!!!next-input-character; |
!!!next-input-character; |
| 2818 |
redo A; |
redo A; |
| 2819 |
} |
} |
| 2820 |
} elsif ($self->{state} == BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
} elsif ($self->{state} == BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
| 2821 |
if ({ |
if ($is_space->{$self->{nc}}) { |
|
0x0009 => 1, 0x000A => 1, 0x000B => 1, 0x000C => 1, 0x0020 => 1, |
|
|
#0x000D => 1, # HT, LF, VT, FF, SP, CR |
|
|
}->{$self->{nc}}) { |
|
| 2822 |
!!!cp (201); |
!!!cp (201); |
| 2823 |
## Stay in the state |
## Stay in the state |
| 2824 |
!!!next-input-character; |
!!!next-input-character; |
| 2944 |
redo A; |
redo A; |
| 2945 |
} |
} |
| 2946 |
} elsif ($self->{state} == AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
} elsif ($self->{state} == AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
| 2947 |
if ({ |
if ($is_space->{$self->{nc}}) { |
|
0x0009 => 1, 0x000A => 1, 0x000B => 1, 0x000C => 1, 0x0020 => 1, |
|
|
#0x000D => 1, # HT, LF, VT, FF, SP, CR |
|
|
}->{$self->{nc}}) { |
|
| 2948 |
!!!cp (215); |
!!!cp (215); |
| 2949 |
## Stay in the state |
## Stay in the state |
| 2950 |
!!!next-input-character; |
!!!next-input-character; |
| 3076 |
redo A; |
redo A; |
| 3077 |
} |
} |
| 3078 |
} elsif ($self->{state} == ENTITY_STATE) { |
} elsif ($self->{state} == ENTITY_STATE) { |
| 3079 |
if ({ |
if ($is_space->{$self->{nc}} or |
| 3080 |
0x0009 => 1, 0x000A => 1, 0x000B => 1, 0x000C => 1, # HT, LF, VT, FF, |
{ |
| 3081 |
0x0020 => 1, 0x003C => 1, 0x0026 => 1, -1 => 1, # SP, <, & |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
| 3082 |
$self->{entity_add} => 1, |
$self->{entity_add} => 1, |
| 3083 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
| 3084 |
!!!cp (1001); |
!!!cp (1001); |
| 3085 |
## Don't consume |
## Don't consume |
| 3086 |
## No error |
## No error |
| 3199 |
my $code = $self->{s_kwd}; |
my $code = $self->{s_kwd}; |
| 3200 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
| 3201 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
| 3202 |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
if ($charref_map->{$code}) { |
| 3203 |
!!!cp (1015); |
!!!cp (1015); |
| 3204 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3205 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
| 3206 |
line => $l, column => $c); |
line => $l, column => $c); |
| 3207 |
$code = 0xFFFD; |
$code = $charref_map->{$code}; |
| 3208 |
} elsif ($code > 0x10FFFF) { |
} elsif ($code > 0x10FFFF) { |
| 3209 |
!!!cp (1016); |
!!!cp (1016); |
| 3210 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3211 |
text => (sprintf 'U-%08X', $code), |
text => (sprintf 'U-%08X', $code), |
| 3212 |
line => $l, column => $c); |
line => $l, column => $c); |
| 3213 |
$code = 0xFFFD; |
$code = 0xFFFD; |
|
} elsif ($code == 0x000D) { |
|
|
!!!cp (1017); |
|
|
!!!parse-error (type => 'CR character reference', |
|
|
line => $l, column => $c); |
|
|
$code = 0x000A; |
|
|
} elsif (0x80 <= $code and $code <= 0x9F) { |
|
|
!!!cp (1018); |
|
|
!!!parse-error (type => 'C1 character reference', |
|
|
text => (sprintf 'U+%04X', $code), |
|
|
line => $l, column => $c); |
|
|
$code = $c1_entity_char->{$code}; |
|
| 3214 |
} |
} |
| 3215 |
|
|
| 3216 |
if ($self->{prev_state} == DATA_STATE) { |
if ($self->{prev_state} == DATA_STATE) { |
| 3307 |
my $code = $self->{s_kwd}; |
my $code = $self->{s_kwd}; |
| 3308 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
| 3309 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
| 3310 |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
if ($charref_map->{$code}) { |
| 3311 |
!!!cp (1008); |
!!!cp (1008); |
| 3312 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3313 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
| 3314 |
line => $l, column => $c); |
line => $l, column => $c); |
| 3315 |
$code = 0xFFFD; |
$code = $charref_map->{$code}; |
| 3316 |
} elsif ($code > 0x10FFFF) { |
} elsif ($code > 0x10FFFF) { |
| 3317 |
!!!cp (1009); |
!!!cp (1009); |
| 3318 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3319 |
text => (sprintf 'U-%08X', $code), |
text => (sprintf 'U-%08X', $code), |
| 3320 |
line => $l, column => $c); |
line => $l, column => $c); |
| 3321 |
$code = 0xFFFD; |
$code = 0xFFFD; |
|
} elsif ($code == 0x000D) { |
|
|
!!!cp (1010); |
|
|
!!!parse-error (type => 'CR character reference', line => $l, column => $c); |
|
|
$code = 0x000A; |
|
|
} elsif (0x80 <= $code and $code <= 0x9F) { |
|
|
!!!cp (1011); |
|
|
!!!parse-error (type => 'C1 character reference', text => (sprintf 'U+%04X', $code), line => $l, column => $c); |
|
|
$code = $c1_entity_char->{$code}; |
|
| 3322 |
} |
} |
| 3323 |
|
|
| 3324 |
if ($self->{prev_state} == DATA_STATE) { |
if ($self->{prev_state} == DATA_STATE) { |
| 3659 |
!!!ack-later; |
!!!ack-later; |
| 3660 |
return; |
return; |
| 3661 |
} elsif ($token->{type} == CHARACTER_TOKEN) { |
} elsif ($token->{type} == CHARACTER_TOKEN) { |
| 3662 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { # \x0D |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 3663 |
## Ignore the token |
## Ignore the token |
| 3664 |
|
|
| 3665 |
unless (length $token->{data}) { |
unless (length $token->{data}) { |
| 3716 |
!!!next-token; |
!!!next-token; |
| 3717 |
redo B; |
redo B; |
| 3718 |
} elsif ($token->{type} == CHARACTER_TOKEN) { |
} elsif ($token->{type} == CHARACTER_TOKEN) { |
| 3719 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { # \x0D |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 3720 |
## Ignore the token. |
## Ignore the token. |
| 3721 |
|
|
| 3722 |
unless (length $token->{data}) { |
unless (length $token->{data}) { |
| 3783 |
## NOTE: Reprocess the token. |
## NOTE: Reprocess the token. |
| 3784 |
!!!ack-later; |
!!!ack-later; |
| 3785 |
return; ## Go to the "before head" insertion mode. |
return; ## Go to the "before head" insertion mode. |
|
|
|
|
## ISSUE: There is an issue in the spec |
|
| 3786 |
} # B |
} # B |
| 3787 |
|
|
| 3788 |
die "$0: _tree_construction_root_element: This should never be reached"; |
die "$0: _tree_construction_root_element: This should never be reached"; |
| 4518 |
pop @{$self->{open_elements}} |
pop @{$self->{open_elements}} |
| 4519 |
while $self->{open_elements}->[-1]->[1] & FOREIGN_EL; |
while $self->{open_elements}->[-1]->[1] & FOREIGN_EL; |
| 4520 |
|
|
| 4521 |
|
## NOTE: |<span><svg>| ... two parse errors, |<svg>| ... a parse error. |
| 4522 |
|
|
| 4523 |
$self->{insertion_mode} &= ~ IN_FOREIGN_CONTENT_IM; |
$self->{insertion_mode} &= ~ IN_FOREIGN_CONTENT_IM; |
| 4524 |
## Reprocess. |
## Reprocess. |
| 4525 |
next B; |
next B; |
| 4530 |
|
|
| 4531 |
if ($self->{insertion_mode} & HEAD_IMS) { |
if ($self->{insertion_mode} & HEAD_IMS) { |
| 4532 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 4533 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 4534 |
unless ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
unless ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 4535 |
!!!cp ('t88.2'); |
!!!cp ('t88.2'); |
| 4536 |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
| 4655 |
!!!cp ('t101'); |
!!!cp ('t101'); |
| 4656 |
} |
} |
| 4657 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4658 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 4659 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 4660 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4661 |
!!!nack ('t101.1'); |
!!!nack ('t101.1'); |
| 4662 |
!!!next-token; |
!!!next-token; |
| 4663 |
next B; |
next B; |
| 4664 |
} elsif ($token->{tag_name} eq 'link') { |
} elsif ($token->{tag_name} eq 'link') { |
| 4665 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4666 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4667 |
!!!cp ('t102'); |
!!!cp ('t102'); |
| 4668 |
!!!parse-error (type => 'after head', |
!!!parse-error (type => 'after head', |
| 4669 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 4670 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4671 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4672 |
} else { |
} else { |
| 4673 |
!!!cp ('t103'); |
!!!cp ('t103'); |
| 4674 |
} |
} |
| 4675 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4676 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 4677 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 4678 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4679 |
!!!ack ('t103.1'); |
!!!ack ('t103.1'); |
| 4680 |
!!!next-token; |
!!!next-token; |
| 4681 |
next B; |
next B; |
| 4682 |
|
} elsif ($token->{tag_name} eq 'command' or |
| 4683 |
|
$token->{tag_name} eq 'eventsource') { |
| 4684 |
|
if ($self->{insertion_mode} == IN_HEAD_IM) { |
| 4685 |
|
## NOTE: If the insertion mode at the time of the emission |
| 4686 |
|
## of the token was "before head", $self->{insertion_mode} |
| 4687 |
|
## is already changed to |IN_HEAD_IM|. |
| 4688 |
|
|
| 4689 |
|
## NOTE: There is a "as if in head" code clone. |
| 4690 |
|
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4691 |
|
pop @{$self->{open_elements}}; |
| 4692 |
|
pop @{$self->{open_elements}} # <head> |
| 4693 |
|
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4694 |
|
!!!ack ('t103.2'); |
| 4695 |
|
!!!next-token; |
| 4696 |
|
next B; |
| 4697 |
|
} else { |
| 4698 |
|
## NOTE: "in head noscript" or "after head" insertion mode |
| 4699 |
|
## - in these cases, these tags are treated as same as |
| 4700 |
|
## normal in-body tags. |
| 4701 |
|
!!!cp ('t103.3'); |
| 4702 |
|
# |
| 4703 |
|
} |
| 4704 |
} elsif ($token->{tag_name} eq 'meta') { |
} elsif ($token->{tag_name} eq 'meta') { |
| 4705 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4706 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4713 |
!!!cp ('t105'); |
!!!cp ('t105'); |
| 4714 |
} |
} |
| 4715 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4716 |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
my $meta_el = pop @{$self->{open_elements}}; |
| 4717 |
|
|
| 4718 |
unless ($self->{confident}) { |
unless ($self->{confident}) { |
| 4719 |
if ($token->{attributes}->{charset}) { |
if ($token->{attributes}->{charset}) { |
| 4731 |
} elsif ($token->{attributes}->{content}) { |
} elsif ($token->{attributes}->{content}) { |
| 4732 |
if ($token->{attributes}->{content}->{value} |
if ($token->{attributes}->{content}->{value} |
| 4733 |
=~ /[Cc][Hh][Aa][Rr][Ss][Ee][Tt] |
=~ /[Cc][Hh][Aa][Rr][Ss][Ee][Tt] |
| 4734 |
[\x09-\x0D\x20]*= |
[\x09\x0A\x0C\x0D\x20]*= |
| 4735 |
[\x09-\x0D\x20]*(?>"([^"]*)"|'([^']*)'| |
[\x09\x0A\x0C\x0D\x20]*(?>"([^"]*)"|'([^']*)'| |
| 4736 |
([^"'\x09-\x0D\x20][^\x09-\x0D\x20\x3B]*))/x) { |
([^"'\x09\x0A\x0C\x0D\x20] |
| 4737 |
|
[^\x09\x0A\x0C\x0D\x20\x3B]*))/x) { |
| 4738 |
!!!cp ('t107'); |
!!!cp ('t107'); |
| 4739 |
## NOTE: Whether the encoding is supported or not is handled |
## NOTE: Whether the encoding is supported or not is handled |
| 4740 |
## in the {change_encoding} callback. |
## in the {change_encoding} callback. |
| 5170 |
} else { |
} else { |
| 5171 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 5172 |
} |
} |
|
|
|
|
## ISSUE: An issue in the spec. |
|
| 5173 |
} elsif ($self->{insertion_mode} & BODY_IMS) { |
} elsif ($self->{insertion_mode} & BODY_IMS) { |
| 5174 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 5175 |
!!!cp ('t150'); |
!!!cp ('t150'); |
| 5541 |
} elsif ($self->{insertion_mode} & TABLE_IMS) { |
} elsif ($self->{insertion_mode} & TABLE_IMS) { |
| 5542 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 5543 |
if (not $open_tables->[-1]->[1] and # tainted |
if (not $open_tables->[-1]->[1] and # tainted |
| 5544 |
$token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { |
$token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 5545 |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
| 5546 |
|
|
| 5547 |
unless (length $token->{data}) { |
unless (length $token->{data}) { |
| 6225 |
} |
} |
| 6226 |
} elsif ($self->{insertion_mode} == IN_COLUMN_GROUP_IM) { |
} elsif ($self->{insertion_mode} == IN_COLUMN_GROUP_IM) { |
| 6227 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 6228 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 6229 |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
| 6230 |
unless (length $token->{data}) { |
unless (length $token->{data}) { |
| 6231 |
!!!cp ('t260'); |
!!!cp ('t260'); |
| 6566 |
} |
} |
| 6567 |
} elsif ($self->{insertion_mode} & BODY_AFTER_IMS) { |
} elsif ($self->{insertion_mode} & BODY_AFTER_IMS) { |
| 6568 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 6569 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 6570 |
my $data = $1; |
my $data = $1; |
| 6571 |
## As if in body |
## As if in body |
| 6572 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 6583 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 6584 |
!!!cp ('t301'); |
!!!cp ('t301'); |
| 6585 |
!!!parse-error (type => 'after html:#text', token => $token); |
!!!parse-error (type => 'after html:#text', token => $token); |
| 6586 |
|
# |
|
## Reprocess in the "after body" insertion mode. |
|
| 6587 |
} else { |
} else { |
| 6588 |
!!!cp ('t302'); |
!!!cp ('t302'); |
| 6589 |
|
## "after body" insertion mode |
| 6590 |
|
!!!parse-error (type => 'after body:#text', token => $token); |
| 6591 |
|
# |
| 6592 |
} |
} |
|
|
|
|
## "after body" insertion mode |
|
|
!!!parse-error (type => 'after body:#text', token => $token); |
|
| 6593 |
|
|
| 6594 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6595 |
## reprocess |
## reprocess |
| 6599 |
!!!cp ('t303'); |
!!!cp ('t303'); |
| 6600 |
!!!parse-error (type => 'after html', |
!!!parse-error (type => 'after html', |
| 6601 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 6602 |
|
# |
|
## Reprocess in the "after body" insertion mode. |
|
| 6603 |
} else { |
} else { |
| 6604 |
!!!cp ('t304'); |
!!!cp ('t304'); |
| 6605 |
|
## "after body" insertion mode |
| 6606 |
|
!!!parse-error (type => 'after body', |
| 6607 |
|
text => $token->{tag_name}, token => $token); |
| 6608 |
|
# |
| 6609 |
} |
} |
| 6610 |
|
|
|
## "after body" insertion mode |
|
|
!!!parse-error (type => 'after body', |
|
|
text => $token->{tag_name}, token => $token); |
|
|
|
|
| 6611 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6612 |
!!!ack-later; |
!!!ack-later; |
| 6613 |
## reprocess |
## reprocess |
| 6618 |
!!!parse-error (type => 'after html:/', |
!!!parse-error (type => 'after html:/', |
| 6619 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 6620 |
|
|
| 6621 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6622 |
## Reprocess in the "after body" insertion mode. |
## Reprocess. |
| 6623 |
|
next B; |
| 6624 |
} else { |
} else { |
| 6625 |
!!!cp ('t306'); |
!!!cp ('t306'); |
| 6626 |
} |
} |
| 6658 |
} |
} |
| 6659 |
} elsif ($self->{insertion_mode} & FRAME_IMS) { |
} elsif ($self->{insertion_mode} & FRAME_IMS) { |
| 6660 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 6661 |
if ($token->{data} =~ s/^([\x09\x0A\x0B\x0C\x20]+)//) { |
if ($token->{data} =~ s/^([\x09\x0A\x0C\x20]+)//) { |
| 6662 |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($1); |
| 6663 |
|
|
| 6664 |
unless (length $token->{data}) { |
unless (length $token->{data}) { |
| 6668 |
} |
} |
| 6669 |
} |
} |
| 6670 |
|
|
| 6671 |
if ($token->{data} =~ s/^[^\x09\x0A\x0B\x0C\x20]+//) { |
if ($token->{data} =~ s/^[^\x09\x0A\x0C\x20]+//) { |
| 6672 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6673 |
!!!cp ('t311'); |
!!!cp ('t311'); |
| 6674 |
!!!parse-error (type => 'in frameset:#text', token => $token); |
!!!parse-error (type => 'in frameset:#text', token => $token); |
| 6797 |
} else { |
} else { |
| 6798 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 6799 |
} |
} |
|
|
|
|
## ISSUE: An issue in spec here |
|
| 6800 |
} else { |
} else { |
| 6801 |
die "$0: $self->{insertion_mode}: Unknown insertion mode"; |
die "$0: $self->{insertion_mode}: Unknown insertion mode"; |
| 6802 |
} |
} |
| 6814 |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
| 6815 |
next B; |
next B; |
| 6816 |
} elsif ({ |
} elsif ({ |
| 6817 |
base => 1, link => 1, |
base => 1, command => 1, eventsource => 1, link => 1, |
| 6818 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6819 |
!!!cp ('t334'); |
!!!cp ('t334'); |
| 6820 |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
| 6821 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6822 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 6823 |
!!!ack ('t334.1'); |
!!!ack ('t334.1'); |
| 6824 |
!!!next-token; |
!!!next-token; |
| 6825 |
next B; |
next B; |
| 6826 |
} elsif ($token->{tag_name} eq 'meta') { |
} elsif ($token->{tag_name} eq 'meta') { |
| 6827 |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
| 6828 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6829 |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
my $meta_el = pop @{$self->{open_elements}}; |
| 6830 |
|
|
| 6831 |
unless ($self->{confident}) { |
unless ($self->{confident}) { |
| 6832 |
if ($token->{attributes}->{charset}) { |
if ($token->{attributes}->{charset}) { |
| 6843 |
} elsif ($token->{attributes}->{content}) { |
} elsif ($token->{attributes}->{content}) { |
| 6844 |
if ($token->{attributes}->{content}->{value} |
if ($token->{attributes}->{content}->{value} |
| 6845 |
=~ /[Cc][Hh][Aa][Rr][Ss][Ee][Tt] |
=~ /[Cc][Hh][Aa][Rr][Ss][Ee][Tt] |
| 6846 |
[\x09-\x0D\x20]*= |
[\x09\x0A\x0C\x0D\x20]*= |
| 6847 |
[\x09-\x0D\x20]*(?>"([^"]*)"|'([^']*)'| |
[\x09\x0A\x0C\x0D\x20]*(?>"([^"]*)"|'([^']*)'| |
| 6848 |
([^"'\x09-\x0D\x20][^\x09-\x0D\x20\x3B]*))/x) { |
([^"'\x09\x0A\x0C\x0D\x20][^\x09\x0A\x0C\x0D\x20\x3B]*)) |
| 6849 |
|
/x) { |
| 6850 |
!!!cp ('t336'); |
!!!cp ('t336'); |
| 6851 |
## NOTE: Whether the encoding is supported or not is handled |
## NOTE: Whether the encoding is supported or not is handled |
| 6852 |
## in the {change_encoding} callback. |
## in the {change_encoding} callback. |
| 6905 |
!!!next-token; |
!!!next-token; |
| 6906 |
next B; |
next B; |
| 6907 |
} elsif ({ |
} elsif ({ |
| 6908 |
address => 1, blockquote => 1, center => 1, dir => 1, |
## NOTE: Start tags for non-phrasing flow content elements |
| 6909 |
div => 1, dl => 1, fieldset => 1, |
|
| 6910 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
## NOTE: The normal one |
| 6911 |
menu => 1, ol => 1, p => 1, ul => 1, |
address => 1, article => 1, aside => 1, blockquote => 1, |
| 6912 |
|
center => 1, datagrid => 1, details => 1, dialog => 1, |
| 6913 |
|
dir => 1, div => 1, dl => 1, fieldset => 1, figure => 1, |
| 6914 |
|
footer => 1, h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, |
| 6915 |
|
h6 => 1, header => 1, menu => 1, nav => 1, ol => 1, p => 1, |
| 6916 |
|
section => 1, ul => 1, |
| 6917 |
|
## NOTE: As normal, but drops leading newline |
| 6918 |
pre => 1, listing => 1, |
pre => 1, listing => 1, |
| 6919 |
|
## NOTE: As normal, but interacts with the form element pointer |
| 6920 |
form => 1, |
form => 1, |
| 6921 |
|
|
| 6922 |
table => 1, |
table => 1, |
| 6923 |
hr => 1, |
hr => 1, |
| 6924 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6985 |
!!!next-token; |
!!!next-token; |
| 6986 |
} |
} |
| 6987 |
next B; |
next B; |
| 6988 |
} elsif ({li => 1, dt => 1, dd => 1}->{$token->{tag_name}}) { |
} elsif ($token->{tag_name} eq 'li') { |
| 6989 |
## has a p element in scope |
## NOTE: As normal, but imply </li> when there's another <li> ... |
| 6990 |
|
|
| 6991 |
|
## NOTE: Special, Scope (<li><foo><li> == <li><foo><li/></foo></li>) |
| 6992 |
|
## Interpreted as <li><foo/></li><li/> (non-conforming) |
| 6993 |
|
## blockquote (O9.27), center (O), dd (Fx3, O, S3.1.2, IE7), |
| 6994 |
|
## dt (Fx, O, S, IE), dl (O), fieldset (O, S, IE), form (Fx, O, S), |
| 6995 |
|
## hn (O), pre (O), applet (O, S), button (O, S), marquee (Fx, O, S), |
| 6996 |
|
## object (Fx) |
| 6997 |
|
## Generate non-tree (non-conforming) |
| 6998 |
|
## basefont (IE7 (where basefont is non-void)), center (IE), |
| 6999 |
|
## form (IE), hn (IE) |
| 7000 |
|
## address, div, p (<li><foo><li> == <li><foo/></li><li/>) |
| 7001 |
|
## Interpreted as <li><foo><li/></foo></li> (non-conforming) |
| 7002 |
|
## div (Fx, S) |
| 7003 |
|
|
| 7004 |
|
my $non_optional; |
| 7005 |
|
my $i = -1; |
| 7006 |
|
|
| 7007 |
|
## 1. |
| 7008 |
|
for my $node (reverse @{$self->{open_elements}}) { |
| 7009 |
|
if ($node->[1] & LI_EL) { |
| 7010 |
|
## 2. (a) As if </li> |
| 7011 |
|
{ |
| 7012 |
|
## If no </li> - not applied |
| 7013 |
|
# |
| 7014 |
|
|
| 7015 |
|
## Otherwise |
| 7016 |
|
|
| 7017 |
|
## 1. generate implied end tags, except for </li> |
| 7018 |
|
# |
| 7019 |
|
|
| 7020 |
|
## 2. If current node != "li", parse error |
| 7021 |
|
if ($non_optional) { |
| 7022 |
|
!!!parse-error (type => 'not closed', |
| 7023 |
|
text => $non_optional->[0]->manakai_local_name, |
| 7024 |
|
token => $token); |
| 7025 |
|
!!!cp ('t355'); |
| 7026 |
|
} else { |
| 7027 |
|
!!!cp ('t356'); |
| 7028 |
|
} |
| 7029 |
|
|
| 7030 |
|
## 3. Pop |
| 7031 |
|
splice @{$self->{open_elements}}, $i; |
| 7032 |
|
} |
| 7033 |
|
|
| 7034 |
|
last; ## 2. (b) goto 5. |
| 7035 |
|
} elsif ( |
| 7036 |
|
## NOTE: not "formatting" and not "phrasing" |
| 7037 |
|
($node->[1] & SPECIAL_EL or |
| 7038 |
|
$node->[1] & SCOPING_EL) and |
| 7039 |
|
## NOTE: "li", "dt", and "dd" are in |SPECIAL_EL|. |
| 7040 |
|
|
| 7041 |
|
(not $node->[1] & ADDRESS_EL) & |
| 7042 |
|
(not $node->[1] & DIV_EL) & |
| 7043 |
|
(not $node->[1] & P_EL)) { |
| 7044 |
|
## 3. |
| 7045 |
|
!!!cp ('t357'); |
| 7046 |
|
last; ## goto 5. |
| 7047 |
|
} elsif ($node->[1] & END_TAG_OPTIONAL_EL) { |
| 7048 |
|
!!!cp ('t358'); |
| 7049 |
|
# |
| 7050 |
|
} else { |
| 7051 |
|
!!!cp ('t359'); |
| 7052 |
|
$non_optional ||= $node; |
| 7053 |
|
# |
| 7054 |
|
} |
| 7055 |
|
## 4. |
| 7056 |
|
## goto 2. |
| 7057 |
|
$i--; |
| 7058 |
|
} |
| 7059 |
|
|
| 7060 |
|
## 5. (a) has a |p| element in scope |
| 7061 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 7062 |
if ($_->[1] & P_EL) { |
if ($_->[1] & P_EL) { |
| 7063 |
!!!cp ('t353'); |
!!!cp ('t353'); |
| 7064 |
|
|
| 7065 |
|
## NOTE: |<p><li>|, for example. |
| 7066 |
|
|
| 7067 |
!!!back-token; # <x> |
!!!back-token; # <x> |
| 7068 |
$token = {type => END_TAG_TOKEN, tag_name => 'p', |
$token = {type => END_TAG_TOKEN, tag_name => 'p', |
| 7069 |
line => $token->{line}, column => $token->{column}}; |
line => $token->{line}, column => $token->{column}}; |
| 7073 |
last INSCOPE; |
last INSCOPE; |
| 7074 |
} |
} |
| 7075 |
} # INSCOPE |
} # INSCOPE |
| 7076 |
|
|
| 7077 |
## Step 1 |
## 5. (b) insert |
| 7078 |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 7079 |
|
!!!nack ('t359.1'); |
| 7080 |
|
!!!next-token; |
| 7081 |
|
next B; |
| 7082 |
|
} elsif ($token->{tag_name} eq 'dt' or |
| 7083 |
|
$token->{tag_name} eq 'dd') { |
| 7084 |
|
## NOTE: As normal, but imply </dt> or </dd> when ... |
| 7085 |
|
|
| 7086 |
|
my $non_optional; |
| 7087 |
my $i = -1; |
my $i = -1; |
| 7088 |
my $node = $self->{open_elements}->[$i]; |
|
| 7089 |
my $li_or_dtdd = {li => {li => 1}, |
## 1. |
| 7090 |
dt => {dt => 1, dd => 1}, |
for my $node (reverse @{$self->{open_elements}}) { |
| 7091 |
dd => {dt => 1, dd => 1}}->{$token->{tag_name}}; |
if ($node->[1] & DT_EL or $node->[1] & DD_EL) { |
| 7092 |
LI: { |
## 2. (a) As if </li> |
| 7093 |
## Step 2 |
{ |
| 7094 |
if ($li_or_dtdd->{$node->[0]->manakai_local_name}) { |
## If no </li> - not applied |
| 7095 |
if ($i != -1) { |
# |
| 7096 |
!!!cp ('t355'); |
|
| 7097 |
!!!parse-error (type => 'not closed', |
## Otherwise |
| 7098 |
text => $self->{open_elements}->[-1]->[0] |
|
| 7099 |
->manakai_local_name, |
## 1. generate implied end tags, except for </dt> or </dd> |
| 7100 |
token => $token); |
# |
| 7101 |
} else { |
|
| 7102 |
!!!cp ('t356'); |
## 2. If current node != "dt"|"dd", parse error |
| 7103 |
|
if ($non_optional) { |
| 7104 |
|
!!!parse-error (type => 'not closed', |
| 7105 |
|
text => $non_optional->[0]->manakai_local_name, |
| 7106 |
|
token => $token); |
| 7107 |
|
!!!cp ('t355.1'); |
| 7108 |
|
} else { |
| 7109 |
|
!!!cp ('t356.1'); |
| 7110 |
|
} |
| 7111 |
|
|
| 7112 |
|
## 3. Pop |
| 7113 |
|
splice @{$self->{open_elements}}, $i; |
| 7114 |
} |
} |
| 7115 |
splice @{$self->{open_elements}}, $i; |
|
| 7116 |
last LI; |
last; ## 2. (b) goto 5. |
| 7117 |
|
} elsif ( |
| 7118 |
|
## NOTE: not "formatting" and not "phrasing" |
| 7119 |
|
($node->[1] & SPECIAL_EL or |
| 7120 |
|
$node->[1] & SCOPING_EL) and |
| 7121 |
|
## NOTE: "li", "dt", and "dd" are in |SPECIAL_EL|. |
| 7122 |
|
|
| 7123 |
|
(not $node->[1] & ADDRESS_EL) & |
| 7124 |
|
(not $node->[1] & DIV_EL) & |
| 7125 |
|
(not $node->[1] & P_EL)) { |
| 7126 |
|
## 3. |
| 7127 |
|
!!!cp ('t357.1'); |
| 7128 |
|
last; ## goto 5. |
| 7129 |
|
} elsif ($node->[1] & END_TAG_OPTIONAL_EL) { |
| 7130 |
|
!!!cp ('t358.1'); |
| 7131 |
|
# |
| 7132 |
} else { |
} else { |
| 7133 |
!!!cp ('t357'); |
!!!cp ('t359.1'); |
| 7134 |
} |
$non_optional ||= $node; |
| 7135 |
|
# |
|
## Step 3 |
|
|
if (not ($node->[1] & FORMATTING_EL) and |
|
|
#not $phrasing_category->{$node->[1]} and |
|
|
($node->[1] & SPECIAL_EL or |
|
|
$node->[1] & SCOPING_EL) and |
|
|
not ($node->[1] & ADDRESS_EL) and |
|
|
not ($node->[1] & DIV_EL)) { |
|
|
!!!cp ('t358'); |
|
|
last LI; |
|
| 7136 |
} |
} |
| 7137 |
|
## 4. |
| 7138 |
!!!cp ('t359'); |
## goto 2. |
|
## Step 4 |
|
| 7139 |
$i--; |
$i--; |
| 7140 |
$node = $self->{open_elements}->[$i]; |
} |
| 7141 |
redo LI; |
|
| 7142 |
} # LI |
## 5. (a) has a |p| element in scope |
| 7143 |
|
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 7144 |
|
if ($_->[1] & P_EL) { |
| 7145 |
|
!!!cp ('t353.1'); |
| 7146 |
|
!!!back-token; # <x> |
| 7147 |
|
$token = {type => END_TAG_TOKEN, tag_name => 'p', |
| 7148 |
|
line => $token->{line}, column => $token->{column}}; |
| 7149 |
|
next B; |
| 7150 |
|
} elsif ($_->[1] & SCOPING_EL) { |
| 7151 |
|
!!!cp ('t354.1'); |
| 7152 |
|
last INSCOPE; |
| 7153 |
|
} |
| 7154 |
|
} # INSCOPE |
| 7155 |
|
|
| 7156 |
|
## 5. (b) insert |
| 7157 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 7158 |
!!!nack ('t359.1'); |
!!!nack ('t359.2'); |
| 7159 |
!!!next-token; |
!!!next-token; |
| 7160 |
next B; |
next B; |
| 7161 |
} elsif ($token->{tag_name} eq 'plaintext') { |
} elsif ($token->{tag_name} eq 'plaintext') { |
| 7162 |
|
## NOTE: As normal, but effectively ends parsing |
| 7163 |
|
|
| 7164 |
## has a p element in scope |
## has a p element in scope |
| 7165 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 7166 |
if ($_->[1] & P_EL) { |
if ($_->[1] & P_EL) { |
| 7398 |
} |
} |
| 7399 |
!!!next-token; |
!!!next-token; |
| 7400 |
next B; |
next B; |
| 7401 |
|
} elsif ($token->{tag_name} eq 'optgroup' or |
| 7402 |
|
$token->{tag_name} eq 'option') { |
| 7403 |
|
## has an |option| element in scope |
| 7404 |
|
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 7405 |
|
my $node = $self->{open_elements}->[$_]; |
| 7406 |
|
if ($node->[1] & OPTION_EL) { |
| 7407 |
|
!!!cp ('t397.1'); |
| 7408 |
|
## NOTE: As if </option> |
| 7409 |
|
!!!back-token; # <option> or <optgroup> |
| 7410 |
|
$token = {type => END_TAG_TOKEN, tag_name => 'option', |
| 7411 |
|
line => $token->{line}, column => $token->{column}}; |
| 7412 |
|
next B; |
| 7413 |
|
} elsif ($node->[1] & SCOPING_EL) { |
| 7414 |
|
!!!cp ('t397.2'); |
| 7415 |
|
last INSCOPE; |
| 7416 |
|
} |
| 7417 |
|
} # INSCOPE |
| 7418 |
|
|
| 7419 |
|
$reconstruct_active_formatting_elements->($insert_to_current); |
| 7420 |
|
|
| 7421 |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 7422 |
|
|
| 7423 |
|
!!!nack ('t397.3'); |
| 7424 |
|
!!!next-token; |
| 7425 |
|
redo B; |
| 7426 |
} elsif ($token->{tag_name} eq 'rt' or |
} elsif ($token->{tag_name} eq 'rt' or |
| 7427 |
$token->{tag_name} eq 'rp') { |
$token->{tag_name} eq 'rp') { |
| 7428 |
## has a |ruby| element in scope |
## has a |ruby| element in scope |
| 7470 |
|
|
| 7471 |
if ($self->{self_closing}) { |
if ($self->{self_closing}) { |
| 7472 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7473 |
!!!ack ('t398.1'); |
!!!ack ('t398.6'); |
| 7474 |
} else { |
} else { |
| 7475 |
!!!cp ('t398.2'); |
!!!cp ('t398.7'); |
| 7476 |
$self->{insertion_mode} |= IN_FOREIGN_CONTENT_IM; |
$self->{insertion_mode} |= IN_FOREIGN_CONTENT_IM; |
| 7477 |
## NOTE: |<body><math><mi><svg>| -> "in foreign content" insertion |
## NOTE: |<body><math><mi><svg>| -> "in foreign content" insertion |
| 7478 |
## mode, "in body" (not "in foreign content") secondary insertion |
## mode, "in body" (not "in foreign content") secondary insertion |
| 7483 |
next B; |
next B; |
| 7484 |
} elsif ({ |
} elsif ({ |
| 7485 |
caption => 1, col => 1, colgroup => 1, frame => 1, |
caption => 1, col => 1, colgroup => 1, frame => 1, |
| 7486 |
frameset => 1, head => 1, option => 1, optgroup => 1, |
frameset => 1, head => 1, |
| 7487 |
tbody => 1, td => 1, tfoot => 1, th => 1, |
tbody => 1, td => 1, tfoot => 1, th => 1, |
| 7488 |
thead => 1, tr => 1, |
thead => 1, tr => 1, |
| 7489 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7494 |
!!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error. |
!!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error. |
| 7495 |
!!!next-token; |
!!!next-token; |
| 7496 |
next B; |
next B; |
| 7497 |
|
} elsif ($token->{tag_name} eq 'param' or |
| 7498 |
## ISSUE: An issue on HTML5 new elements in the spec. |
$token->{tag_name} eq 'source') { |
| 7499 |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 7500 |
|
pop @{$self->{open_elements}}; |
| 7501 |
|
|
| 7502 |
|
!!!ack ('t398.5'); |
| 7503 |
|
!!!next-token; |
| 7504 |
|
redo B; |
| 7505 |
} else { |
} else { |
| 7506 |
if ($token->{tag_name} eq 'image') { |
if ($token->{tag_name} eq 'image') { |
| 7507 |
!!!cp ('t384'); |
!!!cp ('t384'); |
| 7524 |
!!!nack ('t380.1'); |
!!!nack ('t380.1'); |
| 7525 |
} elsif ({ |
} elsif ({ |
| 7526 |
b => 1, big => 1, em => 1, font => 1, i => 1, |
b => 1, big => 1, em => 1, font => 1, i => 1, |
| 7527 |
s => 1, small => 1, strile => 1, |
s => 1, small => 1, strike => 1, |
| 7528 |
strong => 1, tt => 1, u => 1, |
strong => 1, tt => 1, u => 1, |
| 7529 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7530 |
!!!cp ('t375'); |
!!!cp ('t375'); |
| 7537 |
!!!ack ('t388.2'); |
!!!ack ('t388.2'); |
| 7538 |
} elsif ({ |
} elsif ({ |
| 7539 |
area => 1, basefont => 1, bgsound => 1, br => 1, |
area => 1, basefont => 1, bgsound => 1, br => 1, |
| 7540 |
embed => 1, img => 1, param => 1, spacer => 1, wbr => 1, |
embed => 1, img => 1, spacer => 1, wbr => 1, |
|
#image => 1, |
|
| 7541 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7542 |
!!!cp ('t388.1'); |
!!!cp ('t388.1'); |
| 7543 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7578 |
} |
} |
| 7579 |
} |
} |
| 7580 |
|
|
| 7581 |
!!!parse-error (type => 'start tag not allowed', |
## NOTE: |<marquee></body>|, |<svg><foreignobject></body>| |
| 7582 |
|
|
| 7583 |
|
!!!parse-error (type => 'unmatched end tag', |
| 7584 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 7585 |
## NOTE: Ignore the token. |
## NOTE: Ignore the token. |
| 7586 |
!!!next-token; |
!!!next-token; |
| 7607 |
## up-to-date, though it has same effect as speced. |
## up-to-date, though it has same effect as speced. |
| 7608 |
if (@{$self->{open_elements}} > 1 and |
if (@{$self->{open_elements}} > 1 and |
| 7609 |
$self->{open_elements}->[1]->[1] & BODY_EL) { |
$self->{open_elements}->[1]->[1] & BODY_EL) { |
|
## ISSUE: There is an issue in the spec. |
|
| 7610 |
unless ($self->{open_elements}->[-1]->[1] & BODY_EL) { |
unless ($self->{open_elements}->[-1]->[1] & BODY_EL) { |
| 7611 |
!!!cp ('t406'); |
!!!cp ('t406'); |
| 7612 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7628 |
next B; |
next B; |
| 7629 |
} |
} |
| 7630 |
} elsif ({ |
} elsif ({ |
| 7631 |
address => 1, blockquote => 1, center => 1, dir => 1, |
## NOTE: End tags for non-phrasing flow content elements |
| 7632 |
div => 1, dl => 1, fieldset => 1, listing => 1, |
|
| 7633 |
menu => 1, ol => 1, pre => 1, ul => 1, |
## NOTE: The normal ones |
| 7634 |
|
address => 1, article => 1, aside => 1, blockquote => 1, |
| 7635 |
|
center => 1, datagrid => 1, details => 1, dialog => 1, |
| 7636 |
|
dir => 1, div => 1, dl => 1, fieldset => 1, figure => 1, |
| 7637 |
|
footer => 1, header => 1, listing => 1, menu => 1, nav => 1, |
| 7638 |
|
ol => 1, pre => 1, section => 1, ul => 1, |
| 7639 |
|
|
| 7640 |
|
## NOTE: As normal, but ... optional tags |
| 7641 |
dd => 1, dt => 1, li => 1, |
dd => 1, dt => 1, li => 1, |
| 7642 |
|
|
| 7643 |
applet => 1, button => 1, marquee => 1, object => 1, |
applet => 1, button => 1, marquee => 1, object => 1, |
| 7644 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7645 |
|
## NOTE: Code for <li> start tags includes "as if </li>" code. |
| 7646 |
|
## Code for <dt> or <dd> start tags includes "as if </dt> or |
| 7647 |
|
## </dd>" code. |
| 7648 |
|
|
| 7649 |
## has an element in scope |
## has an element in scope |
| 7650 |
my $i; |
my $i; |
| 7651 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 7672 |
dd => ($token->{tag_name} ne 'dd'), |
dd => ($token->{tag_name} ne 'dd'), |
| 7673 |
dt => ($token->{tag_name} ne 'dt'), |
dt => ($token->{tag_name} ne 'dt'), |
| 7674 |
li => ($token->{tag_name} ne 'li'), |
li => ($token->{tag_name} ne 'li'), |
| 7675 |
|
option => 1, |
| 7676 |
|
optgroup => 1, |
| 7677 |
p => 1, |
p => 1, |
| 7678 |
rt => 1, |
rt => 1, |
| 7679 |
rp => 1, |
rp => 1, |
| 7706 |
!!!next-token; |
!!!next-token; |
| 7707 |
next B; |
next B; |
| 7708 |
} elsif ($token->{tag_name} eq 'form') { |
} elsif ($token->{tag_name} eq 'form') { |
| 7709 |
|
## NOTE: As normal, but interacts with the form element pointer |
| 7710 |
|
|
| 7711 |
undef $self->{form_element}; |
undef $self->{form_element}; |
| 7712 |
|
|
| 7713 |
## has an element in scope |
## has an element in scope |
| 7755 |
!!!next-token; |
!!!next-token; |
| 7756 |
next B; |
next B; |
| 7757 |
} elsif ({ |
} elsif ({ |
| 7758 |
|
## NOTE: As normal, except acts as a closer for any ... |
| 7759 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
| 7760 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7761 |
## has an element in scope |
## has an element in scope |
| 7801 |
!!!next-token; |
!!!next-token; |
| 7802 |
next B; |
next B; |
| 7803 |
} elsif ($token->{tag_name} eq 'p') { |
} elsif ($token->{tag_name} eq 'p') { |
| 7804 |
|
## NOTE: As normal, except </p> implies <p> and ... |
| 7805 |
|
|
| 7806 |
## has an element in scope |
## has an element in scope |
| 7807 |
|
my $non_optional; |
| 7808 |
my $i; |
my $i; |
| 7809 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 7810 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
| 7815 |
} elsif ($node->[1] & SCOPING_EL) { |
} elsif ($node->[1] & SCOPING_EL) { |
| 7816 |
!!!cp ('t411.1'); |
!!!cp ('t411.1'); |
| 7817 |
last INSCOPE; |
last INSCOPE; |
| 7818 |
|
} elsif ($node->[1] & END_TAG_OPTIONAL_EL) { |
| 7819 |
|
## NOTE: |END_TAG_OPTIONAL_EL| includes "p" |
| 7820 |
|
!!!cp ('t411.2'); |
| 7821 |
|
# |
| 7822 |
|
} else { |
| 7823 |
|
!!!cp ('t411.3'); |
| 7824 |
|
$non_optional ||= $node; |
| 7825 |
|
# |
| 7826 |
} |
} |
| 7827 |
} # INSCOPE |
} # INSCOPE |
| 7828 |
|
|
| 7829 |
if (defined $i) { |
if (defined $i) { |
| 7830 |
if ($self->{open_elements}->[-1]->[0]->manakai_local_name |
## 1. Generate implied end tags |
| 7831 |
ne $token->{tag_name}) { |
# |
| 7832 |
|
|
| 7833 |
|
## 2. If current node != "p", parse error |
| 7834 |
|
if ($non_optional) { |
| 7835 |
!!!cp ('t412.1'); |
!!!cp ('t412.1'); |
| 7836 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7837 |
text => $self->{open_elements}->[-1]->[0] |
text => $non_optional->[0]->manakai_local_name, |
|
->manakai_local_name, |
|
| 7838 |
token => $token); |
token => $token); |
| 7839 |
} else { |
} else { |
| 7840 |
!!!cp ('t414.1'); |
!!!cp ('t414.1'); |
| 7841 |
} |
} |
| 7842 |
|
|
| 7843 |
|
## 3. Pop |
| 7844 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 7845 |
} else { |
} else { |
| 7846 |
!!!cp ('t413.1'); |
!!!cp ('t413.1'); |
| 7860 |
} elsif ({ |
} elsif ({ |
| 7861 |
a => 1, |
a => 1, |
| 7862 |
b => 1, big => 1, em => 1, font => 1, i => 1, |
b => 1, big => 1, em => 1, font => 1, i => 1, |
| 7863 |
nobr => 1, s => 1, small => 1, strile => 1, |
nobr => 1, s => 1, small => 1, strike => 1, |
| 7864 |
strong => 1, tt => 1, u => 1, |
strong => 1, tt => 1, u => 1, |
| 7865 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7866 |
!!!cp ('t427'); |
!!!cp ('t427'); |
| 7881 |
## Ignore the token. |
## Ignore the token. |
| 7882 |
!!!next-token; |
!!!next-token; |
| 7883 |
next B; |
next B; |
|
} elsif ({ |
|
|
caption => 1, col => 1, colgroup => 1, frame => 1, |
|
|
frameset => 1, head => 1, option => 1, optgroup => 1, |
|
|
tbody => 1, td => 1, tfoot => 1, th => 1, |
|
|
thead => 1, tr => 1, |
|
|
area => 1, basefont => 1, bgsound => 1, |
|
|
embed => 1, hr => 1, iframe => 1, image => 1, |
|
|
img => 1, input => 1, isindex => 1, noembed => 1, |
|
|
noframes => 1, param => 1, select => 1, spacer => 1, |
|
|
table => 1, textarea => 1, wbr => 1, |
|
|
noscript => 0, ## TODO: if scripting is enabled |
|
|
}->{$token->{tag_name}}) { |
|
|
!!!cp ('t429'); |
|
|
!!!parse-error (type => 'unmatched end tag', |
|
|
text => $token->{tag_name}, token => $token); |
|
|
## Ignore the token |
|
|
!!!next-token; |
|
|
next B; |
|
|
|
|
|
## ISSUE: Issue on HTML5 new elements in spec |
|
|
|
|
| 7884 |
} else { |
} else { |
| 7885 |
|
if ($token->{tag_name} eq 'sarcasm') { |
| 7886 |
|
sleep 0.001; # take a deep breath |
| 7887 |
|
} |
| 7888 |
|
|
| 7889 |
## Step 1 |
## Step 1 |
| 7890 |
my $node_i = -1; |
my $node_i = -1; |
| 7891 |
my $node = $self->{open_elements}->[$node_i]; |
my $node = $self->{open_elements}->[$node_i]; |
| 7892 |
|
|
| 7893 |
## Step 2 |
## Step 2 |
| 7894 |
S2: { |
S2: { |
| 7895 |
if ($node->[0]->manakai_local_name eq $token->{tag_name}) { |
my $node_tag_name = $node->[0]->manakai_local_name; |
| 7896 |
|
$node_tag_name =~ tr/A-Z/a-z/; # for SVG camelCase tag names |
| 7897 |
|
if ($node_tag_name eq $token->{tag_name}) { |
| 7898 |
## Step 1 |
## Step 1 |
| 7899 |
## generate implied end tags |
## generate implied end tags |
| 7900 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 7907 |
} |
} |
| 7908 |
|
|
| 7909 |
## Step 2 |
## Step 2 |
| 7910 |
if ($self->{open_elements}->[-1]->[0]->manakai_local_name |
my $current_tag_name |
| 7911 |
ne $token->{tag_name}) { |
= $self->{open_elements}->[-1]->[0]->manakai_local_name; |
| 7912 |
|
$current_tag_name =~ tr/A-Z/a-z/; |
| 7913 |
|
if ($current_tag_name ne $token->{tag_name}) { |
| 7914 |
!!!cp ('t431'); |
!!!cp ('t431'); |
| 7915 |
## NOTE: <x><y></x> |
## NOTE: <x><y></x> |
| 7916 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7938 |
## Ignore the token |
## Ignore the token |
| 7939 |
!!!next-token; |
!!!next-token; |
| 7940 |
last S2; |
last S2; |
|
} |
|
| 7941 |
|
|
| 7942 |
|
## NOTE: |<span><dd></span>a|: In Safari 3.1.2 and Opera |
| 7943 |
|
## 9.27, "a" is a child of <dd> (conforming). In |
| 7944 |
|
## Firefox 3.0.2, "a" is a child of <body>. In WinIE 7, |
| 7945 |
|
## "a" is a child of both <body> and <dd>. |
| 7946 |
|
} |
| 7947 |
|
|
| 7948 |
!!!cp ('t434'); |
!!!cp ('t434'); |
| 7949 |
} |
} |
| 7950 |
|
|