6044 |
!!!next-token; |
!!!next-token; |
6045 |
redo B; |
redo B; |
6046 |
} elsif ($token->{tag_name} eq 'form') { |
} elsif ($token->{tag_name} eq 'form') { |
6047 |
|
undef $self->{form_element}; |
6048 |
|
|
6049 |
## has an element in scope |
## has an element in scope |
6050 |
|
my $i; |
6051 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
6052 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
6053 |
if ($node->[1] eq $token->{tag_name}) { |
if ($node->[1] eq $token->{tag_name}) { |
|
## generate implied end tags |
|
|
while ({ |
|
|
dd => 1, dt => 1, li => 1, p => 1, |
|
|
}->{$self->{open_elements}->[-1]->[1]}) { |
|
|
!!!cp ('t417'); |
|
|
pop @{$self->{open_elements}}; |
|
|
} |
|
|
|
|
6054 |
!!!cp ('t418'); |
!!!cp ('t418'); |
6055 |
|
$i = $_; |
6056 |
last INSCOPE; |
last INSCOPE; |
6057 |
} elsif ({ |
} elsif ({ |
6058 |
table => 1, caption => 1, td => 1, th => 1, |
table => 1, caption => 1, td => 1, th => 1, |
6062 |
last INSCOPE; |
last INSCOPE; |
6063 |
} |
} |
6064 |
} # INSCOPE |
} # INSCOPE |
6065 |
|
|
6066 |
if ($self->{open_elements}->[-1]->[1] eq $token->{tag_name}) { |
unless (defined $i) { # has an element in scope |
|
!!!cp ('t420'); |
|
|
pop @{$self->{open_elements}}; |
|
|
} else { |
|
6067 |
!!!cp ('t421'); |
!!!cp ('t421'); |
6068 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
6069 |
|
} else { |
6070 |
|
## Step 1. generate implied end tags |
6071 |
|
while ({ |
6072 |
|
dd => 1, dt => 1, li => 1, p => 1, |
6073 |
|
}->{$self->{open_elements}->[-1]->[1]}) { |
6074 |
|
!!!cp ('t417'); |
6075 |
|
pop @{$self->{open_elements}}; |
6076 |
|
} |
6077 |
|
|
6078 |
|
## Step 2. |
6079 |
|
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6080 |
|
!!!cp ('t417.1'); |
6081 |
|
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
6082 |
|
} else { |
6083 |
|
!!!cp ('t420'); |
6084 |
|
} |
6085 |
|
|
6086 |
|
## Step 3. |
6087 |
|
splice @{$self->{open_elements}}, $i; |
6088 |
} |
} |
6089 |
|
|
|
undef $self->{form_element}; |
|
6090 |
!!!next-token; |
!!!next-token; |
6091 |
redo B; |
redo B; |
6092 |
} elsif ({ |
} elsif ({ |