6911 |
!!!next-token; |
!!!next-token; |
6912 |
next B; |
next B; |
6913 |
} elsif ({ |
} elsif ({ |
6914 |
address => 1, blockquote => 1, center => 1, dir => 1, |
## NOTE: Start tags for non-phrasing flow content elements |
6915 |
div => 1, dl => 1, fieldset => 1, |
|
6916 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
## NOTE: The normal one |
6917 |
menu => 1, ol => 1, p => 1, ul => 1, |
address => 1, article => 1, aside => 1, blockquote => 1, |
6918 |
|
center => 1, datagrid => 1, details => 1, dialog => 1, |
6919 |
|
dir => 1, div => 1, dl => 1, fieldset => 1, figure => 1, |
6920 |
|
footer => 1, h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, |
6921 |
|
h6 => 1, header => 1, menu => 1, nav => 1, ol => 1, p => 1, |
6922 |
|
section => 1, ul => 1, |
6923 |
|
## NOTE: As normal, but drops leading newline |
6924 |
pre => 1, listing => 1, |
pre => 1, listing => 1, |
6925 |
|
## NOTE: As normal, but interacts with the form element pointer |
6926 |
form => 1, |
form => 1, |
6927 |
|
|
6928 |
table => 1, |
table => 1, |
6929 |
hr => 1, |
hr => 1, |
6930 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
6991 |
!!!next-token; |
!!!next-token; |
6992 |
} |
} |
6993 |
next B; |
next B; |
6994 |
} elsif ({li => 1, dt => 1, dd => 1}->{$token->{tag_name}}) { |
} elsif ({ |
6995 |
|
## NOTE: As normal, but imply </li> when there's another <li> |
6996 |
|
li => 1, |
6997 |
|
## NOTE: As normal, but imply </dt> or </dd> when ... |
6998 |
|
dt => 1, dd => 1, |
6999 |
|
}->{$token->{tag_name}}) { |
7000 |
## has a p element in scope |
## has a p element in scope |
7001 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
7002 |
if ($_->[1] & P_EL) { |
if ($_->[1] & P_EL) { |
7071 |
!!!next-token; |
!!!next-token; |
7072 |
next B; |
next B; |
7073 |
} elsif ($token->{tag_name} eq 'plaintext') { |
} elsif ($token->{tag_name} eq 'plaintext') { |
7074 |
|
## NOTE: As normal, but effectively ends parsing |
7075 |
|
|
7076 |
## has a p element in scope |
## has a p element in scope |
7077 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
7078 |
if ($_->[1] & P_EL) { |
if ($_->[1] & P_EL) { |
7509 |
next B; |
next B; |
7510 |
} |
} |
7511 |
} elsif ({ |
} elsif ({ |
7512 |
address => 1, blockquote => 1, center => 1, dir => 1, |
## NOTE: End tags for non-phrasing flow content elements |
7513 |
div => 1, dl => 1, fieldset => 1, listing => 1, |
|
7514 |
menu => 1, ol => 1, pre => 1, ul => 1, |
## NOTE: The normal ones |
7515 |
|
address => 1, article => 1, aside => 1, blockquote => 1, |
7516 |
|
center => 1, datagrid => 1, details => 1, dialog => 1, |
7517 |
|
dir => 1, div => 1, dl => 1, fieldset => 1, figure => 1, |
7518 |
|
footer => 1, header => 1, listing => 1, menu => 1, nav => 1, |
7519 |
|
ol => 1, pre => 1, section => 1, ul => 1, |
7520 |
|
|
7521 |
|
## NOTE: As normal, but ... optional tags |
7522 |
dd => 1, dt => 1, li => 1, |
dd => 1, dt => 1, li => 1, |
7523 |
|
|
7524 |
applet => 1, button => 1, marquee => 1, object => 1, |
applet => 1, button => 1, marquee => 1, object => 1, |
7525 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
7526 |
## has an element in scope |
## has an element in scope |
7583 |
!!!next-token; |
!!!next-token; |
7584 |
next B; |
next B; |
7585 |
} elsif ($token->{tag_name} eq 'form') { |
} elsif ($token->{tag_name} eq 'form') { |
7586 |
|
## NOTE: As normal, but interacts with the form element pointer |
7587 |
|
|
7588 |
undef $self->{form_element}; |
undef $self->{form_element}; |
7589 |
|
|
7590 |
## has an element in scope |
## has an element in scope |
7632 |
!!!next-token; |
!!!next-token; |
7633 |
next B; |
next B; |
7634 |
} elsif ({ |
} elsif ({ |
7635 |
|
## NOTE: As normal, except acts as a closer for any ... |
7636 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
7637 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
7638 |
## has an element in scope |
## has an element in scope |
7678 |
!!!next-token; |
!!!next-token; |
7679 |
next B; |
next B; |
7680 |
} elsif ($token->{tag_name} eq 'p') { |
} elsif ($token->{tag_name} eq 'p') { |
7681 |
|
## NOTE: As normal, except </p> implies <p> and ... |
7682 |
|
|
7683 |
## has an element in scope |
## has an element in scope |
7684 |
my $i; |
my $i; |
7685 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
7764 |
## Ignore the token |
## Ignore the token |
7765 |
!!!next-token; |
!!!next-token; |
7766 |
next B; |
next B; |
|
|
|
|
## ISSUE: Issue on HTML5 new elements in spec |
|
|
|
|
7767 |
} else { |
} else { |
7768 |
|
if ($token->{tag_name} eq 'sarcasm') { |
7769 |
|
sleep 0.001; # take a deep breath |
7770 |
|
} |
7771 |
|
|
7772 |
## Step 1 |
## Step 1 |
7773 |
my $node_i = -1; |
my $node_i = -1; |
7774 |
my $node = $self->{open_elements}->[$node_i]; |
my $node = $self->{open_elements}->[$node_i]; |