| 74 |
textarea => 1, tfoot => 1, thead => 1, title => 1, tr => 1, ul => 1, wbr => 1, |
textarea => 1, tfoot => 1, thead => 1, title => 1, tr => 1, ul => 1, wbr => 1, |
| 75 |
}; |
}; |
| 76 |
my $scoping_category = { |
my $scoping_category = { |
| 77 |
button => 1, caption => 1, html => 1, marquee => 1, object => 1, |
applet => 1, button => 1, caption => 1, html => 1, marquee => 1, object => 1, |
| 78 |
table => 1, td => 1, th => 1, |
table => 1, td => 1, th => 1, |
| 79 |
}; |
}; |
| 80 |
my $formatting_category = { |
my $formatting_category = { |
| 303 |
sub ROW_IMS () { 0b10000000 } |
sub ROW_IMS () { 0b10000000 } |
| 304 |
sub BODY_AFTER_IMS () { 0b100000000 } |
sub BODY_AFTER_IMS () { 0b100000000 } |
| 305 |
sub FRAME_IMS () { 0b1000000000 } |
sub FRAME_IMS () { 0b1000000000 } |
| 306 |
|
sub SELECT_IMS () { 0b10000000000 } |
| 307 |
|
|
| 308 |
## NOTE: "initial" and "before html" insertion modes have no constants. |
## NOTE: "initial" and "before html" insertion modes have no constants. |
| 309 |
|
|
| 326 |
sub AFTER_BODY_IM () { BODY_AFTER_IMS } |
sub AFTER_BODY_IM () { BODY_AFTER_IMS } |
| 327 |
sub IN_FRAMESET_IM () { FRAME_IMS | 0b01 } |
sub IN_FRAMESET_IM () { FRAME_IMS | 0b01 } |
| 328 |
sub AFTER_FRAMESET_IM () { FRAME_IMS | 0b10 } |
sub AFTER_FRAMESET_IM () { FRAME_IMS | 0b10 } |
| 329 |
sub IN_SELECT_IM () { 0b01 } |
sub IN_SELECT_IM () { SELECT_IMS | 0b01 } |
| 330 |
|
sub IN_SELECT_IN_TABLE_IM () { SELECT_IMS | 0b10 } |
| 331 |
sub IN_COLUMN_GROUP_IM () { 0b10 } |
sub IN_COLUMN_GROUP_IM () { 0b10 } |
| 332 |
|
|
| 333 |
## Implementations MUST act as if state machine in the spec |
## Implementations MUST act as if state machine in the spec |
| 3012 |
!!!next-token; |
!!!next-token; |
| 3013 |
}; # $script_start_tag |
}; # $script_start_tag |
| 3014 |
|
|
| 3015 |
|
## NOTE: $open_tables->[-1]->[0] is the "current table" element node. |
| 3016 |
|
## NOTE: $open_tables->[-1]->[1] is the "tainted" flag. |
| 3017 |
|
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
| 3018 |
|
|
| 3019 |
my $formatting_end_tag = sub { |
my $formatting_end_tag = sub { |
| 3020 |
my $tag_name = shift; |
my $tag_name = shift; |
| 3021 |
|
|
| 3022 |
|
## NOTE: The adoption agency algorithm (AAA). |
| 3023 |
|
|
| 3024 |
FET: { |
FET: { |
| 3025 |
## Step 1 |
## Step 1 |
| 3026 |
my $formatting_element; |
my $formatting_element; |
| 3061 |
return; |
return; |
| 3062 |
} |
} |
| 3063 |
} elsif ({ |
} elsif ({ |
| 3064 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 3065 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 3066 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 3067 |
!!!cp ('t56'); |
!!!cp ('t56'); |
| 3088 |
if (not $formatting_category->{$node->[1]} and |
if (not $formatting_category->{$node->[1]} and |
| 3089 |
#not $phrasing_category->{$node->[1]} and |
#not $phrasing_category->{$node->[1]} and |
| 3090 |
($special_category->{$node->[1]} or |
($special_category->{$node->[1]} or |
| 3091 |
$scoping_category->{$node->[1]})) { |
$scoping_category->{$node->[1]})) { ## Scoping is redundant, maybe |
| 3092 |
!!!cp ('t59'); |
!!!cp ('t59'); |
| 3093 |
$furthest_block = $node; |
$furthest_block = $node; |
| 3094 |
$furthest_block_i_in_open = $_; |
$furthest_block_i_in_open = $_; |
| 3174 |
} # S7 |
} # S7 |
| 3175 |
|
|
| 3176 |
## Step 8 |
## Step 8 |
| 3177 |
$common_ancestor_node->[0]->append_child ($last_node->[0]); |
if ({ |
| 3178 |
|
table => 1, tbody => 1, tfoot => 1, thead => 1, tr => 1, |
| 3179 |
|
}->{$common_ancestor_node->[1]}) { |
| 3180 |
|
my $foster_parent_element; |
| 3181 |
|
my $next_sibling; |
| 3182 |
|
OE: for (reverse 0..$#{$self->{open_elements}}) { |
| 3183 |
|
if ($self->{open_elements}->[$_]->[1] eq 'table') { |
| 3184 |
|
my $parent = $self->{open_elements}->[$_]->[0]->parent_node; |
| 3185 |
|
if (defined $parent and $parent->node_type == 1) { |
| 3186 |
|
!!!cp ('t65.1'); |
| 3187 |
|
$foster_parent_element = $parent; |
| 3188 |
|
$next_sibling = $self->{open_elements}->[$_]->[0]; |
| 3189 |
|
} else { |
| 3190 |
|
!!!cp ('t65.2'); |
| 3191 |
|
$foster_parent_element |
| 3192 |
|
= $self->{open_elements}->[$_ - 1]->[0]; |
| 3193 |
|
} |
| 3194 |
|
last OE; |
| 3195 |
|
} |
| 3196 |
|
} # OE |
| 3197 |
|
$foster_parent_element = $self->{open_elements}->[0]->[0] |
| 3198 |
|
unless defined $foster_parent_element; |
| 3199 |
|
$foster_parent_element->insert_before ($last_node->[0], $next_sibling); |
| 3200 |
|
$open_tables->[-1]->[1] = 1; # tainted |
| 3201 |
|
} else { |
| 3202 |
|
!!!cp ('t65.3'); |
| 3203 |
|
$common_ancestor_node->[0]->append_child ($last_node->[0]); |
| 3204 |
|
} |
| 3205 |
|
|
| 3206 |
## Step 9 |
## Step 9 |
| 3207 |
my $clone = [$formatting_element->[0]->clone_node (0), |
my $clone = [$formatting_element->[0]->clone_node (0), |
| 3247 |
} # FET |
} # FET |
| 3248 |
}; # $formatting_end_tag |
}; # $formatting_end_tag |
| 3249 |
|
|
|
## NOTE: $open_tables->[-1]->[0] is the "current table". |
|
|
## NOTE: $open_tables->[-1]->[1] is the "tainted" flag. |
|
|
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
|
|
|
|
| 3250 |
$insert = my $insert_to_current = sub { |
$insert = my $insert_to_current = sub { |
| 3251 |
$self->{open_elements}->[-1]->[0]->append_child ($_[0]); |
$self->{open_elements}->[-1]->[0]->append_child ($_[0]); |
| 3252 |
}; # $insert_to_current |
}; # $insert_to_current |
| 3293 |
## Stay in the phase |
## Stay in the phase |
| 3294 |
!!!next-token; |
!!!next-token; |
| 3295 |
redo B; |
redo B; |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
|
|
if ($self->{insertion_mode} & AFTER_HTML_IMS) { |
|
|
!!!cp ('t74'); |
|
|
# |
|
|
} else { |
|
|
## Generate implied end tags |
|
|
while ({ |
|
|
dd => 1, dt => 1, li => 1, p => 1, |
|
|
}->{$self->{open_elements}->[-1]->[1]}) { |
|
|
!!!cp ('t75'); |
|
|
pop @{$self->{open_elements}}; |
|
|
} |
|
|
|
|
|
if (@{$self->{open_elements}} > 2 or |
|
|
(@{$self->{open_elements}} == 2 and $self->{open_elements}->[1]->[1] ne 'body')) { |
|
|
!!!cp ('t76'); |
|
|
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
|
|
} elsif (defined $self->{inner_html_node} and |
|
|
@{$self->{open_elements}} > 1 and |
|
|
$self->{open_elements}->[1]->[1] ne 'body') { |
|
|
## ISSUE: This case is never reached. |
|
|
!!!cp ('t77'); |
|
|
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
|
|
} else { |
|
|
!!!cp ('t78'); |
|
|
} |
|
|
|
|
|
## ISSUE: There is an issue in the spec. |
|
|
} |
|
|
|
|
|
## Stop parsing |
|
|
last B; |
|
| 3296 |
} elsif ($token->{type} == START_TAG_TOKEN and |
} elsif ($token->{type} == START_TAG_TOKEN and |
| 3297 |
$token->{tag_name} eq 'html') { |
$token->{tag_name} eq 'html') { |
| 3298 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 3811 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3812 |
## reprocess |
## reprocess |
| 3813 |
redo B; |
redo B; |
| 3814 |
} else { |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 3815 |
die "$0: $token->{type}: Unknown token type"; |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3816 |
} |
!!!cp ('t149.1'); |
| 3817 |
|
|
| 3818 |
|
## NOTE: As if <head> |
| 3819 |
|
!!!create-element ($self->{head_element}, 'head'); |
| 3820 |
|
$self->{open_elements}->[-1]->[0]->append_child |
| 3821 |
|
($self->{head_element}); |
| 3822 |
|
#push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3823 |
|
#$self->{insertion_mode} = IN_HEAD_IM; |
| 3824 |
|
## NOTE: Reprocess. |
| 3825 |
|
|
| 3826 |
|
## NOTE: As if </head> |
| 3827 |
|
#pop @{$self->{open_elements}}; |
| 3828 |
|
#$self->{insertion_mode} = IN_AFTER_HEAD_IM; |
| 3829 |
|
## NOTE: Reprocess. |
| 3830 |
|
|
| 3831 |
|
# |
| 3832 |
|
} elsif ($self->{insertion_mode} == IN_HEAD_IM) { |
| 3833 |
|
!!!cp ('t149.2'); |
| 3834 |
|
|
| 3835 |
|
## NOTE: As if </head> |
| 3836 |
|
pop @{$self->{open_elements}}; |
| 3837 |
|
#$self->{insertion_mode} = IN_AFTER_HEAD_IM; |
| 3838 |
|
## NOTE: Reprocess. |
| 3839 |
|
|
| 3840 |
|
# |
| 3841 |
|
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 3842 |
|
!!!cp ('t149.3'); |
| 3843 |
|
|
| 3844 |
|
!!!parse-error (type => 'in noscript:#eof'); |
| 3845 |
|
|
| 3846 |
|
## As if </noscript> |
| 3847 |
|
pop @{$self->{open_elements}}; |
| 3848 |
|
#$self->{insertion_mode} = IN_HEAD_IM; |
| 3849 |
|
## NOTE: Reprocess. |
| 3850 |
|
|
| 3851 |
|
## NOTE: As if </head> |
| 3852 |
|
pop @{$self->{open_elements}}; |
| 3853 |
|
#$self->{insertion_mode} = IN_AFTER_HEAD_IM; |
| 3854 |
|
## NOTE: Reprocess. |
| 3855 |
|
|
| 3856 |
|
# |
| 3857 |
|
} else { |
| 3858 |
|
!!!cp ('t149.4'); |
| 3859 |
|
# |
| 3860 |
|
} |
| 3861 |
|
|
| 3862 |
|
## NOTE: As if <body> |
| 3863 |
|
!!!insert-element ('body'); |
| 3864 |
|
$self->{insertion_mode} = IN_BODY_IM; |
| 3865 |
|
## NOTE: Reprocess. |
| 3866 |
|
redo B; |
| 3867 |
|
} else { |
| 3868 |
|
die "$0: $token->{type}: Unknown token type"; |
| 3869 |
|
} |
| 3870 |
|
|
| 3871 |
## ISSUE: An issue in the spec. |
## ISSUE: An issue in the spec. |
| 3872 |
} elsif ($self->{insertion_mode} & BODY_IMS) { |
} elsif ($self->{insertion_mode} & BODY_IMS) { |
| 4208 |
!!!cp ('t193'); |
!!!cp ('t193'); |
| 4209 |
# |
# |
| 4210 |
} |
} |
| 4211 |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 4212 |
|
for my $entry (@{$self->{open_elements}}) { |
| 4213 |
|
if (not { |
| 4214 |
|
dd => 1, dt => 1, li => 1, p => 1, tbody => 1, td => 1, tfoot => 1, |
| 4215 |
|
th => 1, thead => 1, tr => 1, body => 1, html => 1, |
| 4216 |
|
}->{$entry->[1]}) { |
| 4217 |
|
!!!cp ('t75'); |
| 4218 |
|
!!!parse-error (type => 'in body:#eof'); |
| 4219 |
|
last; |
| 4220 |
|
} |
| 4221 |
|
} |
| 4222 |
|
|
| 4223 |
|
## Stop parsing. |
| 4224 |
|
last B; |
| 4225 |
} else { |
} else { |
| 4226 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 4227 |
} |
} |
| 4898 |
$insert = $insert_to_foster; |
$insert = $insert_to_foster; |
| 4899 |
# |
# |
| 4900 |
} |
} |
| 4901 |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 4902 |
|
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 4903 |
|
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 4904 |
|
!!!cp ('t259.1'); |
| 4905 |
|
!!!parse-error (type => 'in body:#eof'); |
| 4906 |
|
} else { |
| 4907 |
|
!!!cp ('t259.2'); |
| 4908 |
|
} |
| 4909 |
|
|
| 4910 |
|
## Stop parsing |
| 4911 |
|
last B; |
| 4912 |
} else { |
} else { |
| 4913 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 4914 |
} |
} |
| 4961 |
!!!cp ('t267'); |
!!!cp ('t267'); |
| 4962 |
# |
# |
| 4963 |
} |
} |
| 4964 |
} else { |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 4965 |
die "$0: $token->{type}: Unknown token type"; |
if ($self->{open_elements}->[-1]->[1] eq 'html' or |
| 4966 |
} |
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 4967 |
|
!!!cp ('t270.2'); |
| 4968 |
|
## Stop parsing. |
| 4969 |
|
last B; |
| 4970 |
|
} else { |
| 4971 |
|
## NOTE: As if </colgroup>. |
| 4972 |
|
!!!cp ('t270.1'); |
| 4973 |
|
pop @{$self->{open_elements}}; # colgroup |
| 4974 |
|
$self->{insertion_mode} = IN_TABLE_IM; |
| 4975 |
|
## Reprocess. |
| 4976 |
|
redo B; |
| 4977 |
|
} |
| 4978 |
|
} else { |
| 4979 |
|
die "$0: $token->{type}: Unknown token type"; |
| 4980 |
|
} |
| 4981 |
|
|
| 4982 |
## As if </colgroup> |
## As if </colgroup> |
| 4983 |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
| 4984 |
!!!cp ('t269'); |
!!!cp ('t269'); |
| 4985 |
|
## TODO: Wrong error type? |
| 4986 |
!!!parse-error (type => 'unmatched end tag:colgroup'); |
!!!parse-error (type => 'unmatched end tag:colgroup'); |
| 4987 |
## Ignore the token |
## Ignore the token |
| 4988 |
!!!next-token; |
!!!next-token; |
| 4994 |
## reprocess |
## reprocess |
| 4995 |
redo B; |
redo B; |
| 4996 |
} |
} |
| 4997 |
} elsif ($self->{insertion_mode} == IN_SELECT_IM) { |
} elsif ($self->{insertion_mode} & SELECT_IMS) { |
| 4998 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 4999 |
!!!cp ('t271'); |
!!!cp ('t271'); |
| 5000 |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($token->{data}); |
$self->{open_elements}->[-1]->[0]->manakai_append_text ($token->{data}); |
| 5033 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
| 5034 |
!!!next-token; |
!!!next-token; |
| 5035 |
redo B; |
redo B; |
| 5036 |
} elsif ($token->{tag_name} eq 'select') { |
} elsif ($token->{tag_name} eq 'select' or |
| 5037 |
## TODO: The type below is not good - <select> is replaced by </select> |
$token->{tag_name} eq 'input' or |
| 5038 |
!!!parse-error (type => 'not closed:select'); |
($self->{insertion_mode} == IN_SELECT_IN_TABLE_IM and |
| 5039 |
## As if </select> instead |
{ |
| 5040 |
|
caption => 1, table => 1, |
| 5041 |
|
tbody => 1, tfoot => 1, thead => 1, |
| 5042 |
|
tr => 1, td => 1, th => 1, |
| 5043 |
|
}->{$token->{tag_name}})) { |
| 5044 |
|
## TODO: The type below is not good - <select> is replaced by </select> |
| 5045 |
|
!!!parse-error (type => 'not closed:select'); |
| 5046 |
|
## NOTE: As if the token were </select> (<select> case) or |
| 5047 |
|
## as if there were </select> (otherwise). |
| 5048 |
## have an element in table scope |
## have an element in table scope |
| 5049 |
my $i; |
my $i; |
| 5050 |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 5051 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
| 5052 |
if ($node->[1] eq $token->{tag_name}) { |
if ($node->[1] eq 'select') { |
| 5053 |
!!!cp ('t278'); |
!!!cp ('t278'); |
| 5054 |
$i = $_; |
$i = $_; |
| 5055 |
last INSCOPE; |
last INSCOPE; |
| 5073 |
|
|
| 5074 |
$self->_reset_insertion_mode; |
$self->_reset_insertion_mode; |
| 5075 |
|
|
| 5076 |
!!!next-token; |
if ($token->{tag_name} eq 'select') { |
| 5077 |
redo B; |
!!!cp ('t281.2'); |
| 5078 |
|
!!!next-token; |
| 5079 |
|
redo B; |
| 5080 |
|
} else { |
| 5081 |
|
!!!cp ('t281.1'); |
| 5082 |
|
## Reprocess the token. |
| 5083 |
|
redo B; |
| 5084 |
|
} |
| 5085 |
} else { |
} else { |
| 5086 |
!!!cp ('t282'); |
!!!cp ('t282'); |
| 5087 |
!!!parse-error (type => 'in select:'.$token->{tag_name}); |
!!!parse-error (type => 'in select:'.$token->{tag_name}); |
| 5148 |
|
|
| 5149 |
!!!next-token; |
!!!next-token; |
| 5150 |
redo B; |
redo B; |
| 5151 |
} elsif ({ |
} elsif ($self->{insertion_mode} == IN_SELECT_IN_TABLE_IM and |
| 5152 |
caption => 1, table => 1, tbody => 1, |
{ |
| 5153 |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
caption => 1, table => 1, tbody => 1, |
| 5154 |
}->{$token->{tag_name}}) { |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
| 5155 |
|
}->{$token->{tag_name}}) { |
| 5156 |
## TODO: The following is wrong? |
## TODO: The following is wrong? |
| 5157 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
| 5158 |
|
|
| 5218 |
!!!next-token; |
!!!next-token; |
| 5219 |
redo B; |
redo B; |
| 5220 |
} |
} |
| 5221 |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 5222 |
|
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 5223 |
|
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 5224 |
|
!!!cp ('t299.1'); |
| 5225 |
|
!!!parse-error (type => 'in body:#eof'); |
| 5226 |
|
} else { |
| 5227 |
|
!!!cp ('t299.2'); |
| 5228 |
|
} |
| 5229 |
|
|
| 5230 |
|
## Stop parsing. |
| 5231 |
|
last B; |
| 5232 |
} else { |
} else { |
| 5233 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 5234 |
} |
} |
| 5312 |
## reprocess |
## reprocess |
| 5313 |
redo B; |
redo B; |
| 5314 |
} |
} |
| 5315 |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 5316 |
|
!!!cp ('t309.2'); |
| 5317 |
|
## Stop parsing |
| 5318 |
|
last B; |
| 5319 |
} else { |
} else { |
| 5320 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 5321 |
} |
} |
| 5451 |
!!!next-token; |
!!!next-token; |
| 5452 |
redo B; |
redo B; |
| 5453 |
} |
} |
| 5454 |
|
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 5455 |
|
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 5456 |
|
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 5457 |
|
!!!cp ('t331.1'); |
| 5458 |
|
!!!parse-error (type => 'in body:#eof'); |
| 5459 |
|
} else { |
| 5460 |
|
!!!cp ('t331.2'); |
| 5461 |
|
} |
| 5462 |
|
|
| 5463 |
|
## Stop parsing |
| 5464 |
|
last B; |
| 5465 |
} else { |
} else { |
| 5466 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 5467 |
} |
} |
| 5582 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5583 |
redo B; |
redo B; |
| 5584 |
} elsif ({ |
} elsif ({ |
| 5585 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5586 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5587 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5588 |
!!!cp ('t345'); |
!!!cp ('t345'); |
| 5625 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5626 |
redo B; |
redo B; |
| 5627 |
} elsif ({ |
} elsif ({ |
| 5628 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5629 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5630 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5631 |
!!!cp ('t352'); |
!!!cp ('t352'); |
| 5647 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5648 |
redo B; |
redo B; |
| 5649 |
} elsif ({ |
} elsif ({ |
| 5650 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5651 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5652 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5653 |
!!!cp ('t354'); |
!!!cp ('t354'); |
| 5703 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5704 |
redo B; |
redo B; |
| 5705 |
} elsif ({ |
} elsif ({ |
| 5706 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5707 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5708 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5709 |
!!!cp ('t361'); |
!!!cp ('t361'); |
| 5759 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5760 |
redo B; |
redo B; |
| 5761 |
} elsif ({ |
} elsif ({ |
| 5762 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5763 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5764 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5765 |
!!!cp ('t368'); |
!!!cp ('t368'); |
| 5838 |
$token = {type => END_TAG_TOKEN, tag_name => 'nobr'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'nobr'}; |
| 5839 |
redo B; |
redo B; |
| 5840 |
} elsif ({ |
} elsif ({ |
| 5841 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5842 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5843 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 5844 |
!!!cp ('t377'); |
!!!cp ('t377'); |
| 5862 |
$token = {type => END_TAG_TOKEN, tag_name => 'button'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'button'}; |
| 5863 |
redo B; |
redo B; |
| 5864 |
} elsif ({ |
} elsif ({ |
| 5865 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5866 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5867 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 5868 |
!!!cp ('t379'); |
!!!cp ('t379'); |
| 5880 |
|
|
| 5881 |
!!!next-token; |
!!!next-token; |
| 5882 |
redo B; |
redo B; |
| 5883 |
} elsif ($token->{tag_name} eq 'marquee' or |
} elsif ({ |
| 5884 |
$token->{tag_name} eq 'object') { |
applet => 1, marquee => 1, object => 1, |
| 5885 |
|
}->{$token->{tag_name}}) { |
| 5886 |
!!!cp ('t380'); |
!!!cp ('t380'); |
| 5887 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 5888 |
|
|
| 5905 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5906 |
redo B; |
redo B; |
| 5907 |
} elsif ({ |
} elsif ({ |
| 5908 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5909 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5910 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5911 |
!!!cp ('t383'); |
!!!cp ('t383'); |
| 5950 |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'p'}; |
| 5951 |
redo B; |
redo B; |
| 5952 |
} elsif ({ |
} elsif ({ |
| 5953 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 5954 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 5955 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 5956 |
!!!cp ('t387'); |
!!!cp ('t387'); |
| 6080 |
|
|
| 6081 |
## TODO: associate with $self->{form_element} if defined |
## TODO: associate with $self->{form_element} if defined |
| 6082 |
|
|
| 6083 |
$self->{insertion_mode} = IN_SELECT_IM; |
if ($self->{insertion_mode} & TABLE_IMS or |
| 6084 |
|
$self->{insertion_mode} & BODY_TABLE_IMS or |
| 6085 |
|
$self->{insertion_mode} == IN_COLUMN_GROUP_IM) { |
| 6086 |
|
!!!cp ('t400.1'); |
| 6087 |
|
$self->{insertion_mode} = IN_SELECT_IN_TABLE_IM; |
| 6088 |
|
} else { |
| 6089 |
|
!!!cp ('t400.2'); |
| 6090 |
|
$self->{insertion_mode} = IN_SELECT_IM; |
| 6091 |
|
} |
| 6092 |
!!!next-token; |
!!!next-token; |
| 6093 |
redo B; |
redo B; |
| 6094 |
} elsif ({ |
} elsif ({ |
| 6164 |
div => 1, dl => 1, fieldset => 1, listing => 1, |
div => 1, dl => 1, fieldset => 1, listing => 1, |
| 6165 |
menu => 1, ol => 1, pre => 1, ul => 1, |
menu => 1, ol => 1, pre => 1, ul => 1, |
| 6166 |
dd => 1, dt => 1, li => 1, |
dd => 1, dt => 1, li => 1, |
| 6167 |
button => 1, marquee => 1, object => 1, |
applet => 1, button => 1, marquee => 1, object => 1, |
| 6168 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6169 |
## has an element in scope |
## has an element in scope |
| 6170 |
my $i; |
my $i; |
| 6175 |
$i = $_; |
$i = $_; |
| 6176 |
last INSCOPE; |
last INSCOPE; |
| 6177 |
} elsif ({ |
} elsif ({ |
| 6178 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 6179 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 6180 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 6181 |
!!!cp ('t411'); |
!!!cp ('t411'); |
| 6212 |
## Step 4. |
## Step 4. |
| 6213 |
$clear_up_to_marker->() |
$clear_up_to_marker->() |
| 6214 |
if { |
if { |
| 6215 |
button => 1, marquee => 1, object => 1, |
applet => 1, button => 1, marquee => 1, object => 1, |
| 6216 |
}->{$token->{tag_name}}; |
}->{$token->{tag_name}}; |
| 6217 |
} |
} |
| 6218 |
!!!next-token; |
!!!next-token; |
| 6229 |
$i = $_; |
$i = $_; |
| 6230 |
last INSCOPE; |
last INSCOPE; |
| 6231 |
} elsif ({ |
} elsif ({ |
| 6232 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 6233 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 6234 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 6235 |
!!!cp ('t419'); |
!!!cp ('t419'); |
| 6277 |
$i = $_; |
$i = $_; |
| 6278 |
last INSCOPE; |
last INSCOPE; |
| 6279 |
} elsif ({ |
} elsif ({ |
| 6280 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 6281 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 6282 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 6283 |
!!!cp ('t424'); |
!!!cp ('t424'); |
| 6321 |
$i = $_; |
$i = $_; |
| 6322 |
last INSCOPE; |
last INSCOPE; |
| 6323 |
} elsif ({ |
} elsif ({ |
| 6324 |
table => 1, caption => 1, td => 1, th => 1, |
applet => 1, table => 1, caption => 1, td => 1, th => 1, |
| 6325 |
button => 1, marquee => 1, object => 1, html => 1, |
button => 1, marquee => 1, object => 1, html => 1, |
| 6326 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
| 6327 |
!!!cp ('t411.1'); |
!!!cp ('t411.1'); |