5997 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
5998 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
5999 |
if ($node->[1] eq $token->{tag_name}) { |
if ($node->[1] eq $token->{tag_name}) { |
|
## generate implied end tags |
|
|
while ({ |
|
|
dd => ($token->{tag_name} ne 'dd'), |
|
|
dt => ($token->{tag_name} ne 'dt'), |
|
|
li => ($token->{tag_name} ne 'li'), |
|
|
p => 1, |
|
|
}->{$self->{open_elements}->[-1]->[1]}) { |
|
|
!!!cp ('t409'); |
|
|
pop @{$self->{open_elements}}; |
|
|
} |
|
|
|
|
6000 |
!!!cp ('t410'); |
!!!cp ('t410'); |
6001 |
$i = $_; |
$i = $_; |
6002 |
last INSCOPE; |
last INSCOPE; |
6008 |
last INSCOPE; |
last INSCOPE; |
6009 |
} |
} |
6010 |
} # INSCOPE |
} # INSCOPE |
6011 |
|
|
6012 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
unless (defined $i) { # has an element in scope |
6013 |
if (defined $i) { |
!!!cp ('t413'); |
6014 |
|
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
6015 |
|
} else { |
6016 |
|
## Step 1. generate implied end tags |
6017 |
|
while ({ |
6018 |
|
dd => ($token->{tag_name} ne 'dd'), |
6019 |
|
dt => ($token->{tag_name} ne 'dt'), |
6020 |
|
li => ($token->{tag_name} ne 'li'), |
6021 |
|
p => 1, |
6022 |
|
}->{$self->{open_elements}->[-1]->[1]}) { |
6023 |
|
!!!cp ('t409'); |
6024 |
|
pop @{$self->{open_elements}}; |
6025 |
|
} |
6026 |
|
|
6027 |
|
## Step 2. |
6028 |
|
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6029 |
!!!cp ('t412'); |
!!!cp ('t412'); |
6030 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
6031 |
} else { |
} else { |
6032 |
!!!cp ('t413'); |
!!!cp ('t414'); |
|
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
|
6033 |
} |
} |
6034 |
} |
|
6035 |
|
## Step 3. |
|
if (defined $i) { |
|
|
!!!cp ('t414'); |
|
6036 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
6037 |
} else { |
|
6038 |
!!!cp ('t416'); |
## Step 4. |
6039 |
|
$clear_up_to_marker->() |
6040 |
|
if { |
6041 |
|
button => 1, marquee => 1, object => 1, |
6042 |
|
}->{$token->{tag_name}}; |
6043 |
} |
} |
|
$clear_up_to_marker->() |
|
|
if { |
|
|
button => 1, marquee => 1, object => 1, |
|
|
}->{$token->{tag_name}}; |
|
6044 |
!!!next-token; |
!!!next-token; |
6045 |
redo B; |
redo B; |
6046 |
} elsif ($token->{tag_name} eq 'form') { |
} elsif ($token->{tag_name} eq 'form') { |