2739 |
## Step 4..13 |
## Step 4..13 |
2740 |
my $new_mode = { |
my $new_mode = { |
2741 |
select => IN_SELECT_IM, |
select => IN_SELECT_IM, |
2742 |
|
## NOTE: |option| and |optgroup| do not set |
2743 |
|
## insertion mode to "in select" by themselves. |
2744 |
td => IN_CELL_IM, |
td => IN_CELL_IM, |
2745 |
th => IN_CELL_IM, |
th => IN_CELL_IM, |
2746 |
tr => IN_ROW_IM, |
tr => IN_ROW_IM, |
3860 |
} # INSCOPE |
} # INSCOPE |
3861 |
unless (defined $i) { |
unless (defined $i) { |
3862 |
!!!cp ('t157'); |
!!!cp ('t157'); |
3863 |
|
## TODO: this type is wrong. |
3864 |
!!!parse-error (type => 'unmatched end tag:caption'); |
!!!parse-error (type => 'unmatched end tag:caption'); |
3865 |
## Ignore the token |
## Ignore the token |
3866 |
!!!next-token; |
!!!next-token; |
3870 |
## generate implied end tags |
## generate implied end tags |
3871 |
if ({ |
if ({ |
3872 |
dd => 1, dt => 1, li => 1, p => 1, |
dd => 1, dt => 1, li => 1, p => 1, |
3873 |
|
|
3874 |
|
## NOTE: Maybe the following elements never appear here. |
3875 |
td => 1, th => 1, tr => 1, |
td => 1, th => 1, tr => 1, |
3876 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
3877 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
3878 |
!!!cp ('t158'); |
!!!cp ('t158'); |
3879 |
!!!back-token; # <?> |
!!!back-token; # <?> |
3938 |
dd => 1, dt => 1, li => 1, p => 1, |
dd => 1, dt => 1, li => 1, p => 1, |
3939 |
td => ($token->{tag_name} eq 'th'), |
td => ($token->{tag_name} eq 'th'), |
3940 |
th => ($token->{tag_name} eq 'td'), |
th => ($token->{tag_name} eq 'td'), |
3941 |
|
|
3942 |
|
## NOTE: Maybe the following elements never appear here. |
3943 |
tr => 1, |
tr => 1, |
3944 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
3945 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
3946 |
!!!cp ('t166'); |
!!!cp ('t166'); |
3947 |
!!!back-token; |
!!!back-token; |
4003 |
## generate implied end tags |
## generate implied end tags |
4004 |
if ({ |
if ({ |
4005 |
dd => 1, dt => 1, li => 1, p => 1, |
dd => 1, dt => 1, li => 1, p => 1, |
4006 |
|
|
4007 |
|
## NOTE: The following elements never appear here, maybe. |
4008 |
td => 1, th => 1, tr => 1, |
td => 1, th => 1, tr => 1, |
4009 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
4010 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4011 |
!!!cp ('t174'); |
!!!cp ('t174'); |
4012 |
!!!back-token; |
!!!back-token; |
4111 |
## generate implied end tags |
## generate implied end tags |
4112 |
if ({ |
if ({ |
4113 |
dd => 1, dt => 1, li => 1, p => 1, |
dd => 1, dt => 1, li => 1, p => 1, |
4114 |
|
|
4115 |
|
## NOTE: The following elements never appear, maybe. |
4116 |
td => 1, th => 1, tr => 1, |
td => 1, th => 1, tr => 1, |
4117 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
4118 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4119 |
!!!cp ('t187'); |
!!!cp ('t187'); |
4120 |
!!!back-token; # </table> |
!!!back-token; # </table> |
4269 |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
4270 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4271 |
!!!cp ('t203'); |
!!!cp ('t203'); |
4272 |
|
## ISSUE: Can this case be reached? |
4273 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4274 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4275 |
} |
} |
4321 |
$i = $_; |
$i = $_; |
4322 |
last INSCOPE; |
last INSCOPE; |
4323 |
} elsif ({ |
} elsif ({ |
4324 |
table => 1, html => 1, |
html => 1, |
4325 |
|
|
4326 |
|
## NOTE: This element does not appear here, maybe. |
4327 |
|
table => 1, |
4328 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
4329 |
!!!cp ('t209'); |
!!!cp ('t209'); |
4330 |
last INSCOPE; |
last INSCOPE; |
4332 |
} # INSCOPE |
} # INSCOPE |
4333 |
unless (defined $i) { |
unless (defined $i) { |
4334 |
!!!cp ('t210'); |
!!!cp ('t210'); |
4335 |
|
## TODO: This type is wrong. |
4336 |
!!!parse-error (type => 'unmacthed end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmacthed end tag:'.$token->{tag_name}); |
4337 |
## Ignore the token |
## Ignore the token |
4338 |
!!!next-token; |
!!!next-token; |
4344 |
tr => 1, html => 1, |
tr => 1, html => 1, |
4345 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4346 |
!!!cp ('t211'); |
!!!cp ('t211'); |
4347 |
|
## ISSUE: Can this case be reached? |
4348 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4349 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4350 |
} |
} |
4393 |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
4394 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4395 |
!!!cp ('t217'); |
!!!cp ('t217'); |
4396 |
|
## ISSUE: Can this state be reached? |
4397 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4398 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4399 |
} |
} |
4417 |
while ($self->{open_elements}->[-1]->[1] ne 'table' and |
while ($self->{open_elements}->[-1]->[1] ne 'table' and |
4418 |
$self->{open_elements}->[-1]->[1] ne 'html') { |
$self->{open_elements}->[-1]->[1] ne 'html') { |
4419 |
!!!cp ('t219'); |
!!!cp ('t219'); |
4420 |
|
## ISSUE: Can this state be reached? |
4421 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4422 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4423 |
} |
} |
4435 |
while ($self->{open_elements}->[-1]->[1] ne 'table' and |
while ($self->{open_elements}->[-1]->[1] ne 'table' and |
4436 |
$self->{open_elements}->[-1]->[1] ne 'html') { |
$self->{open_elements}->[-1]->[1] ne 'html') { |
4437 |
!!!cp ('t220'); |
!!!cp ('t220'); |
4438 |
|
## ISSUE: Can this state be reached? |
4439 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4440 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4441 |
} |
} |
4469 |
$i = $_; |
$i = $_; |
4470 |
last INSCOPE; |
last INSCOPE; |
4471 |
} elsif ({ |
} elsif ({ |
4472 |
table => 1, html => 1, |
#table => 1, |
4473 |
|
html => 1, |
4474 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
4475 |
!!!cp ('t222'); |
!!!cp ('t222'); |
4476 |
last INSCOPE; |
last INSCOPE; |
4478 |
} # INSCOPE |
} # INSCOPE |
4479 |
unless (defined $i) { |
unless (defined $i) { |
4480 |
!!!cp ('t223'); |
!!!cp ('t223'); |
4481 |
|
## TODO: The following is wrong, maybe. |
4482 |
!!!parse-error (type => 'unmatched end tag:table'); |
!!!parse-error (type => 'unmatched end tag:table'); |
4483 |
## Ignore tokens </table><table> |
## Ignore tokens </table><table> |
4484 |
!!!next-token; |
!!!next-token; |
4502 |
|
|
4503 |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
4504 |
!!!cp ('t225'); |
!!!cp ('t225'); |
4505 |
|
## ISSUE: Can this case be reached? |
4506 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4507 |
} else { |
} else { |
4508 |
!!!cp ('t226'); |
!!!cp ('t226'); |
4554 |
tr => 1, html => 1, |
tr => 1, html => 1, |
4555 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4556 |
!!!cp ('t231'); |
!!!cp ('t231'); |
4557 |
|
## ISSUE: Can this state be reached? |
4558 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4559 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4560 |
} |
} |
4583 |
} # INSCOPE |
} # INSCOPE |
4584 |
unless (defined $i) { |
unless (defined $i) { |
4585 |
!!!cp ('t235'); |
!!!cp ('t235'); |
4586 |
|
## TODO: The following is wrong. |
4587 |
!!!parse-error (type => 'unmatched end tag:'.$token->{type}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{type}); |
4588 |
## Ignore the token |
## Ignore the token |
4589 |
!!!next-token; |
!!!next-token; |
4595 |
tr => 1, html => 1, |
tr => 1, html => 1, |
4596 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4597 |
!!!cp ('t236'); |
!!!cp ('t236'); |
4598 |
|
## ISSUE: Can this state be reached? |
4599 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4600 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4601 |
} |
} |
4682 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot=> 1, thead => 1, |
4683 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4684 |
!!!cp ('t244'); |
!!!cp ('t244'); |
4685 |
|
## ISSUE: Can this case be reached? |
4686 |
!!!back-token; |
!!!back-token; |
4687 |
$token = {type => END_TAG_TOKEN, |
$token = {type => END_TAG_TOKEN, |
4688 |
tag_name => $self->{open_elements}->[-1]->[1]}; # MUST |
tag_name => $self->{open_elements}->[-1]->[1]}; # MUST |
4759 |
tr => 1, html => 1, |
tr => 1, html => 1, |
4760 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4761 |
!!!cp ('t253'); |
!!!cp ('t253'); |
4762 |
|
## ISSUE: Can this case be reached? |
4763 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4764 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4765 |
} |
} |
4797 |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
tbody => 1, tfoot => 1, thead => 1, html => 1, |
4798 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
4799 |
!!!cp ('t257'); |
!!!cp ('t257'); |
4800 |
|
## ISSUE: Can this case be reached? |
4801 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
4802 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
4803 |
} |
} |
4877 |
# |
# |
4878 |
} |
} |
4879 |
} else { |
} else { |
4880 |
!!!cp ('t268'); |
die "$0: $token->{type}: Unknown token type"; |
|
# |
|
4881 |
} |
} |
4882 |
|
|
4883 |
## As if </colgroup> |
## As if </colgroup> |
4934 |
!!!next-token; |
!!!next-token; |
4935 |
redo B; |
redo B; |
4936 |
} elsif ($token->{tag_name} eq 'select') { |
} elsif ($token->{tag_name} eq 'select') { |
4937 |
|
## TODO: The type below is not good - <select> is replaced by </select> |
4938 |
!!!parse-error (type => 'not closed:select'); |
!!!parse-error (type => 'not closed:select'); |
4939 |
## As if </select> instead |
## As if </select> instead |
4940 |
## have an element in table scope |
## have an element in table scope |
5037 |
caption => 1, table => 1, tbody => 1, |
caption => 1, table => 1, tbody => 1, |
5038 |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
5039 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
5040 |
|
## TODO: The following is wrong? |
5041 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
5042 |
|
|
5043 |
## have an element in table scope |
## have an element in table scope |
5074 |
} elsif ({ |
} elsif ({ |
5075 |
table => 1, html => 1, |
table => 1, html => 1, |
5076 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
5077 |
|
## ISSUE: Can this state be reached? |
5078 |
!!!cp ('t296'); |
!!!cp ('t296'); |
5079 |
last INSCOPE; |
last INSCOPE; |
5080 |
} |
} |
5081 |
} # INSCOPE |
} # INSCOPE |
5082 |
unless (defined $i) { |
unless (defined $i) { |
5083 |
!!!cp ('t297'); |
!!!cp ('t297'); |
5084 |
|
## TODO: The following error type is correct? |
5085 |
!!!parse-error (type => 'unmatched end tag:select'); |
!!!parse-error (type => 'unmatched end tag:select'); |
5086 |
## Ignore the </select> token |
## Ignore the </select> token |
5087 |
!!!next-token; ## TODO: ok? |
!!!next-token; ## TODO: ok? |
6134 |
## generate implied end tags |
## generate implied end tags |
6135 |
if ({ |
if ({ |
6136 |
dd => 1, dt => 1, li => 1, p => 1, |
dd => 1, dt => 1, li => 1, p => 1, |
6137 |
|
|
6138 |
|
## NOTE: The following elements never appear here, maybe. |
6139 |
td => 1, th => 1, tr => 1, |
td => 1, th => 1, tr => 1, |
6140 |
tbody => 1, tfoot=> 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
6141 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
6142 |
!!!cp ('t417'); |
!!!cp ('t417'); |
6143 |
!!!back-token; |
!!!back-token; |
6272 |
tbody => 1, tfoot => 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
6273 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
6274 |
!!!cp ('t430'); |
!!!cp ('t430'); |
6275 |
|
## ISSUE: Can this case be reached? |
6276 |
!!!back-token; |
!!!back-token; |
6277 |
$token = {type => END_TAG_TOKEN, |
$token = {type => END_TAG_TOKEN, |
6278 |
tag_name => $self->{open_elements}->[-1]->[1]}; # MUST |
tag_name => $self->{open_elements}->[-1]->[1]}; # MUST |