2532 |
|
|
2533 |
my $doctype = $self->{document}->create_document_type_definition |
my $doctype = $self->{document}->create_document_type_definition |
2534 |
($token->{name}); ## ISSUE: If name is missing (e.g. <!DOCTYPE>)? |
($token->{name}); ## ISSUE: If name is missing (e.g. <!DOCTYPE>)? |
2535 |
|
## NOTE: Default value for both |public_id| and |system_id| attributes |
2536 |
|
## are empty strings, so that we don't set any value in missing cases. |
2537 |
$doctype->public_id ($token->{public_identifier}) |
$doctype->public_id ($token->{public_identifier}) |
2538 |
if defined $token->{public_identifier}; |
if defined $token->{public_identifier}; |
2539 |
$doctype->system_id ($token->{system_identifier}) |
$doctype->system_id ($token->{system_identifier}) |
3145 |
} |
} |
3146 |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
3147 |
!!!cp ('t58'); |
!!!cp ('t58'); |
3148 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], |
!!!parse-error (type => 'not closed', |
3149 |
|
value => $self->{open_elements}->[-1]->[0] |
3150 |
|
->manakai_local_name, |
3151 |
token => $end_tag_token); |
token => $end_tag_token); |
3152 |
} |
} |
3153 |
|
|
3966 |
|
|
3967 |
## Close the cell |
## Close the cell |
3968 |
!!!back-token; # <?> |
!!!back-token; # <?> |
3969 |
$token = {type => END_TAG_TOKEN, tag_name => $node->[1], |
$token = {type => END_TAG_TOKEN, |
3970 |
|
tag_name => $node->[0]->manakai_local_name, |
3971 |
line => $token->{line}, |
line => $token->{line}, |
3972 |
column => $token->{column}}; |
column => $token->{column}}; |
3973 |
redo B; |
redo B; |
4025 |
|
|
4026 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
4027 |
!!!cp ('t159'); |
!!!cp ('t159'); |
4028 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4029 |
|
value => $self->{open_elements}->[-1]->[0] |
4030 |
|
->manakai_local_name, |
4031 |
|
token => $token); |
4032 |
} else { |
} else { |
4033 |
!!!cp ('t160'); |
!!!cp ('t160'); |
4034 |
} |
} |
4085 |
|
|
4086 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
4087 |
!!!cp ('t167'); |
!!!cp ('t167'); |
4088 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4089 |
|
value => $self->{open_elements}->[-1]->[0] |
4090 |
|
->manakai_local_name, |
4091 |
|
token => $token); |
4092 |
} else { |
} else { |
4093 |
!!!cp ('t168'); |
!!!cp ('t168'); |
4094 |
} |
} |
4148 |
|
|
4149 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
4150 |
!!!cp ('t175'); |
!!!cp ('t175'); |
4151 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4152 |
|
value => $self->{open_elements}->[-1]->[0] |
4153 |
|
->manakai_local_name, |
4154 |
|
token => $token); |
4155 |
} else { |
} else { |
4156 |
!!!cp ('t176'); |
!!!cp ('t176'); |
4157 |
} |
} |
4254 |
|
|
4255 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
4256 |
!!!cp ('t188'); |
!!!cp ('t188'); |
4257 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4258 |
|
value => $self->{open_elements}->[-1]->[0] |
4259 |
|
->manakai_local_name, |
4260 |
|
token => $token); |
4261 |
} else { |
} else { |
4262 |
!!!cp ('t189'); |
!!!cp ('t189'); |
4263 |
} |
} |
4596 |
die "$0: in table: <>: $token->{tag_name}"; |
die "$0: in table: <>: $token->{tag_name}"; |
4597 |
} |
} |
4598 |
} elsif ($token->{tag_name} eq 'table') { |
} elsif ($token->{tag_name} eq 'table') { |
4599 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4600 |
|
value => $self->{open_elements}->[-1]->[0] |
4601 |
|
->manakai_local_name, |
4602 |
|
token => $token); |
4603 |
|
|
4604 |
## As if </table> |
## As if </table> |
4605 |
## have a table element in table scope |
## have a table element in table scope |
4638 |
|
|
4639 |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
4640 |
!!!cp ('t225'); |
!!!cp ('t225'); |
4641 |
## ISSUE: Can this case be reached? |
## NOTE: |<table><tr><table>| |
4642 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
4643 |
|
value => $self->{open_elements}->[-1]->[0] |
4644 |
|
->manakai_local_name, |
4645 |
|
token => $token); |
4646 |
} else { |
} else { |
4647 |
!!!cp ('t226'); |
!!!cp ('t226'); |
4648 |
} |
} |
5765 |
if ($li_or_dtdd->{$node->[1]}) { |
if ($li_or_dtdd->{$node->[1]}) { |
5766 |
if ($i != -1) { |
if ($i != -1) { |
5767 |
!!!cp ('t355'); |
!!!cp ('t355'); |
5768 |
!!!parse-error (type => 'end tag missing:'. |
!!!parse-error (type => 'not closed', |
5769 |
$self->{open_elements}->[-1]->[1], token => $token); |
value => $self->{open_elements}->[-1]->[0] |
5770 |
|
->manakai_local_name, |
5771 |
|
token => $token); |
5772 |
} else { |
} else { |
5773 |
!!!cp ('t356'); |
!!!cp ('t356'); |
5774 |
} |
} |
6139 |
tbody => 1, tfoot => 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
6140 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
6141 |
!!!cp ('t403'); |
!!!cp ('t403'); |
6142 |
!!!parse-error (type => 'not closed:'.$_->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6143 |
|
value => $_->[0]->manakai_local_name, |
6144 |
|
token => $token); |
6145 |
last; |
last; |
6146 |
} else { |
} else { |
6147 |
!!!cp ('t404'); |
!!!cp ('t404'); |
6152 |
!!!next-token; |
!!!next-token; |
6153 |
redo B; |
redo B; |
6154 |
} elsif ($token->{tag_name} eq 'html') { |
} elsif ($token->{tag_name} eq 'html') { |
6155 |
|
## TODO: Update this code. It seems that the code below is not |
6156 |
|
## up-to-date, though it has same effect as speced. |
6157 |
if (@{$self->{open_elements}} > 1 and $self->{open_elements}->[1]->[1] eq 'body') { |
if (@{$self->{open_elements}} > 1 and $self->{open_elements}->[1]->[1] eq 'body') { |
6158 |
## ISSUE: There is an issue in the spec. |
## ISSUE: There is an issue in the spec. |
6159 |
if ($self->{open_elements}->[-1]->[1] ne 'body') { |
if ($self->{open_elements}->[-1]->[1] ne 'body') { |
6160 |
!!!cp ('t406'); |
!!!cp ('t406'); |
6161 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6162 |
|
value => $self->{open_elements}->[1]->[0] |
6163 |
|
->manakai_local_name, |
6164 |
|
token => $token); |
6165 |
} else { |
} else { |
6166 |
!!!cp ('t407'); |
!!!cp ('t407'); |
6167 |
} |
} |
6217 |
## Step 2. |
## Step 2. |
6218 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6219 |
!!!cp ('t412'); |
!!!cp ('t412'); |
6220 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6221 |
|
value => $self->{open_elements}->[-1]->[0] |
6222 |
|
->manakai_local_name, |
6223 |
|
token => $token); |
6224 |
} else { |
} else { |
6225 |
!!!cp ('t414'); |
!!!cp ('t414'); |
6226 |
} |
} |
6271 |
## Step 2. |
## Step 2. |
6272 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6273 |
!!!cp ('t417.1'); |
!!!cp ('t417.1'); |
6274 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6275 |
|
value => $self->{open_elements}->[-1]->[0] |
6276 |
|
->manakai_local_name, |
6277 |
|
token => $token); |
6278 |
} else { |
} else { |
6279 |
!!!cp ('t420'); |
!!!cp ('t420'); |
6280 |
} |
} |
6354 |
if (defined $i) { |
if (defined $i) { |
6355 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6356 |
!!!cp ('t412.1'); |
!!!cp ('t412.1'); |
6357 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6358 |
|
value => $self->{open_elements}->[-1]->[0] |
6359 |
|
->manakai_local_name, |
6360 |
|
token => $token); |
6361 |
} else { |
} else { |
6362 |
!!!cp ('t414.1'); |
!!!cp ('t414.1'); |
6363 |
} |
} |
6442 |
if ($token->{tag_name} ne $self->{open_elements}->[-1]->[1]) { |
if ($token->{tag_name} ne $self->{open_elements}->[-1]->[1]) { |
6443 |
!!!cp ('t431'); |
!!!cp ('t431'); |
6444 |
## NOTE: <x><y></x> |
## NOTE: <x><y></x> |
6445 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
!!!parse-error (type => 'not closed', |
6446 |
|
value => $self->{open_elements}->[-1]->[0] |
6447 |
|
->manakai_local_name, |
6448 |
|
token => $token); |
6449 |
} else { |
} else { |
6450 |
!!!cp ('t432'); |
!!!cp ('t432'); |
6451 |
} |
} |