5989 |
address => 1, blockquote => 1, center => 1, dir => 1, |
address => 1, blockquote => 1, center => 1, dir => 1, |
5990 |
div => 1, dl => 1, fieldset => 1, listing => 1, |
div => 1, dl => 1, fieldset => 1, listing => 1, |
5991 |
menu => 1, ol => 1, pre => 1, ul => 1, |
menu => 1, ol => 1, pre => 1, ul => 1, |
|
p => 1, |
|
5992 |
dd => 1, dt => 1, li => 1, |
dd => 1, dt => 1, li => 1, |
5993 |
button => 1, marquee => 1, object => 1, |
button => 1, marquee => 1, object => 1, |
5994 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
6002 |
dd => ($token->{tag_name} ne 'dd'), |
dd => ($token->{tag_name} ne 'dd'), |
6003 |
dt => ($token->{tag_name} ne 'dt'), |
dt => ($token->{tag_name} ne 'dt'), |
6004 |
li => ($token->{tag_name} ne 'li'), |
li => ($token->{tag_name} ne 'li'), |
6005 |
p => ($token->{tag_name} ne 'p'), |
p => 1, |
6006 |
}->{$self->{open_elements}->[-1]->[1]}) { |
}->{$self->{open_elements}->[-1]->[1]}) { |
6007 |
!!!cp ('t409'); |
!!!cp ('t409'); |
6008 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
6010 |
|
|
6011 |
!!!cp ('t410'); |
!!!cp ('t410'); |
6012 |
$i = $_; |
$i = $_; |
6013 |
last INSCOPE unless $token->{tag_name} eq 'p'; |
last INSCOPE; |
6014 |
} elsif ({ |
} elsif ({ |
6015 |
table => 1, caption => 1, td => 1, th => 1, |
table => 1, caption => 1, td => 1, th => 1, |
6016 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
6033 |
if (defined $i) { |
if (defined $i) { |
6034 |
!!!cp ('t414'); |
!!!cp ('t414'); |
6035 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
|
} elsif ($token->{tag_name} eq 'p') { |
|
|
!!!cp ('t415'); |
|
|
## As if <p>, then reprocess the current token |
|
|
my $el; |
|
|
!!!create-element ($el, 'p'); |
|
|
$insert->($el); |
|
6036 |
} else { |
} else { |
6037 |
!!!cp ('t416'); |
!!!cp ('t416'); |
6038 |
} |
} |
6117 |
splice @{$self->{open_elements}}, $i if defined $i; |
splice @{$self->{open_elements}}, $i if defined $i; |
6118 |
!!!next-token; |
!!!next-token; |
6119 |
redo B; |
redo B; |
6120 |
|
} elsif ($token->{tag_name} eq 'p') { |
6121 |
|
## has an element in scope |
6122 |
|
my $i; |
6123 |
|
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
6124 |
|
my $node = $self->{open_elements}->[$_]; |
6125 |
|
if ($node->[1] eq $token->{tag_name}) { |
6126 |
|
## generate implied end tags |
6127 |
|
while ({ |
6128 |
|
dd => 1, dt => 1, li => 1, p => 0, |
6129 |
|
}->{$self->{open_elements}->[-1]->[1]}) { |
6130 |
|
!!!cp ('t409.1'); |
6131 |
|
pop @{$self->{open_elements}}; |
6132 |
|
} |
6133 |
|
|
6134 |
|
!!!cp ('t410.1'); |
6135 |
|
$i = $_; |
6136 |
|
last INSCOPE unless $token->{tag_name} eq 'p'; |
6137 |
|
} elsif ({ |
6138 |
|
table => 1, caption => 1, td => 1, th => 1, |
6139 |
|
button => 1, marquee => 1, object => 1, html => 1, |
6140 |
|
}->{$node->[1]}) { |
6141 |
|
!!!cp ('t411.1'); |
6142 |
|
last INSCOPE; |
6143 |
|
} |
6144 |
|
} # INSCOPE |
6145 |
|
|
6146 |
|
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6147 |
|
if (defined $i) { |
6148 |
|
!!!cp ('t412.1'); |
6149 |
|
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
6150 |
|
} else { |
6151 |
|
!!!cp ('t413.1'); |
6152 |
|
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
6153 |
|
} |
6154 |
|
} |
6155 |
|
|
6156 |
|
if (defined $i) { |
6157 |
|
!!!cp ('t414.1'); |
6158 |
|
splice @{$self->{open_elements}}, $i; |
6159 |
|
} else { |
6160 |
|
!!!cp ('t415.1'); |
6161 |
|
## As if <p>, then reprocess the current token |
6162 |
|
my $el; |
6163 |
|
!!!create-element ($el, 'p'); |
6164 |
|
$insert->($el); |
6165 |
|
} |
6166 |
|
!!!next-token; |
6167 |
|
redo B; |
6168 |
} elsif ({ |
} elsif ({ |
6169 |
a => 1, |
a => 1, |
6170 |
b => 1, big => 1, em => 1, font => 1, i => 1, |
b => 1, big => 1, em => 1, font => 1, i => 1, |