| 3886 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 3887 |
if ($self->{insertion_mode} == IN_CELL_IM) { |
if ($self->{insertion_mode} == IN_CELL_IM) { |
| 3888 |
## have an element in table scope |
## have an element in table scope |
| 3889 |
my $tn; |
for (reverse 0..$#{$self->{open_elements}}) { |
|
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
|
| 3890 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
| 3891 |
if ($node->[1] eq 'td' or $node->[1] eq 'th') { |
if ($node->[1] eq 'td' or $node->[1] eq 'th') { |
| 3892 |
!!!cp ('t151'); |
!!!cp ('t151'); |
| 3893 |
$tn = $node->[1]; |
|
| 3894 |
last INSCOPE; |
## Close the cell |
| 3895 |
|
!!!back-token; # <?> |
| 3896 |
|
$token = {type => END_TAG_TOKEN, tag_name => $node->[1]}; |
| 3897 |
|
redo B; |
| 3898 |
} elsif ({ |
} elsif ({ |
| 3899 |
table => 1, html => 1, |
table => 1, html => 1, |
| 3900 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 3901 |
!!!cp ('t152'); |
!!!cp ('t152'); |
| 3902 |
last INSCOPE; |
## ISSUE: This case can never be reached, maybe. |
| 3903 |
|
last; |
| 3904 |
} |
} |
| 3905 |
} # INSCOPE |
} |
| 3906 |
unless (defined $tn) { |
|
| 3907 |
!!!cp ('t153'); |
!!!cp ('t153'); |
| 3908 |
## TODO: This error type is wrong. |
!!!parse-error (type => 'start tag not allowed', |
| 3909 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
value => $token->{tag_name}); |
| 3910 |
## Ignore the token |
## Ignore the token |
| 3911 |
!!!next-token; |
!!!next-token; |
|
redo B; |
|
|
} |
|
|
|
|
|
!!!cp ('t154'); |
|
|
## Close the cell |
|
|
!!!back-token; # <?> |
|
|
$token = {type => END_TAG_TOKEN, tag_name => $tn}; |
|
| 3912 |
redo B; |
redo B; |
| 3913 |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 3914 |
!!!parse-error (type => 'not closed:caption'); |
!!!parse-error (type => 'not closed:caption'); |
| 3915 |
|
|
| 3916 |
## As if </caption> |
## NOTE: As if </caption>. |
| 3917 |
## have a table element in table scope |
## have a table element in table scope |
| 3918 |
my $i; |
my $i; |
| 3919 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: { |
| 3920 |
my $node = $self->{open_elements}->[$_]; |
for (reverse 0..$#{$self->{open_elements}}) { |
| 3921 |
if ($node->[1] eq 'caption') { |
my $node = $self->{open_elements}->[$_]; |
| 3922 |
!!!cp ('t155'); |
if ($node->[1] eq 'caption') { |
| 3923 |
$i = $_; |
!!!cp ('t155'); |
| 3924 |
last INSCOPE; |
$i = $_; |
| 3925 |
} elsif ({ |
last INSCOPE; |
| 3926 |
table => 1, html => 1, |
} elsif ({ |
| 3927 |
}->{$node->[1]}) { |
table => 1, html => 1, |
| 3928 |
!!!cp ('t156'); |
}->{$node->[1]}) { |
| 3929 |
last INSCOPE; |
!!!cp ('t156'); |
| 3930 |
|
last; |
| 3931 |
|
} |
| 3932 |
} |
} |
| 3933 |
|
|
| 3934 |
|
!!!cp ('t157'); |
| 3935 |
|
!!!parse-error (type => 'start tag not allowed', |
| 3936 |
|
value => $token->{tag_name}); |
| 3937 |
|
## Ignore the token |
| 3938 |
|
!!!next-token; |
| 3939 |
|
redo B; |
| 3940 |
} # INSCOPE |
} # INSCOPE |
|
unless (defined $i) { |
|
|
!!!cp ('t157'); |
|
|
## TODO: this type is wrong. |
|
|
!!!parse-error (type => 'unmatched end tag:caption'); |
|
|
## Ignore the token |
|
|
!!!next-token; |
|
|
redo B; |
|
|
} |
|
| 3941 |
|
|
| 3942 |
## generate implied end tags |
## generate implied end tags |
| 3943 |
while ({ |
while ({ |
| 4033 |
if ($self->{insertion_mode} == IN_CAPTION_IM) { |
if ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 4034 |
## have a table element in table scope |
## have a table element in table scope |
| 4035 |
my $i; |
my $i; |
| 4036 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: { |
| 4037 |
my $node = $self->{open_elements}->[$_]; |
for (reverse 0..$#{$self->{open_elements}}) { |
| 4038 |
if ($node->[1] eq $token->{tag_name}) { |
my $node = $self->{open_elements}->[$_]; |
| 4039 |
!!!cp ('t171'); |
if ($node->[1] eq $token->{tag_name}) { |
| 4040 |
$i = $_; |
!!!cp ('t171'); |
| 4041 |
last INSCOPE; |
$i = $_; |
| 4042 |
} elsif ({ |
last INSCOPE; |
| 4043 |
table => 1, html => 1, |
} elsif ({ |
| 4044 |
}->{$node->[1]}) { |
table => 1, html => 1, |
| 4045 |
!!!cp ('t172'); |
}->{$node->[1]}) { |
| 4046 |
last INSCOPE; |
!!!cp ('t172'); |
| 4047 |
|
last; |
| 4048 |
|
} |
| 4049 |
} |
} |
| 4050 |
|
|
| 4051 |
|
!!!cp ('t173'); |
| 4052 |
|
!!!parse-error (type => 'unmatched end tag', |
| 4053 |
|
value => $token->{tag_name}); |
| 4054 |
|
## Ignore the token |
| 4055 |
|
!!!next-token; |
| 4056 |
|
redo B; |
| 4057 |
} # INSCOPE |
} # INSCOPE |
|
unless (defined $i) { |
|
|
!!!cp ('t173'); |
|
|
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
|
|
## Ignore the token |
|
|
!!!next-token; |
|
|
redo B; |
|
|
} |
|
| 4058 |
|
|
| 4059 |
## generate implied end tags |
## generate implied end tags |
| 4060 |
while ({ |
while ({ |
| 4097 |
## have an element in table scope |
## have an element in table scope |
| 4098 |
my $i; |
my $i; |
| 4099 |
my $tn; |
my $tn; |
| 4100 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: { |
| 4101 |
my $node = $self->{open_elements}->[$_]; |
for (reverse 0..$#{$self->{open_elements}}) { |
| 4102 |
if ($node->[1] eq $token->{tag_name}) { |
my $node = $self->{open_elements}->[$_]; |
| 4103 |
!!!cp ('t179'); |
if ($node->[1] eq $token->{tag_name}) { |
| 4104 |
$i = $_; |
!!!cp ('t179'); |
| 4105 |
last INSCOPE; |
$i = $_; |
| 4106 |
} elsif ($node->[1] eq 'td' or $node->[1] eq 'th') { |
|
| 4107 |
!!!cp ('t180'); |
## Close the cell |
| 4108 |
$tn = $node->[1]; |
!!!back-token; # </?> |
| 4109 |
## NOTE: There is exactly one |td| or |th| element |
$token = {type => END_TAG_TOKEN, tag_name => $tn}; |
| 4110 |
## in scope in the stack of open elements by definition. |
redo B; |
| 4111 |
} elsif ({ |
} elsif ($node->[1] eq 'td' or $node->[1] eq 'th') { |
| 4112 |
table => 1, html => 1, |
!!!cp ('t180'); |
| 4113 |
}->{$node->[1]}) { |
$tn = $node->[1]; |
| 4114 |
!!!cp ('t181'); |
## NOTE: There is exactly one |td| or |th| element |
| 4115 |
last INSCOPE; |
## in scope in the stack of open elements by definition. |
| 4116 |
|
} elsif ({ |
| 4117 |
|
table => 1, html => 1, |
| 4118 |
|
}->{$node->[1]}) { |
| 4119 |
|
## ISSUE: Can this be reached? |
| 4120 |
|
!!!cp ('t181'); |
| 4121 |
|
last; |
| 4122 |
|
} |
| 4123 |
} |
} |
| 4124 |
} # INSCOPE |
|
|
unless (defined $i) { |
|
| 4125 |
!!!cp ('t182'); |
!!!cp ('t182'); |
| 4126 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag', |
| 4127 |
|
value => $token->{tag_name}); |
| 4128 |
## Ignore the token |
## Ignore the token |
| 4129 |
!!!next-token; |
!!!next-token; |
| 4130 |
redo B; |
redo B; |
| 4131 |
} else { |
} # INSCOPE |
|
!!!cp ('t183'); |
|
|
} |
|
|
|
|
|
## Close the cell |
|
|
!!!back-token; # </?> |
|
|
$token = {type => END_TAG_TOKEN, tag_name => $tn}; |
|
|
redo B; |
|
| 4132 |
} elsif ($token->{tag_name} eq 'table' and |
} elsif ($token->{tag_name} eq 'table' and |
| 4133 |
$self->{insertion_mode} == IN_CAPTION_IM) { |
$self->{insertion_mode} == IN_CAPTION_IM) { |
| 4134 |
!!!parse-error (type => 'not closed:caption'); |
!!!parse-error (type => 'not closed:caption'); |
| 5575 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
| 5576 |
menu => 1, ol => 1, p => 1, ul => 1, |
menu => 1, ol => 1, p => 1, ul => 1, |
| 5577 |
pre => 1, listing => 1, |
pre => 1, listing => 1, |
| 5578 |
|
form => 1, |
| 5579 |
|
table => 1, |
| 5580 |
|
hr => 1, |
| 5581 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5582 |
|
if ($token->{tag_name} eq 'form' and defined $self->{form_element}) { |
| 5583 |
|
!!!cp ('t350'); |
| 5584 |
|
!!!parse-error (type => 'in form:form'); |
| 5585 |
|
## Ignore the token |
| 5586 |
|
!!!next-token; |
| 5587 |
|
redo B; |
| 5588 |
|
} |
| 5589 |
|
|
| 5590 |
## has a p element in scope |
## has a p element in scope |
| 5591 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 5592 |
if ($_->[1] eq 'p') { |
if ($_->[1] eq 'p') { |
| 5617 |
} else { |
} else { |
| 5618 |
!!!cp ('t348'); |
!!!cp ('t348'); |
| 5619 |
} |
} |
| 5620 |
} else { |
} elsif ($token->{tag_name} eq 'form') { |
| 5621 |
!!!cp ('t347'); |
!!!cp ('t347.1'); |
| 5622 |
|
$self->{form_element} = $self->{open_elements}->[-1]->[0]; |
| 5623 |
|
|
| 5624 |
!!!next-token; |
!!!next-token; |
| 5625 |
} |
} elsif ($token->{tag_name} eq 'table') { |
| 5626 |
redo B; |
!!!cp ('t382'); |
| 5627 |
} elsif ($token->{tag_name} eq 'form') { |
push @{$open_tables}, [$self->{open_elements}->[-1]->[0]]; |
| 5628 |
if (defined $self->{form_element}) { |
|
| 5629 |
!!!cp ('t350'); |
$self->{insertion_mode} = IN_TABLE_IM; |
| 5630 |
!!!parse-error (type => 'in form:form'); |
|
| 5631 |
## Ignore the token |
!!!next-token; |
| 5632 |
|
} elsif ($token->{tag_name} eq 'hr') { |
| 5633 |
|
!!!cp ('t386'); |
| 5634 |
|
pop @{$self->{open_elements}}; |
| 5635 |
|
|
| 5636 |
!!!next-token; |
!!!next-token; |
|
redo B; |
|
| 5637 |
} else { |
} else { |
| 5638 |
## has a p element in scope |
!!!cp ('t347'); |
|
INSCOPE: for (reverse @{$self->{open_elements}}) { |
|
|
if ($_->[1] eq 'p') { |
|
|
!!!cp ('t351'); |
|
|
!!!back-token; |
|
|
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
|
|
redo B; |
|
|
} elsif ({ |
|
|
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
|
|
button => 1, marquee => 1, object => 1, html => 1, |
|
|
}->{$_->[1]}) { |
|
|
!!!cp ('t352'); |
|
|
last INSCOPE; |
|
|
} |
|
|
} # INSCOPE |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
$self->{form_element} = $self->{open_elements}->[-1]->[0]; |
|
| 5639 |
!!!next-token; |
!!!next-token; |
|
redo B; |
|
| 5640 |
} |
} |
| 5641 |
} elsif ($token->{tag_name} eq 'li') { |
redo B; |
| 5642 |
|
} elsif ({li => 1, dt => 1, dd => 1}->{$token->{tag_name}}) { |
| 5643 |
## has a p element in scope |
## has a p element in scope |
| 5644 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 5645 |
if ($_->[1] eq 'p') { |
if ($_->[1] eq 'p') { |
| 5659 |
## Step 1 |
## Step 1 |
| 5660 |
my $i = -1; |
my $i = -1; |
| 5661 |
my $node = $self->{open_elements}->[$i]; |
my $node = $self->{open_elements}->[$i]; |
| 5662 |
|
my $li_or_dtdd = {li => {li => 1}, |
| 5663 |
|
dt => {dt => 1, dd => 1}, |
| 5664 |
|
dd => {dt => 1, dd => 1}}->{$token->{tag_name}}; |
| 5665 |
LI: { |
LI: { |
| 5666 |
## Step 2 |
## Step 2 |
| 5667 |
if ($node->[1] eq 'li') { |
if ($li_or_dtdd->{$node->[1]}) { |
| 5668 |
if ($i != -1) { |
if ($i != -1) { |
| 5669 |
!!!cp ('t355'); |
!!!cp ('t355'); |
| 5670 |
!!!parse-error (type => 'end tag missing:'. |
!!!parse-error (type => 'end tag missing:'. |
| 5698 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
| 5699 |
!!!next-token; |
!!!next-token; |
| 5700 |
redo B; |
redo B; |
|
} elsif ($token->{tag_name} eq 'dd' or $token->{tag_name} eq 'dt') { |
|
|
## has a p element in scope |
|
|
INSCOPE: for (reverse @{$self->{open_elements}}) { |
|
|
if ($_->[1] eq 'p') { |
|
|
!!!cp ('t360'); |
|
|
!!!back-token; |
|
|
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
|
|
redo B; |
|
|
} elsif ({ |
|
|
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
|
|
button => 1, marquee => 1, object => 1, html => 1, |
|
|
}->{$_->[1]}) { |
|
|
!!!cp ('t361'); |
|
|
last INSCOPE; |
|
|
} |
|
|
} # INSCOPE |
|
|
|
|
|
## Step 1 |
|
|
my $i = -1; |
|
|
my $node = $self->{open_elements}->[$i]; |
|
|
LI: { |
|
|
## Step 2 |
|
|
if ($node->[1] eq 'dt' or $node->[1] eq 'dd') { |
|
|
if ($i != -1) { |
|
|
!!!cp ('t362'); |
|
|
!!!parse-error (type => 'end tag missing:'. |
|
|
$self->{open_elements}->[-1]->[1]); |
|
|
} else { |
|
|
!!!cp ('t363'); |
|
|
} |
|
|
splice @{$self->{open_elements}}, $i; |
|
|
last LI; |
|
|
} else { |
|
|
!!!cp ('t364'); |
|
|
} |
|
|
|
|
|
## Step 3 |
|
|
if (not $formatting_category->{$node->[1]} and |
|
|
#not $phrasing_category->{$node->[1]} and |
|
|
($special_category->{$node->[1]} or |
|
|
$scoping_category->{$node->[1]}) and |
|
|
$node->[1] ne 'address' and $node->[1] ne 'div') { |
|
|
!!!cp ('t365'); |
|
|
last LI; |
|
|
} |
|
|
|
|
|
!!!cp ('t366'); |
|
|
## Step 4 |
|
|
$i--; |
|
|
$node = $self->{open_elements}->[$i]; |
|
|
redo LI; |
|
|
} # LI |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
!!!next-token; |
|
|
redo B; |
|
| 5701 |
} elsif ($token->{tag_name} eq 'plaintext') { |
} elsif ($token->{tag_name} eq 'plaintext') { |
| 5702 |
## has a p element in scope |
## has a p element in scope |
| 5703 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 5760 |
|
|
| 5761 |
!!!next-token; |
!!!next-token; |
| 5762 |
redo B; |
redo B; |
|
} elsif ({ |
|
|
b => 1, big => 1, em => 1, font => 1, i => 1, |
|
|
s => 1, small => 1, strile => 1, |
|
|
strong => 1, tt => 1, u => 1, |
|
|
}->{$token->{tag_name}}) { |
|
|
!!!cp ('t375'); |
|
|
$reconstruct_active_formatting_elements->($insert_to_current); |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
|
|
|
|
|
!!!next-token; |
|
|
redo B; |
|
| 5763 |
} elsif ($token->{tag_name} eq 'nobr') { |
} elsif ($token->{tag_name} eq 'nobr') { |
| 5764 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 5765 |
|
|
| 5816 |
!!!next-token; |
!!!next-token; |
| 5817 |
redo B; |
redo B; |
| 5818 |
} elsif ({ |
} elsif ({ |
| 5819 |
applet => 1, marquee => 1, object => 1, |
xmp => 1, |
| 5820 |
}->{$token->{tag_name}}) { |
iframe => 1, |
| 5821 |
!!!cp ('t380'); |
noembed => 1, |
| 5822 |
$reconstruct_active_formatting_elements->($insert_to_current); |
noframes => 1, |
| 5823 |
|
noscript => 0, ## TODO: 1 if scripting is enabled |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
push @$active_formatting_elements, ['#marker', '']; |
|
|
|
|
|
!!!next-token; |
|
|
redo B; |
|
|
} elsif ($token->{tag_name} eq 'xmp') { |
|
|
!!!cp ('t381'); |
|
|
$reconstruct_active_formatting_elements->($insert_to_current); |
|
|
$parse_rcdata->(CDATA_CONTENT_MODEL); |
|
|
redo B; |
|
|
} elsif ($token->{tag_name} eq 'table') { |
|
|
## has a p element in scope |
|
|
INSCOPE: for (reverse @{$self->{open_elements}}) { |
|
|
if ($_->[1] eq 'p') { |
|
|
!!!cp ('t382'); |
|
|
!!!back-token; |
|
|
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
|
|
redo B; |
|
|
} elsif ({ |
|
|
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
|
|
button => 1, marquee => 1, object => 1, html => 1, |
|
|
}->{$_->[1]}) { |
|
|
!!!cp ('t383'); |
|
|
last INSCOPE; |
|
|
} |
|
|
} # INSCOPE |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
push @{$open_tables}, [$self->{open_elements}->[-1]->[0]]; |
|
|
|
|
|
$self->{insertion_mode} = IN_TABLE_IM; |
|
|
|
|
|
!!!next-token; |
|
|
redo B; |
|
|
} elsif ({ |
|
|
area => 1, basefont => 1, bgsound => 1, br => 1, |
|
|
embed => 1, img => 1, param => 1, spacer => 1, wbr => 1, |
|
|
image => 1, |
|
| 5824 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5825 |
if ($token->{tag_name} eq 'image') { |
if ($token->{tag_name} eq 'xmp') { |
| 5826 |
!!!cp ('t384'); |
!!!cp ('t381'); |
| 5827 |
!!!parse-error (type => 'image'); |
$reconstruct_active_formatting_elements->($insert_to_current); |
|
$token->{tag_name} = 'img'; |
|
| 5828 |
} else { |
} else { |
| 5829 |
!!!cp ('t385'); |
!!!cp ('t399'); |
| 5830 |
} |
} |
| 5831 |
|
## NOTE: There is an "as if in body" code clone. |
| 5832 |
## NOTE: There is an "as if <br>" code clone. |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
|
$reconstruct_active_formatting_elements->($insert_to_current); |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
pop @{$self->{open_elements}}; |
|
|
|
|
|
!!!next-token; |
|
|
redo B; |
|
|
} elsif ($token->{tag_name} eq 'hr') { |
|
|
## has a p element in scope |
|
|
INSCOPE: for (reverse @{$self->{open_elements}}) { |
|
|
if ($_->[1] eq 'p') { |
|
|
!!!cp ('t386'); |
|
|
!!!back-token; |
|
|
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
|
|
redo B; |
|
|
} elsif ({ |
|
|
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
|
|
button => 1, marquee => 1, object => 1, html => 1, |
|
|
}->{$_->[1]}) { |
|
|
!!!cp ('t387'); |
|
|
last INSCOPE; |
|
|
} |
|
|
} # INSCOPE |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
pop @{$self->{open_elements}}; |
|
|
|
|
|
!!!next-token; |
|
|
redo B; |
|
|
} elsif ($token->{tag_name} eq 'input') { |
|
|
!!!cp ('t388'); |
|
|
$reconstruct_active_formatting_elements->($insert_to_current); |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
## TODO: associate with $self->{form_element} if defined |
|
|
pop @{$self->{open_elements}}; |
|
|
|
|
|
!!!next-token; |
|
| 5833 |
redo B; |
redo B; |
| 5834 |
} elsif ($token->{tag_name} eq 'isindex') { |
} elsif ($token->{tag_name} eq 'isindex') { |
| 5835 |
!!!parse-error (type => 'isindex'); |
!!!parse-error (type => 'isindex'); |
| 5921 |
!!!next-token; |
!!!next-token; |
| 5922 |
redo B; |
redo B; |
| 5923 |
} elsif ({ |
} elsif ({ |
|
iframe => 1, |
|
|
noembed => 1, |
|
|
noframes => 1, |
|
|
noscript => 0, ## TODO: 1 if scripting is enabled |
|
|
}->{$token->{tag_name}}) { |
|
|
!!!cp ('t399'); |
|
|
## NOTE: There is an "as if in body" code clone. |
|
|
$parse_rcdata->(CDATA_CONTENT_MODEL); |
|
|
redo B; |
|
|
} elsif ($token->{tag_name} eq 'select') { |
|
|
!!!cp ('t400'); |
|
|
$reconstruct_active_formatting_elements->($insert_to_current); |
|
|
|
|
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
|
|
|
|
|
## TODO: associate with $self->{form_element} if defined |
|
|
|
|
|
if ($self->{insertion_mode} & TABLE_IMS or |
|
|
$self->{insertion_mode} & BODY_TABLE_IMS or |
|
|
$self->{insertion_mode} == IN_COLUMN_GROUP_IM) { |
|
|
!!!cp ('t400.1'); |
|
|
$self->{insertion_mode} = IN_SELECT_IN_TABLE_IM; |
|
|
} else { |
|
|
!!!cp ('t400.2'); |
|
|
$self->{insertion_mode} = IN_SELECT_IM; |
|
|
} |
|
|
!!!next-token; |
|
|
redo B; |
|
|
} elsif ({ |
|
| 5924 |
caption => 1, col => 1, colgroup => 1, frame => 1, |
caption => 1, col => 1, colgroup => 1, frame => 1, |
| 5925 |
frameset => 1, head => 1, option => 1, optgroup => 1, |
frameset => 1, head => 1, option => 1, optgroup => 1, |
| 5926 |
tbody => 1, td => 1, tfoot => 1, th => 1, |
tbody => 1, td => 1, tfoot => 1, th => 1, |
| 5934 |
|
|
| 5935 |
## ISSUE: An issue on HTML5 new elements in the spec. |
## ISSUE: An issue on HTML5 new elements in the spec. |
| 5936 |
} else { |
} else { |
| 5937 |
!!!cp ('t402'); |
if ($token->{tag_name} eq 'image') { |
| 5938 |
|
!!!cp ('t384'); |
| 5939 |
|
!!!parse-error (type => 'image'); |
| 5940 |
|
$token->{tag_name} = 'img'; |
| 5941 |
|
} else { |
| 5942 |
|
!!!cp ('t385'); |
| 5943 |
|
} |
| 5944 |
|
|
| 5945 |
|
## NOTE: There is an "as if <br>" code clone. |
| 5946 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 5947 |
|
|
| 5948 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
| 5949 |
|
|
| 5950 |
|
if ({ |
| 5951 |
|
applet => 1, marquee => 1, object => 1, |
| 5952 |
|
}->{$token->{tag_name}}) { |
| 5953 |
|
!!!cp ('t380'); |
| 5954 |
|
push @$active_formatting_elements, ['#marker', '']; |
| 5955 |
|
} elsif ({ |
| 5956 |
|
b => 1, big => 1, em => 1, font => 1, i => 1, |
| 5957 |
|
s => 1, small => 1, strile => 1, |
| 5958 |
|
strong => 1, tt => 1, u => 1, |
| 5959 |
|
}->{$token->{tag_name}}) { |
| 5960 |
|
!!!cp ('t375'); |
| 5961 |
|
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
| 5962 |
|
} elsif ($token->{tag_name} eq 'input') { |
| 5963 |
|
!!!cp ('t388'); |
| 5964 |
|
## TODO: associate with $self->{form_element} if defined |
| 5965 |
|
pop @{$self->{open_elements}}; |
| 5966 |
|
} elsif ({ |
| 5967 |
|
area => 1, basefont => 1, bgsound => 1, br => 1, |
| 5968 |
|
embed => 1, img => 1, param => 1, spacer => 1, wbr => 1, |
| 5969 |
|
#image => 1, |
| 5970 |
|
}->{$token->{tag_name}}) { |
| 5971 |
|
!!!cp ('t388.1'); |
| 5972 |
|
pop @{$self->{open_elements}}; |
| 5973 |
|
} elsif ($token->{tag_name} eq 'select') { |
| 5974 |
|
## TODO: associate with $self->{form_element} if defined |
| 5975 |
|
|
| 5976 |
|
if ($self->{insertion_mode} & TABLE_IMS or |
| 5977 |
|
$self->{insertion_mode} & BODY_TABLE_IMS or |
| 5978 |
|
$self->{insertion_mode} == IN_COLUMN_GROUP_IM) { |
| 5979 |
|
!!!cp ('t400.1'); |
| 5980 |
|
$self->{insertion_mode} = IN_SELECT_IN_TABLE_IM; |
| 5981 |
|
} else { |
| 5982 |
|
!!!cp ('t400.2'); |
| 5983 |
|
$self->{insertion_mode} = IN_SELECT_IM; |
| 5984 |
|
} |
| 5985 |
|
} else { |
| 5986 |
|
!!!cp ('t402'); |
| 5987 |
|
} |
| 5988 |
|
|
| 5989 |
!!!next-token; |
!!!next-token; |
| 5990 |
redo B; |
redo B; |
| 5993 |
if ($token->{tag_name} eq 'body') { |
if ($token->{tag_name} eq 'body') { |
| 5994 |
## has a |body| element in scope |
## has a |body| element in scope |
| 5995 |
my $i; |
my $i; |
| 5996 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: { |
| 5997 |
if ($_->[1] eq 'body') { |
for (reverse @{$self->{open_elements}}) { |
| 5998 |
!!!cp ('t405'); |
if ($_->[1] eq 'body') { |
| 5999 |
$i = $_; |
!!!cp ('t405'); |
| 6000 |
last INSCOPE; |
$i = $_; |
| 6001 |
} elsif ({ |
last INSCOPE; |
| 6002 |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
} elsif ({ |
| 6003 |
button => 1, marquee => 1, object => 1, html => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 6004 |
}->{$_->[1]}) { |
button => 1, marquee => 1, object => 1, html => 1, |
| 6005 |
!!!cp ('t405.1'); |
}->{$_->[1]}) { |
| 6006 |
last INSCOPE; |
!!!cp ('t405.1'); |
| 6007 |
|
last; |
| 6008 |
|
} |
| 6009 |
} |
} |
| 6010 |
} # INSCOPE |
|
| 6011 |
unless (defined $i) { |
!!!parse-error (type => 'start tag not allowed', |
| 6012 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
value => $token->{tag_name}); |
| 6013 |
## NOTE: Ignore the token. |
## NOTE: Ignore the token. |
| 6014 |
!!!next-token; |
!!!next-token; |
| 6015 |
redo B; |
redo B; |
| 6016 |
} |
} # INSCOPE |
| 6017 |
|
|
| 6018 |
for (@{$self->{open_elements}}) { |
for (@{$self->{open_elements}}) { |
| 6019 |
unless ({ |
unless ({ |