| 578 |
die "$0: $self->{content_model} in tag open"; |
die "$0: $self->{content_model} in tag open"; |
| 579 |
} |
} |
| 580 |
} elsif ($self->{state} == CLOSE_TAG_OPEN_STATE) { |
} elsif ($self->{state} == CLOSE_TAG_OPEN_STATE) { |
| 581 |
my ($l, $c) = ($self->{line_prev}, $self->{column_prev}); |
my ($l, $c) = ($self->{line_prev}, $self->{column_prev} - 1); # "<"of"</" |
| 582 |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
if ($self->{content_model} & CM_LIMITED_MARKUP) { # RCDATA | CDATA |
| 583 |
if (defined $self->{last_emitted_start_tag_name}) { |
if (defined $self->{last_emitted_start_tag_name}) { |
| 584 |
|
|
| 2511 |
defined $token->{public_identifier} or |
defined $token->{public_identifier} or |
| 2512 |
defined $token->{system_identifier}) { |
defined $token->{system_identifier}) { |
| 2513 |
!!!cp ('t1'); |
!!!cp ('t1'); |
| 2514 |
!!!parse-error (type => 'not HTML5'); |
!!!parse-error (type => 'not HTML5', token => $token); |
| 2515 |
} elsif ($doctype_name ne 'HTML') { |
} elsif ($doctype_name ne 'HTML') { |
| 2516 |
!!!cp ('t2'); |
!!!cp ('t2'); |
| 2517 |
## ISSUE: ASCII case-insensitive? (in fact it does not matter) |
## ISSUE: ASCII case-insensitive? (in fact it does not matter) |
| 2518 |
!!!parse-error (type => 'not HTML5'); |
!!!parse-error (type => 'not HTML5', token => $token); |
| 2519 |
} else { |
} else { |
| 2520 |
!!!cp ('t3'); |
!!!cp ('t3'); |
| 2521 |
} |
} |
| 2654 |
END_OF_FILE_TOKEN, 1, |
END_OF_FILE_TOKEN, 1, |
| 2655 |
}->{$token->{type}}) { |
}->{$token->{type}}) { |
| 2656 |
!!!cp ('t14'); |
!!!cp ('t14'); |
| 2657 |
!!!parse-error (type => 'no DOCTYPE'); |
!!!parse-error (type => 'no DOCTYPE', token => $token); |
| 2658 |
$self->{document}->manakai_compat_mode ('quirks'); |
$self->{document}->manakai_compat_mode ('quirks'); |
| 2659 |
## Go to the "before html" insertion mode. |
## Go to the "before html" insertion mode. |
| 2660 |
## reprocess |
## reprocess |
| 2675 |
!!!cp ('t17'); |
!!!cp ('t17'); |
| 2676 |
} |
} |
| 2677 |
|
|
| 2678 |
!!!parse-error (type => 'no DOCTYPE'); |
!!!parse-error (type => 'no DOCTYPE', token => $token); |
| 2679 |
$self->{document}->manakai_compat_mode ('quirks'); |
$self->{document}->manakai_compat_mode ('quirks'); |
| 2680 |
## Go to the "before html" insertion mode. |
## Go to the "before html" insertion mode. |
| 2681 |
## reprocess |
## reprocess |
| 2704 |
B: { |
B: { |
| 2705 |
if ($token->{type} == DOCTYPE_TOKEN) { |
if ($token->{type} == DOCTYPE_TOKEN) { |
| 2706 |
!!!cp ('t19'); |
!!!cp ('t19'); |
| 2707 |
!!!parse-error (type => 'in html:#DOCTYPE'); |
!!!parse-error (type => 'in html:#DOCTYPE', token => $token); |
| 2708 |
## Ignore the token |
## Ignore the token |
| 2709 |
## Stay in the insertion mode. |
## Stay in the insertion mode. |
| 2710 |
!!!next-token; |
!!!next-token; |
| 3000 |
## NOTE: An end-of-file token. |
## NOTE: An end-of-file token. |
| 3001 |
if ($content_model_flag == CDATA_CONTENT_MODEL) { |
if ($content_model_flag == CDATA_CONTENT_MODEL) { |
| 3002 |
!!!cp ('t43'); |
!!!cp ('t43'); |
| 3003 |
!!!parse-error (type => 'in CDATA:#'.$token->{type}); |
!!!parse-error (type => 'in CDATA:#'.$token->{type}, token => $token); |
| 3004 |
} elsif ($content_model_flag == RCDATA_CONTENT_MODEL) { |
} elsif ($content_model_flag == RCDATA_CONTENT_MODEL) { |
| 3005 |
!!!cp ('t44'); |
!!!cp ('t44'); |
| 3006 |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}); |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}, token => $token); |
| 3007 |
} else { |
} else { |
| 3008 |
die "$0: $content_model_flag in parse_rcdata"; |
die "$0: $content_model_flag in parse_rcdata"; |
| 3009 |
} |
} |
| 3039 |
## Ignore the token |
## Ignore the token |
| 3040 |
} else { |
} else { |
| 3041 |
!!!cp ('t48'); |
!!!cp ('t48'); |
| 3042 |
!!!parse-error (type => 'in CDATA:#'.$token->{type}); |
!!!parse-error (type => 'in CDATA:#'.$token->{type}, token => $token); |
| 3043 |
## ISSUE: And ignore? |
## ISSUE: And ignore? |
| 3044 |
## TODO: mark as "already executed" |
## TODO: mark as "already executed" |
| 3045 |
} |
} |
| 3067 |
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
| 3068 |
|
|
| 3069 |
my $formatting_end_tag = sub { |
my $formatting_end_tag = sub { |
| 3070 |
my $tag_name = shift; |
my $end_tag_token = shift; |
| 3071 |
|
my $tag_name = $end_tag_token->{tag_name}; |
| 3072 |
|
|
| 3073 |
## NOTE: The adoption agency algorithm (AAA). |
## NOTE: The adoption agency algorithm (AAA). |
| 3074 |
|
|
| 3089 |
} # AFE |
} # AFE |
| 3090 |
unless (defined $formatting_element) { |
unless (defined $formatting_element) { |
| 3091 |
!!!cp ('t53'); |
!!!cp ('t53'); |
| 3092 |
!!!parse-error (type => 'unmatched end tag:'.$tag_name); |
!!!parse-error (type => 'unmatched end tag:'.$tag_name, token => $end_tag_token); |
| 3093 |
## Ignore the token |
## Ignore the token |
| 3094 |
!!!next-token; |
!!!next-token; |
| 3095 |
return; |
return; |
| 3106 |
last INSCOPE; |
last INSCOPE; |
| 3107 |
} else { # in open elements but not in scope |
} else { # in open elements but not in scope |
| 3108 |
!!!cp ('t55'); |
!!!cp ('t55'); |
| 3109 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, |
| 3110 |
|
token => $end_tag_token); |
| 3111 |
## Ignore the token |
## Ignore the token |
| 3112 |
!!!next-token; |
!!!next-token; |
| 3113 |
return; |
return; |
| 3122 |
} # INSCOPE |
} # INSCOPE |
| 3123 |
unless (defined $formatting_element_i_in_open) { |
unless (defined $formatting_element_i_in_open) { |
| 3124 |
!!!cp ('t57'); |
!!!cp ('t57'); |
| 3125 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, |
| 3126 |
|
token => $end_tag_token); |
| 3127 |
pop @$active_formatting_elements; # $formatting_element |
pop @$active_formatting_elements; # $formatting_element |
| 3128 |
!!!next-token; ## TODO: ok? |
!!!next-token; ## TODO: ok? |
| 3129 |
return; |
return; |
| 3130 |
} |
} |
| 3131 |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
| 3132 |
!!!cp ('t58'); |
!!!cp ('t58'); |
| 3133 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], |
| 3134 |
|
token => $end_tag_token); |
| 3135 |
} |
} |
| 3136 |
|
|
| 3137 |
## Step 2 |
## Step 2 |
| 3342 |
B: { |
B: { |
| 3343 |
if ($token->{type} == DOCTYPE_TOKEN) { |
if ($token->{type} == DOCTYPE_TOKEN) { |
| 3344 |
!!!cp ('t73'); |
!!!cp ('t73'); |
| 3345 |
!!!parse-error (type => 'DOCTYPE in the middle'); |
!!!parse-error (type => 'DOCTYPE in the middle', token => $token); |
| 3346 |
## Ignore the token |
## Ignore the token |
| 3347 |
## Stay in the phase |
## Stay in the phase |
| 3348 |
!!!next-token; |
!!!next-token; |
| 3351 |
$token->{tag_name} eq 'html') { |
$token->{tag_name} eq 'html') { |
| 3352 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 3353 |
!!!cp ('t79'); |
!!!cp ('t79'); |
| 3354 |
!!!parse-error (type => 'after html:html'); |
!!!parse-error (type => 'after html:html', token => $token); |
| 3355 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = AFTER_BODY_IM; |
| 3356 |
} elsif ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
| 3357 |
!!!cp ('t80'); |
!!!cp ('t80'); |
| 3358 |
!!!parse-error (type => 'after html:html'); |
!!!parse-error (type => 'after html:html', token => $token); |
| 3359 |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
| 3360 |
} else { |
} else { |
| 3361 |
!!!cp ('t81'); |
!!!cp ('t81'); |
| 3362 |
} |
} |
| 3363 |
|
|
| 3364 |
!!!cp ('t82'); |
!!!cp ('t82'); |
| 3365 |
!!!parse-error (type => 'not first start tag'); |
!!!parse-error (type => 'not first start tag', token => $token); |
| 3366 |
my $top_el = $self->{open_elements}->[0]->[0]; |
my $top_el = $self->{open_elements}->[0]->[0]; |
| 3367 |
for my $attr_name (keys %{$token->{attributes}}) { |
for my $attr_name (keys %{$token->{attributes}}) { |
| 3368 |
unless ($top_el->has_attribute_ns (undef, $attr_name)) { |
unless ($top_el->has_attribute_ns (undef, $attr_name)) { |
| 3422 |
!!!cp ('t90'); |
!!!cp ('t90'); |
| 3423 |
## As if </noscript> |
## As if </noscript> |
| 3424 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3425 |
!!!parse-error (type => 'in noscript:#character'); |
!!!parse-error (type => 'in noscript:#character', token => $token); |
| 3426 |
|
|
| 3427 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3428 |
## As if </head> |
## As if </head> |
| 3459 |
# |
# |
| 3460 |
} else { |
} else { |
| 3461 |
!!!cp ('t95'); |
!!!cp ('t95'); |
| 3462 |
!!!parse-error (type => 'in head:head'); # or in head noscript |
!!!parse-error (type => 'in head:head', token => $token); # or in head noscript |
| 3463 |
## Ignore the token |
## Ignore the token |
| 3464 |
!!!next-token; |
!!!next-token; |
| 3465 |
redo B; |
redo B; |
| 3482 |
!!!cp ('t98'); |
!!!cp ('t98'); |
| 3483 |
## As if </noscript> |
## As if </noscript> |
| 3484 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3485 |
!!!parse-error (type => 'in noscript:base'); |
!!!parse-error (type => 'in noscript:base', token => $token); |
| 3486 |
|
|
| 3487 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 3488 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3493 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 3494 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3495 |
!!!cp ('t100'); |
!!!cp ('t100'); |
| 3496 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3497 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3498 |
} else { |
} else { |
| 3499 |
!!!cp ('t101'); |
!!!cp ('t101'); |
| 3508 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 3509 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3510 |
!!!cp ('t102'); |
!!!cp ('t102'); |
| 3511 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3512 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3513 |
} else { |
} else { |
| 3514 |
!!!cp ('t103'); |
!!!cp ('t103'); |
| 3523 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 3524 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3525 |
!!!cp ('t104'); |
!!!cp ('t104'); |
| 3526 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3527 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3528 |
} else { |
} else { |
| 3529 |
!!!cp ('t105'); |
!!!cp ('t105'); |
| 3585 |
!!!cp ('t111'); |
!!!cp ('t111'); |
| 3586 |
## As if </noscript> |
## As if </noscript> |
| 3587 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3588 |
!!!parse-error (type => 'in noscript:title'); |
!!!parse-error (type => 'in noscript:title', token => $token); |
| 3589 |
|
|
| 3590 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 3591 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3592 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3593 |
!!!cp ('t112'); |
!!!cp ('t112'); |
| 3594 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3595 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3596 |
} else { |
} else { |
| 3597 |
!!!cp ('t113'); |
!!!cp ('t113'); |
| 3610 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 3611 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3612 |
!!!cp ('t114'); |
!!!cp ('t114'); |
| 3613 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3614 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3615 |
} else { |
} else { |
| 3616 |
!!!cp ('t115'); |
!!!cp ('t115'); |
| 3629 |
redo B; |
redo B; |
| 3630 |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 3631 |
!!!cp ('t117'); |
!!!cp ('t117'); |
| 3632 |
!!!parse-error (type => 'in noscript:noscript'); |
!!!parse-error (type => 'in noscript:noscript', token => $token); |
| 3633 |
## Ignore the token |
## Ignore the token |
| 3634 |
!!!next-token; |
!!!next-token; |
| 3635 |
redo B; |
redo B; |
| 3642 |
!!!cp ('t119'); |
!!!cp ('t119'); |
| 3643 |
## As if </noscript> |
## As if </noscript> |
| 3644 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3645 |
!!!parse-error (type => 'in noscript:script'); |
!!!parse-error (type => 'in noscript:script', token => $token); |
| 3646 |
|
|
| 3647 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 3648 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3649 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 3650 |
!!!cp ('t120'); |
!!!cp ('t120'); |
| 3651 |
!!!parse-error (type => 'after head:'.$token->{tag_name}); |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
| 3652 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3653 |
} else { |
} else { |
| 3654 |
!!!cp ('t121'); |
!!!cp ('t121'); |
| 3665 |
!!!cp ('t122'); |
!!!cp ('t122'); |
| 3666 |
## As if </noscript> |
## As if </noscript> |
| 3667 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3668 |
!!!parse-error (type => 'in noscript:'.$token->{tag_name}); |
!!!parse-error (type => 'in noscript:'.$token->{tag_name}, token => $token); |
| 3669 |
|
|
| 3670 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3671 |
## As if </head> |
## As if </head> |
| 3703 |
!!!cp ('t129'); |
!!!cp ('t129'); |
| 3704 |
## As if </noscript> |
## As if </noscript> |
| 3705 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3706 |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}); |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}, token => $token); |
| 3707 |
|
|
| 3708 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3709 |
## As if </head> |
## As if </head> |
| 3744 |
!!!cp ('t133'); |
!!!cp ('t133'); |
| 3745 |
## As if </noscript> |
## As if </noscript> |
| 3746 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3747 |
!!!parse-error (type => 'in noscript:/head'); |
!!!parse-error (type => 'in noscript:/head', token => $token); |
| 3748 |
|
|
| 3749 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3750 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3770 |
redo B; |
redo B; |
| 3771 |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3772 |
!!!cp ('t137'); |
!!!cp ('t137'); |
| 3773 |
!!!parse-error (type => 'unmatched end tag:noscript'); |
!!!parse-error (type => 'unmatched end tag:noscript', token => $token); |
| 3774 |
## Ignore the token ## ISSUE: An issue in the spec. |
## Ignore the token ## ISSUE: An issue in the spec. |
| 3775 |
!!!next-token; |
!!!next-token; |
| 3776 |
redo B; |
redo B; |
| 3792 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3793 |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 3794 |
!!!cp ('t140'); |
!!!cp ('t140'); |
| 3795 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 3796 |
## Ignore the token |
## Ignore the token |
| 3797 |
!!!next-token; |
!!!next-token; |
| 3798 |
redo B; |
redo B; |
| 3824 |
# |
# |
| 3825 |
} else { |
} else { |
| 3826 |
!!!cp ('t145'); |
!!!cp ('t145'); |
| 3827 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 3828 |
## Ignore the token |
## Ignore the token |
| 3829 |
!!!next-token; |
!!!next-token; |
| 3830 |
redo B; |
redo B; |
| 3835 |
!!!cp ('t146'); |
!!!cp ('t146'); |
| 3836 |
## As if </noscript> |
## As if </noscript> |
| 3837 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3838 |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}); |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}, token => $token); |
| 3839 |
|
|
| 3840 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 3841 |
## As if </head> |
## As if </head> |
| 3851 |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3852 |
## ISSUE: This case cannot be reached? |
## ISSUE: This case cannot be reached? |
| 3853 |
!!!cp ('t148'); |
!!!cp ('t148'); |
| 3854 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 3855 |
## Ignore the token ## ISSUE: An issue in the spec. |
## Ignore the token ## ISSUE: An issue in the spec. |
| 3856 |
!!!next-token; |
!!!next-token; |
| 3857 |
redo B; |
redo B; |
| 3895 |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 3896 |
!!!cp ('t149.3'); |
!!!cp ('t149.3'); |
| 3897 |
|
|
| 3898 |
!!!parse-error (type => 'in noscript:#eof'); |
!!!parse-error (type => 'in noscript:#eof', token => $token); |
| 3899 |
|
|
| 3900 |
## As if </noscript> |
## As if </noscript> |
| 3901 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 3960 |
|
|
| 3961 |
!!!cp ('t153'); |
!!!cp ('t153'); |
| 3962 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 3963 |
value => $token->{tag_name}); |
value => $token->{tag_name}, token => $token); |
| 3964 |
## Ignore the token |
## Ignore the token |
| 3965 |
!!!next-token; |
!!!next-token; |
| 3966 |
redo B; |
redo B; |
| 3967 |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 3968 |
!!!parse-error (type => 'not closed:caption'); |
!!!parse-error (type => 'not closed:caption', token => $token); |
| 3969 |
|
|
| 3970 |
## NOTE: As if </caption>. |
## NOTE: As if </caption>. |
| 3971 |
## have a table element in table scope |
## have a table element in table scope |
| 3987 |
|
|
| 3988 |
!!!cp ('t157'); |
!!!cp ('t157'); |
| 3989 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 3990 |
value => $token->{tag_name}); |
value => $token->{tag_name}, token => $token); |
| 3991 |
## Ignore the token |
## Ignore the token |
| 3992 |
!!!next-token; |
!!!next-token; |
| 3993 |
redo B; |
redo B; |
| 4003 |
|
|
| 4004 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
| 4005 |
!!!cp ('t159'); |
!!!cp ('t159'); |
| 4006 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4007 |
} else { |
} else { |
| 4008 |
!!!cp ('t160'); |
!!!cp ('t160'); |
| 4009 |
} |
} |
| 4044 |
} # INSCOPE |
} # INSCOPE |
| 4045 |
unless (defined $i) { |
unless (defined $i) { |
| 4046 |
!!!cp ('t165'); |
!!!cp ('t165'); |
| 4047 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4048 |
## Ignore the token |
## Ignore the token |
| 4049 |
!!!next-token; |
!!!next-token; |
| 4050 |
redo B; |
redo B; |
| 4060 |
|
|
| 4061 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
| 4062 |
!!!cp ('t167'); |
!!!cp ('t167'); |
| 4063 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4064 |
} else { |
} else { |
| 4065 |
!!!cp ('t168'); |
!!!cp ('t168'); |
| 4066 |
} |
} |
| 4075 |
redo B; |
redo B; |
| 4076 |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 4077 |
!!!cp ('t169'); |
!!!cp ('t169'); |
| 4078 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4079 |
## Ignore the token |
## Ignore the token |
| 4080 |
!!!next-token; |
!!!next-token; |
| 4081 |
redo B; |
redo B; |
| 4104 |
|
|
| 4105 |
!!!cp ('t173'); |
!!!cp ('t173'); |
| 4106 |
!!!parse-error (type => 'unmatched end tag', |
!!!parse-error (type => 'unmatched end tag', |
| 4107 |
value => $token->{tag_name}); |
value => $token->{tag_name}, token => $token); |
| 4108 |
## Ignore the token |
## Ignore the token |
| 4109 |
!!!next-token; |
!!!next-token; |
| 4110 |
redo B; |
redo B; |
| 4120 |
|
|
| 4121 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
| 4122 |
!!!cp ('t175'); |
!!!cp ('t175'); |
| 4123 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4124 |
} else { |
} else { |
| 4125 |
!!!cp ('t176'); |
!!!cp ('t176'); |
| 4126 |
} |
} |
| 4135 |
redo B; |
redo B; |
| 4136 |
} elsif ($self->{insertion_mode} == IN_CELL_IM) { |
} elsif ($self->{insertion_mode} == IN_CELL_IM) { |
| 4137 |
!!!cp ('t177'); |
!!!cp ('t177'); |
| 4138 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4139 |
## Ignore the token |
## Ignore the token |
| 4140 |
!!!next-token; |
!!!next-token; |
| 4141 |
redo B; |
redo B; |
| 4178 |
|
|
| 4179 |
!!!cp ('t182'); |
!!!cp ('t182'); |
| 4180 |
!!!parse-error (type => 'unmatched end tag', |
!!!parse-error (type => 'unmatched end tag', |
| 4181 |
value => $token->{tag_name}); |
value => $token->{tag_name}, token => $token); |
| 4182 |
## Ignore the token |
## Ignore the token |
| 4183 |
!!!next-token; |
!!!next-token; |
| 4184 |
redo B; |
redo B; |
| 4185 |
} # INSCOPE |
} # INSCOPE |
| 4186 |
} elsif ($token->{tag_name} eq 'table' and |
} elsif ($token->{tag_name} eq 'table' and |
| 4187 |
$self->{insertion_mode} == IN_CAPTION_IM) { |
$self->{insertion_mode} == IN_CAPTION_IM) { |
| 4188 |
!!!parse-error (type => 'not closed:caption'); |
!!!parse-error (type => 'not closed:caption', token => $token); |
| 4189 |
|
|
| 4190 |
## As if </caption> |
## As if </caption> |
| 4191 |
## have a table element in table scope |
## have a table element in table scope |
| 4205 |
} # INSCOPE |
} # INSCOPE |
| 4206 |
unless (defined $i) { |
unless (defined $i) { |
| 4207 |
!!!cp ('t186'); |
!!!cp ('t186'); |
| 4208 |
!!!parse-error (type => 'unmatched end tag:caption'); |
!!!parse-error (type => 'unmatched end tag:caption', token => $token); |
| 4209 |
## Ignore the token |
## Ignore the token |
| 4210 |
!!!next-token; |
!!!next-token; |
| 4211 |
redo B; |
redo B; |
| 4221 |
|
|
| 4222 |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
if ($self->{open_elements}->[-1]->[1] ne 'caption') { |
| 4223 |
!!!cp ('t188'); |
!!!cp ('t188'); |
| 4224 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4225 |
} else { |
} else { |
| 4226 |
!!!cp ('t189'); |
!!!cp ('t189'); |
| 4227 |
} |
} |
| 4239 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 4240 |
if ($self->{insertion_mode} & BODY_TABLE_IMS) { |
if ($self->{insertion_mode} & BODY_TABLE_IMS) { |
| 4241 |
!!!cp ('t190'); |
!!!cp ('t190'); |
| 4242 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4243 |
## Ignore the token |
## Ignore the token |
| 4244 |
!!!next-token; |
!!!next-token; |
| 4245 |
redo B; |
redo B; |
| 4253 |
}->{$token->{tag_name}} and |
}->{$token->{tag_name}} and |
| 4254 |
$self->{insertion_mode} == IN_CAPTION_IM) { |
$self->{insertion_mode} == IN_CAPTION_IM) { |
| 4255 |
!!!cp ('t192'); |
!!!cp ('t192'); |
| 4256 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4257 |
## Ignore the token |
## Ignore the token |
| 4258 |
!!!next-token; |
!!!next-token; |
| 4259 |
redo B; |
redo B; |
| 4268 |
th => 1, thead => 1, tr => 1, body => 1, html => 1, |
th => 1, thead => 1, tr => 1, body => 1, html => 1, |
| 4269 |
}->{$entry->[1]}) { |
}->{$entry->[1]}) { |
| 4270 |
!!!cp ('t75'); |
!!!cp ('t75'); |
| 4271 |
!!!parse-error (type => 'in body:#eof'); |
!!!parse-error (type => 'in body:#eof', token => $token); |
| 4272 |
last; |
last; |
| 4273 |
} |
} |
| 4274 |
} |
} |
| 4296 |
} |
} |
| 4297 |
} |
} |
| 4298 |
|
|
| 4299 |
!!!parse-error (type => 'in table:#character'); |
!!!parse-error (type => 'in table:#character', token => $token); |
| 4300 |
|
|
| 4301 |
## As if in body, but insert into foster parent element |
## As if in body, but insert into foster parent element |
| 4302 |
## ISSUE: Spec says that "whenever a node would be inserted |
## ISSUE: Spec says that "whenever a node would be inserted |
| 4370 |
if ($self->{insertion_mode} == IN_TABLE_BODY_IM) { |
if ($self->{insertion_mode} == IN_TABLE_BODY_IM) { |
| 4371 |
unless ($token->{tag_name} eq 'tr') { |
unless ($token->{tag_name} eq 'tr') { |
| 4372 |
!!!cp ('t202'); |
!!!cp ('t202'); |
| 4373 |
!!!parse-error (type => 'missing start tag:tr'); |
!!!parse-error (type => 'missing start tag:tr', token => $token); |
| 4374 |
} |
} |
| 4375 |
|
|
| 4376 |
## Clear back to table body context |
## Clear back to table body context |
| 4440 |
unless (defined $i) { |
unless (defined $i) { |
| 4441 |
!!!cp ('t210'); |
!!!cp ('t210'); |
| 4442 |
## TODO: This type is wrong. |
## TODO: This type is wrong. |
| 4443 |
!!!parse-error (type => 'unmacthed end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmacthed end tag:'.$token->{tag_name}, token => $token); |
| 4444 |
## Ignore the token |
## Ignore the token |
| 4445 |
!!!next-token; |
!!!next-token; |
| 4446 |
redo B; |
redo B; |
| 4488 |
unless (defined $i) { |
unless (defined $i) { |
| 4489 |
!!!cp ('t216'); |
!!!cp ('t216'); |
| 4490 |
## TODO: This erorr type ios wrong. |
## TODO: This erorr type ios wrong. |
| 4491 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4492 |
## Ignore the token |
## Ignore the token |
| 4493 |
!!!next-token; |
!!!next-token; |
| 4494 |
redo B; |
redo B; |
| 4560 |
die "$0: in table: <>: $token->{tag_name}"; |
die "$0: in table: <>: $token->{tag_name}"; |
| 4561 |
} |
} |
| 4562 |
} elsif ($token->{tag_name} eq 'table') { |
} elsif ($token->{tag_name} eq 'table') { |
| 4563 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4564 |
|
|
| 4565 |
## As if </table> |
## As if </table> |
| 4566 |
## have a table element in table scope |
## have a table element in table scope |
| 4582 |
unless (defined $i) { |
unless (defined $i) { |
| 4583 |
!!!cp ('t223'); |
!!!cp ('t223'); |
| 4584 |
## TODO: The following is wrong, maybe. |
## TODO: The following is wrong, maybe. |
| 4585 |
!!!parse-error (type => 'unmatched end tag:table'); |
!!!parse-error (type => 'unmatched end tag:table', token => $token); |
| 4586 |
## Ignore tokens </table><table> |
## Ignore tokens </table><table> |
| 4587 |
!!!next-token; |
!!!next-token; |
| 4588 |
redo B; |
redo B; |
| 4600 |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
if ($self->{open_elements}->[-1]->[1] ne 'table') { |
| 4601 |
!!!cp ('t225'); |
!!!cp ('t225'); |
| 4602 |
## ISSUE: Can this case be reached? |
## ISSUE: Can this case be reached? |
| 4603 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 4604 |
} else { |
} else { |
| 4605 |
!!!cp ('t226'); |
!!!cp ('t226'); |
| 4606 |
} |
} |
| 4638 |
my $type = lc $token->{attributes}->{type}->{value}; |
my $type = lc $token->{attributes}->{type}->{value}; |
| 4639 |
if ($type eq 'hidden') { |
if ($type eq 'hidden') { |
| 4640 |
!!!cp ('t227.3'); |
!!!cp ('t227.3'); |
| 4641 |
!!!parse-error (type => 'in table:'.$token->{tag_name}); |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
| 4642 |
|
|
| 4643 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
| 4644 |
|
|
| 4665 |
# |
# |
| 4666 |
} |
} |
| 4667 |
|
|
| 4668 |
!!!parse-error (type => 'in table:'.$token->{tag_name}); |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
| 4669 |
|
|
| 4670 |
$insert = $insert_to_foster; |
$insert = $insert_to_foster; |
| 4671 |
# |
# |
| 4689 |
} # INSCOPE |
} # INSCOPE |
| 4690 |
unless (defined $i) { |
unless (defined $i) { |
| 4691 |
!!!cp ('t230'); |
!!!cp ('t230'); |
| 4692 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4693 |
## Ignore the token |
## Ignore the token |
| 4694 |
!!!next-token; |
!!!next-token; |
| 4695 |
redo B; |
redo B; |
| 4731 |
unless (defined $i) { |
unless (defined $i) { |
| 4732 |
!!!cp ('t235'); |
!!!cp ('t235'); |
| 4733 |
## TODO: The following is wrong. |
## TODO: The following is wrong. |
| 4734 |
!!!parse-error (type => 'unmatched end tag:'.$token->{type}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{type}, token => $token); |
| 4735 |
## Ignore the token |
## Ignore the token |
| 4736 |
!!!next-token; |
!!!next-token; |
| 4737 |
redo B; |
redo B; |
| 4771 |
} # INSCOPE |
} # INSCOPE |
| 4772 |
unless (defined $i) { |
unless (defined $i) { |
| 4773 |
!!!cp ('t239'); |
!!!cp ('t239'); |
| 4774 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4775 |
## Ignore the token |
## Ignore the token |
| 4776 |
!!!next-token; |
!!!next-token; |
| 4777 |
redo B; |
redo B; |
| 4819 |
} # INSCOPE |
} # INSCOPE |
| 4820 |
unless (defined $i) { |
unless (defined $i) { |
| 4821 |
!!!cp ('t243'); |
!!!cp ('t243'); |
| 4822 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4823 |
## Ignore the token |
## Ignore the token |
| 4824 |
!!!next-token; |
!!!next-token; |
| 4825 |
redo B; |
redo B; |
| 4854 |
} # INSCOPE |
} # INSCOPE |
| 4855 |
unless (defined $i) { |
unless (defined $i) { |
| 4856 |
!!!cp ('t249'); |
!!!cp ('t249'); |
| 4857 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4858 |
## Ignore the token |
## Ignore the token |
| 4859 |
!!!next-token; |
!!!next-token; |
| 4860 |
redo B; |
redo B; |
| 4878 |
} # INSCOPE |
} # INSCOPE |
| 4879 |
unless (defined $i) { |
unless (defined $i) { |
| 4880 |
!!!cp ('t252'); |
!!!cp ('t252'); |
| 4881 |
!!!parse-error (type => 'unmatched end tag:tr'); |
!!!parse-error (type => 'unmatched end tag:tr', token => $token); |
| 4882 |
## Ignore the token |
## Ignore the token |
| 4883 |
!!!next-token; |
!!!next-token; |
| 4884 |
redo B; |
redo B; |
| 4915 |
} # INSCOPE |
} # INSCOPE |
| 4916 |
unless (defined $i) { |
unless (defined $i) { |
| 4917 |
!!!cp ('t256'); |
!!!cp ('t256'); |
| 4918 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4919 |
## Ignore the token |
## Ignore the token |
| 4920 |
!!!next-token; |
!!!next-token; |
| 4921 |
redo B; |
redo B; |
| 4941 |
tbody => 1, tfoot => 1, thead => 1, # $self->{insertion_mode} == IN_TABLE_IM |
tbody => 1, tfoot => 1, thead => 1, # $self->{insertion_mode} == IN_TABLE_IM |
| 4942 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 4943 |
!!!cp ('t258'); |
!!!cp ('t258'); |
| 4944 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 4945 |
## Ignore the token |
## Ignore the token |
| 4946 |
!!!next-token; |
!!!next-token; |
| 4947 |
redo B; |
redo B; |
| 4948 |
} else { |
} else { |
| 4949 |
!!!cp ('t259'); |
!!!cp ('t259'); |
| 4950 |
!!!parse-error (type => 'in table:/'.$token->{tag_name}); |
!!!parse-error (type => 'in table:/'.$token->{tag_name}, token => $token); |
| 4951 |
|
|
| 4952 |
$insert = $insert_to_foster; |
$insert = $insert_to_foster; |
| 4953 |
# |
# |
| 4955 |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 4956 |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 4957 |
@{$self->{open_elements}} == 1) { # redundant, maybe |
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 4958 |
!!!parse-error (type => 'in body:#eof'); |
!!!parse-error (type => 'in body:#eof', token => $token); |
| 4959 |
!!!cp ('t259.1'); |
!!!cp ('t259.1'); |
| 4960 |
# |
# |
| 4961 |
} else { |
} else { |
| 4996 |
if ($token->{tag_name} eq 'colgroup') { |
if ($token->{tag_name} eq 'colgroup') { |
| 4997 |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
| 4998 |
!!!cp ('t264'); |
!!!cp ('t264'); |
| 4999 |
!!!parse-error (type => 'unmatched end tag:colgroup'); |
!!!parse-error (type => 'unmatched end tag:colgroup', token => $token); |
| 5000 |
## Ignore the token |
## Ignore the token |
| 5001 |
!!!next-token; |
!!!next-token; |
| 5002 |
redo B; |
redo B; |
| 5009 |
} |
} |
| 5010 |
} elsif ($token->{tag_name} eq 'col') { |
} elsif ($token->{tag_name} eq 'col') { |
| 5011 |
!!!cp ('t266'); |
!!!cp ('t266'); |
| 5012 |
!!!parse-error (type => 'unmatched end tag:col'); |
!!!parse-error (type => 'unmatched end tag:col', token => $token); |
| 5013 |
## Ignore the token |
## Ignore the token |
| 5014 |
!!!next-token; |
!!!next-token; |
| 5015 |
redo B; |
redo B; |
| 5039 |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
if ($self->{open_elements}->[-1]->[1] eq 'html') { |
| 5040 |
!!!cp ('t269'); |
!!!cp ('t269'); |
| 5041 |
## TODO: Wrong error type? |
## TODO: Wrong error type? |
| 5042 |
!!!parse-error (type => 'unmatched end tag:colgroup'); |
!!!parse-error (type => 'unmatched end tag:colgroup', token => $token); |
| 5043 |
## Ignore the token |
## Ignore the token |
| 5044 |
!!!next-token; |
!!!next-token; |
| 5045 |
redo B; |
redo B; |
| 5098 |
tr => 1, td => 1, th => 1, |
tr => 1, td => 1, th => 1, |
| 5099 |
}->{$token->{tag_name}})) { |
}->{$token->{tag_name}})) { |
| 5100 |
## TODO: The type below is not good - <select> is replaced by </select> |
## TODO: The type below is not good - <select> is replaced by </select> |
| 5101 |
!!!parse-error (type => 'not closed:select'); |
!!!parse-error (type => 'not closed:select', token => $token); |
| 5102 |
## NOTE: As if the token were </select> (<select> case) or |
## NOTE: As if the token were </select> (<select> case) or |
| 5103 |
## as if there were </select> (otherwise). |
## as if there were </select> (otherwise). |
| 5104 |
## have an element in table scope |
## have an element in table scope |
| 5118 |
} # INSCOPE |
} # INSCOPE |
| 5119 |
unless (defined $i) { |
unless (defined $i) { |
| 5120 |
!!!cp ('t280'); |
!!!cp ('t280'); |
| 5121 |
!!!parse-error (type => 'unmatched end tag:select'); |
!!!parse-error (type => 'unmatched end tag:select', token => $token); |
| 5122 |
## Ignore the token |
## Ignore the token |
| 5123 |
!!!next-token; |
!!!next-token; |
| 5124 |
redo B; |
redo B; |
| 5140 |
} |
} |
| 5141 |
} else { |
} else { |
| 5142 |
!!!cp ('t282'); |
!!!cp ('t282'); |
| 5143 |
!!!parse-error (type => 'in select:'.$token->{tag_name}); |
!!!parse-error (type => 'in select:'.$token->{tag_name}, token => $token); |
| 5144 |
## Ignore the token |
## Ignore the token |
| 5145 |
!!!next-token; |
!!!next-token; |
| 5146 |
redo B; |
redo B; |
| 5157 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5158 |
} else { |
} else { |
| 5159 |
!!!cp ('t285'); |
!!!cp ('t285'); |
| 5160 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 5161 |
## Ignore the token |
## Ignore the token |
| 5162 |
} |
} |
| 5163 |
!!!next-token; |
!!!next-token; |
| 5168 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5169 |
} else { |
} else { |
| 5170 |
!!!cp ('t287'); |
!!!cp ('t287'); |
| 5171 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 5172 |
## Ignore the token |
## Ignore the token |
| 5173 |
} |
} |
| 5174 |
!!!next-token; |
!!!next-token; |
| 5191 |
} # INSCOPE |
} # INSCOPE |
| 5192 |
unless (defined $i) { |
unless (defined $i) { |
| 5193 |
!!!cp ('t290'); |
!!!cp ('t290'); |
| 5194 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 5195 |
## Ignore the token |
## Ignore the token |
| 5196 |
!!!next-token; |
!!!next-token; |
| 5197 |
redo B; |
redo B; |
| 5210 |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
| 5211 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5212 |
## TODO: The following is wrong? |
## TODO: The following is wrong? |
| 5213 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 5214 |
|
|
| 5215 |
## have an element in table scope |
## have an element in table scope |
| 5216 |
my $i; |
my $i; |
| 5254 |
unless (defined $i) { |
unless (defined $i) { |
| 5255 |
!!!cp ('t297'); |
!!!cp ('t297'); |
| 5256 |
## TODO: The following error type is correct? |
## TODO: The following error type is correct? |
| 5257 |
!!!parse-error (type => 'unmatched end tag:select'); |
!!!parse-error (type => 'unmatched end tag:select', token => $token); |
| 5258 |
## Ignore the </select> token |
## Ignore the </select> token |
| 5259 |
!!!next-token; ## TODO: ok? |
!!!next-token; ## TODO: ok? |
| 5260 |
redo B; |
redo B; |
| 5269 |
redo B; |
redo B; |
| 5270 |
} else { |
} else { |
| 5271 |
!!!cp ('t299'); |
!!!cp ('t299'); |
| 5272 |
!!!parse-error (type => 'in select:/'.$token->{tag_name}); |
!!!parse-error (type => 'in select:/'.$token->{tag_name}, token => $token); |
| 5273 |
## Ignore the token |
## Ignore the token |
| 5274 |
!!!next-token; |
!!!next-token; |
| 5275 |
redo B; |
redo B; |
| 5278 |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 5279 |
@{$self->{open_elements}} == 1) { # redundant, maybe |
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 5280 |
!!!cp ('t299.1'); |
!!!cp ('t299.1'); |
| 5281 |
!!!parse-error (type => 'in body:#eof'); |
!!!parse-error (type => 'in body:#eof', token => $token); |
| 5282 |
} else { |
} else { |
| 5283 |
!!!cp ('t299.2'); |
!!!cp ('t299.2'); |
| 5284 |
} |
} |
| 5306 |
|
|
| 5307 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 5308 |
!!!cp ('t301'); |
!!!cp ('t301'); |
| 5309 |
!!!parse-error (type => 'after html:#character'); |
!!!parse-error (type => 'after html:#character', token => $token); |
| 5310 |
|
|
| 5311 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 5312 |
} else { |
} else { |
| 5314 |
} |
} |
| 5315 |
|
|
| 5316 |
## "after body" insertion mode |
## "after body" insertion mode |
| 5317 |
!!!parse-error (type => 'after body:#character'); |
!!!parse-error (type => 'after body:#character', token => $token); |
| 5318 |
|
|
| 5319 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 5320 |
## reprocess |
## reprocess |
| 5322 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 5323 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 5324 |
!!!cp ('t303'); |
!!!cp ('t303'); |
| 5325 |
!!!parse-error (type => 'after html:'.$token->{tag_name}); |
!!!parse-error (type => 'after html:'.$token->{tag_name}, token => $token); |
| 5326 |
|
|
| 5327 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 5328 |
} else { |
} else { |
| 5330 |
} |
} |
| 5331 |
|
|
| 5332 |
## "after body" insertion mode |
## "after body" insertion mode |
| 5333 |
!!!parse-error (type => 'after body:'.$token->{tag_name}); |
!!!parse-error (type => 'after body:'.$token->{tag_name}, token => $token); |
| 5334 |
|
|
| 5335 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 5336 |
## reprocess |
## reprocess |
| 5338 |
} elsif ($token->{type} == END_TAG_TOKEN) { |
} elsif ($token->{type} == END_TAG_TOKEN) { |
| 5339 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 5340 |
!!!cp ('t305'); |
!!!cp ('t305'); |
| 5341 |
!!!parse-error (type => 'after html:/'.$token->{tag_name}); |
!!!parse-error (type => 'after html:/'.$token->{tag_name}, token => $token); |
| 5342 |
|
|
| 5343 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = AFTER_BODY_IM; |
| 5344 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 5350 |
if ($token->{tag_name} eq 'html') { |
if ($token->{tag_name} eq 'html') { |
| 5351 |
if (defined $self->{inner_html_node}) { |
if (defined $self->{inner_html_node}) { |
| 5352 |
!!!cp ('t307'); |
!!!cp ('t307'); |
| 5353 |
!!!parse-error (type => 'unmatched end tag:html'); |
!!!parse-error (type => 'unmatched end tag:html', token => $token); |
| 5354 |
## Ignore the token |
## Ignore the token |
| 5355 |
!!!next-token; |
!!!next-token; |
| 5356 |
redo B; |
redo B; |
| 5362 |
} |
} |
| 5363 |
} else { |
} else { |
| 5364 |
!!!cp ('t309'); |
!!!cp ('t309'); |
| 5365 |
!!!parse-error (type => 'after body:/'.$token->{tag_name}); |
!!!parse-error (type => 'after body:/'.$token->{tag_name}, token => $token); |
| 5366 |
|
|
| 5367 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 5368 |
## reprocess |
## reprocess |
| 5390 |
if ($token->{data} =~ s/^[^\x09\x0A\x0B\x0C\x20]+//) { |
if ($token->{data} =~ s/^[^\x09\x0A\x0B\x0C\x20]+//) { |
| 5391 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 5392 |
!!!cp ('t311'); |
!!!cp ('t311'); |
| 5393 |
!!!parse-error (type => 'in frameset:#character'); |
!!!parse-error (type => 'in frameset:#character', token => $token); |
| 5394 |
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
| 5395 |
!!!cp ('t312'); |
!!!cp ('t312'); |
| 5396 |
!!!parse-error (type => 'after frameset:#character'); |
!!!parse-error (type => 'after frameset:#character', token => $token); |
| 5397 |
} else { # "after html frameset" |
} else { # "after html frameset" |
| 5398 |
!!!cp ('t313'); |
!!!cp ('t313'); |
| 5399 |
!!!parse-error (type => 'after html:#character'); |
!!!parse-error (type => 'after html:#character', token => $token); |
| 5400 |
|
|
| 5401 |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
| 5402 |
## Reprocess in the "after frameset" insertion mode. |
## Reprocess in the "after frameset" insertion mode. |
| 5403 |
!!!parse-error (type => 'after frameset:#character'); |
!!!parse-error (type => 'after frameset:#character', token => $token); |
| 5404 |
} |
} |
| 5405 |
|
|
| 5406 |
## Ignore the token. |
## Ignore the token. |
| 5418 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 5419 |
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
| 5420 |
!!!cp ('t316'); |
!!!cp ('t316'); |
| 5421 |
!!!parse-error (type => 'after html:'.$token->{tag_name}); |
!!!parse-error (type => 'after html:'.$token->{tag_name}, token => $token); |
| 5422 |
|
|
| 5423 |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
| 5424 |
## Process in the "after frameset" insertion mode. |
## Process in the "after frameset" insertion mode. |
| 5447 |
} else { |
} else { |
| 5448 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 5449 |
!!!cp ('t321'); |
!!!cp ('t321'); |
| 5450 |
!!!parse-error (type => 'in frameset:'.$token->{tag_name}); |
!!!parse-error (type => 'in frameset:'.$token->{tag_name}, token => $token); |
| 5451 |
} else { |
} else { |
| 5452 |
!!!cp ('t322'); |
!!!cp ('t322'); |
| 5453 |
!!!parse-error (type => 'after frameset:'.$token->{tag_name}); |
!!!parse-error (type => 'after frameset:'.$token->{tag_name}, token => $token); |
| 5454 |
} |
} |
| 5455 |
## Ignore the token |
## Ignore the token |
| 5456 |
!!!next-token; |
!!!next-token; |
| 5459 |
} elsif ($token->{type} == END_TAG_TOKEN) { |
} elsif ($token->{type} == END_TAG_TOKEN) { |
| 5460 |
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
| 5461 |
!!!cp ('t323'); |
!!!cp ('t323'); |
| 5462 |
!!!parse-error (type => 'after html:/'.$token->{tag_name}); |
!!!parse-error (type => 'after html:/'.$token->{tag_name}, token => $token); |
| 5463 |
|
|
| 5464 |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
| 5465 |
## Process in the "after frameset" insertion mode. |
## Process in the "after frameset" insertion mode. |
| 5472 |
if ($self->{open_elements}->[-1]->[1] eq 'html' and |
if ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 5473 |
@{$self->{open_elements}} == 1) { |
@{$self->{open_elements}} == 1) { |
| 5474 |
!!!cp ('t325'); |
!!!cp ('t325'); |
| 5475 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 5476 |
## Ignore the token |
## Ignore the token |
| 5477 |
!!!next-token; |
!!!next-token; |
| 5478 |
} else { |
} else { |
| 5498 |
} else { |
} else { |
| 5499 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 5500 |
!!!cp ('t330'); |
!!!cp ('t330'); |
| 5501 |
!!!parse-error (type => 'in frameset:/'.$token->{tag_name}); |
!!!parse-error (type => 'in frameset:/'.$token->{tag_name}, token => $token); |
| 5502 |
} else { |
} else { |
| 5503 |
!!!cp ('t331'); |
!!!cp ('t331'); |
| 5504 |
!!!parse-error (type => 'after frameset:/'.$token->{tag_name}); |
!!!parse-error (type => 'after frameset:/'.$token->{tag_name}, token => $token); |
| 5505 |
} |
} |
| 5506 |
## Ignore the token |
## Ignore the token |
| 5507 |
!!!next-token; |
!!!next-token; |
| 5511 |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
unless ($self->{open_elements}->[-1]->[1] eq 'html' and |
| 5512 |
@{$self->{open_elements}} == 1) { # redundant, maybe |
@{$self->{open_elements}} == 1) { # redundant, maybe |
| 5513 |
!!!cp ('t331.1'); |
!!!cp ('t331.1'); |
| 5514 |
!!!parse-error (type => 'in body:#eof'); |
!!!parse-error (type => 'in body:#eof', token => $token); |
| 5515 |
} else { |
} else { |
| 5516 |
!!!cp ('t331.2'); |
!!!cp ('t331.2'); |
| 5517 |
} |
} |
| 5604 |
$parse_rcdata->(RCDATA_CONTENT_MODEL); |
$parse_rcdata->(RCDATA_CONTENT_MODEL); |
| 5605 |
redo B; |
redo B; |
| 5606 |
} elsif ($token->{tag_name} eq 'body') { |
} elsif ($token->{tag_name} eq 'body') { |
| 5607 |
!!!parse-error (type => 'in body:body'); |
!!!parse-error (type => 'in body:body', token => $token); |
| 5608 |
|
|
| 5609 |
if (@{$self->{open_elements}} == 1 or |
if (@{$self->{open_elements}} == 1 or |
| 5610 |
$self->{open_elements}->[1]->[1] ne 'body') { |
$self->{open_elements}->[1]->[1] ne 'body') { |
| 5635 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5636 |
if ($token->{tag_name} eq 'form' and defined $self->{form_element}) { |
if ($token->{tag_name} eq 'form' and defined $self->{form_element}) { |
| 5637 |
!!!cp ('t350'); |
!!!cp ('t350'); |
| 5638 |
!!!parse-error (type => 'in form:form'); |
!!!parse-error (type => 'in form:form', token => $token); |
| 5639 |
## Ignore the token |
## Ignore the token |
| 5640 |
!!!next-token; |
!!!next-token; |
| 5641 |
redo B; |
redo B; |
| 5722 |
if ($i != -1) { |
if ($i != -1) { |
| 5723 |
!!!cp ('t355'); |
!!!cp ('t355'); |
| 5724 |
!!!parse-error (type => 'end tag missing:'. |
!!!parse-error (type => 'end tag missing:'. |
| 5725 |
$self->{open_elements}->[-1]->[1]); |
$self->{open_elements}->[-1]->[1], token => $token); |
| 5726 |
} else { |
} else { |
| 5727 |
!!!cp ('t356'); |
!!!cp ('t356'); |
| 5728 |
} |
} |
| 5780 |
my $node = $active_formatting_elements->[$i]; |
my $node = $active_formatting_elements->[$i]; |
| 5781 |
if ($node->[1] eq 'a') { |
if ($node->[1] eq 'a') { |
| 5782 |
!!!cp ('t371'); |
!!!cp ('t371'); |
| 5783 |
!!!parse-error (type => 'in a:a'); |
!!!parse-error (type => 'in a:a', token => $token); |
| 5784 |
|
|
| 5785 |
!!!back-token; |
!!!back-token; |
| 5786 |
$token = {type => END_TAG_TOKEN, tag_name => 'a'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'a'}; |
| 5787 |
$formatting_end_tag->($token->{tag_name}); |
$formatting_end_tag->($token); |
| 5788 |
|
|
| 5789 |
AFE2: for (reverse 0..$#$active_formatting_elements) { |
AFE2: for (reverse 0..$#$active_formatting_elements) { |
| 5790 |
if ($active_formatting_elements->[$_]->[0] eq $node->[0]) { |
if ($active_formatting_elements->[$_]->[0] eq $node->[0]) { |
| 5822 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
| 5823 |
if ($node->[1] eq 'nobr') { |
if ($node->[1] eq 'nobr') { |
| 5824 |
!!!cp ('t376'); |
!!!cp ('t376'); |
| 5825 |
!!!parse-error (type => 'in nobr:nobr'); |
!!!parse-error (type => 'in nobr:nobr', token => $token); |
| 5826 |
!!!back-token; |
!!!back-token; |
| 5827 |
$token = {type => END_TAG_TOKEN, tag_name => 'nobr'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'nobr'}; |
| 5828 |
redo B; |
redo B; |
| 5846 |
my $node = $self->{open_elements}->[$_]; |
my $node = $self->{open_elements}->[$_]; |
| 5847 |
if ($node->[1] eq 'button') { |
if ($node->[1] eq 'button') { |
| 5848 |
!!!cp ('t378'); |
!!!cp ('t378'); |
| 5849 |
!!!parse-error (type => 'in button:button'); |
!!!parse-error (type => 'in button:button', token => $token); |
| 5850 |
!!!back-token; |
!!!back-token; |
| 5851 |
$token = {type => END_TAG_TOKEN, tag_name => 'button'}; |
$token = {type => END_TAG_TOKEN, tag_name => 'button'}; |
| 5852 |
redo B; |
redo B; |
| 5886 |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
| 5887 |
redo B; |
redo B; |
| 5888 |
} elsif ($token->{tag_name} eq 'isindex') { |
} elsif ($token->{tag_name} eq 'isindex') { |
| 5889 |
!!!parse-error (type => 'isindex'); |
!!!parse-error (type => 'isindex', token => $token); |
| 5890 |
|
|
| 5891 |
if (defined $self->{form_element}) { |
if (defined $self->{form_element}) { |
| 5892 |
!!!cp ('t389'); |
!!!cp ('t389'); |
| 5970 |
## Ignore the token |
## Ignore the token |
| 5971 |
} else { |
} else { |
| 5972 |
!!!cp ('t398'); |
!!!cp ('t398'); |
| 5973 |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}); |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}, token => $token); |
| 5974 |
} |
} |
| 5975 |
!!!next-token; |
!!!next-token; |
| 5976 |
redo B; |
redo B; |
| 5981 |
thead => 1, tr => 1, |
thead => 1, tr => 1, |
| 5982 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5983 |
!!!cp ('t401'); |
!!!cp ('t401'); |
| 5984 |
!!!parse-error (type => 'in body:'.$token->{tag_name}); |
!!!parse-error (type => 'in body:'.$token->{tag_name}, token => $token); |
| 5985 |
## Ignore the token |
## Ignore the token |
| 5986 |
!!!next-token; |
!!!next-token; |
| 5987 |
redo B; |
redo B; |
| 5990 |
} else { |
} else { |
| 5991 |
if ($token->{tag_name} eq 'image') { |
if ($token->{tag_name} eq 'image') { |
| 5992 |
!!!cp ('t384'); |
!!!cp ('t384'); |
| 5993 |
!!!parse-error (type => 'image'); |
!!!parse-error (type => 'image', token => $token); |
| 5994 |
$token->{tag_name} = 'img'; |
$token->{tag_name} = 'img'; |
| 5995 |
} else { |
} else { |
| 5996 |
!!!cp ('t385'); |
!!!cp ('t385'); |
| 6063 |
} |
} |
| 6064 |
|
|
| 6065 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 6066 |
value => $token->{tag_name}); |
value => $token->{tag_name}, token => $token); |
| 6067 |
## NOTE: Ignore the token. |
## NOTE: Ignore the token. |
| 6068 |
!!!next-token; |
!!!next-token; |
| 6069 |
redo B; |
redo B; |
| 6076 |
tbody => 1, tfoot => 1, thead => 1, |
tbody => 1, tfoot => 1, thead => 1, |
| 6077 |
}->{$_->[1]}) { |
}->{$_->[1]}) { |
| 6078 |
!!!cp ('t403'); |
!!!cp ('t403'); |
| 6079 |
!!!parse-error (type => 'not closed:'.$_->[1]); |
!!!parse-error (type => 'not closed:'.$_->[1], token => $token); |
| 6080 |
last; |
last; |
| 6081 |
} else { |
} else { |
| 6082 |
!!!cp ('t404'); |
!!!cp ('t404'); |
| 6091 |
## ISSUE: There is an issue in the spec. |
## ISSUE: There is an issue in the spec. |
| 6092 |
if ($self->{open_elements}->[-1]->[1] ne 'body') { |
if ($self->{open_elements}->[-1]->[1] ne 'body') { |
| 6093 |
!!!cp ('t406'); |
!!!cp ('t406'); |
| 6094 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[1]->[1], token => $token); |
| 6095 |
} else { |
} else { |
| 6096 |
!!!cp ('t407'); |
!!!cp ('t407'); |
| 6097 |
} |
} |
| 6100 |
redo B; |
redo B; |
| 6101 |
} else { |
} else { |
| 6102 |
!!!cp ('t408'); |
!!!cp ('t408'); |
| 6103 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6104 |
## Ignore the token |
## Ignore the token |
| 6105 |
!!!next-token; |
!!!next-token; |
| 6106 |
redo B; |
redo B; |
| 6131 |
|
|
| 6132 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 6133 |
!!!cp ('t413'); |
!!!cp ('t413'); |
| 6134 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6135 |
} else { |
} else { |
| 6136 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 6137 |
while ({ |
while ({ |
| 6147 |
## Step 2. |
## Step 2. |
| 6148 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
| 6149 |
!!!cp ('t412'); |
!!!cp ('t412'); |
| 6150 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 6151 |
} else { |
} else { |
| 6152 |
!!!cp ('t414'); |
!!!cp ('t414'); |
| 6153 |
} |
} |
| 6185 |
|
|
| 6186 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 6187 |
!!!cp ('t421'); |
!!!cp ('t421'); |
| 6188 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6189 |
} else { |
} else { |
| 6190 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 6191 |
while ({ |
while ({ |
| 6198 |
## Step 2. |
## Step 2. |
| 6199 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
| 6200 |
!!!cp ('t417.1'); |
!!!cp ('t417.1'); |
| 6201 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 6202 |
} else { |
} else { |
| 6203 |
!!!cp ('t420'); |
!!!cp ('t420'); |
| 6204 |
} |
} |
| 6233 |
|
|
| 6234 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 6235 |
!!!cp ('t425.1'); |
!!!cp ('t425.1'); |
| 6236 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6237 |
} else { |
} else { |
| 6238 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 6239 |
while ({ |
while ({ |
| 6246 |
## Step 2. |
## Step 2. |
| 6247 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
| 6248 |
!!!cp ('t425'); |
!!!cp ('t425'); |
| 6249 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6250 |
} else { |
} else { |
| 6251 |
!!!cp ('t426'); |
!!!cp ('t426'); |
| 6252 |
} |
} |
| 6278 |
if (defined $i) { |
if (defined $i) { |
| 6279 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
| 6280 |
!!!cp ('t412.1'); |
!!!cp ('t412.1'); |
| 6281 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 6282 |
} else { |
} else { |
| 6283 |
!!!cp ('t414.1'); |
!!!cp ('t414.1'); |
| 6284 |
} |
} |
| 6286 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 6287 |
} else { |
} else { |
| 6288 |
!!!cp ('t413.1'); |
!!!cp ('t413.1'); |
| 6289 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6290 |
|
|
| 6291 |
!!!cp ('t415.1'); |
!!!cp ('t415.1'); |
| 6292 |
## As if <p>, then reprocess the current token |
## As if <p>, then reprocess the current token |
| 6305 |
strong => 1, tt => 1, u => 1, |
strong => 1, tt => 1, u => 1, |
| 6306 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6307 |
!!!cp ('t427'); |
!!!cp ('t427'); |
| 6308 |
$formatting_end_tag->($token->{tag_name}); |
$formatting_end_tag->($token); |
| 6309 |
redo B; |
redo B; |
| 6310 |
} elsif ($token->{tag_name} eq 'br') { |
} elsif ($token->{tag_name} eq 'br') { |
| 6311 |
!!!cp ('t428'); |
!!!cp ('t428'); |
| 6312 |
!!!parse-error (type => 'unmatched end tag:br'); |
!!!parse-error (type => 'unmatched end tag:br', token => $token); |
| 6313 |
|
|
| 6314 |
## As if <br> |
## As if <br> |
| 6315 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 6334 |
noscript => 0, ## TODO: if scripting is enabled |
noscript => 0, ## TODO: if scripting is enabled |
| 6335 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6336 |
!!!cp ('t429'); |
!!!cp ('t429'); |
| 6337 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6338 |
## Ignore the token |
## Ignore the token |
| 6339 |
!!!next-token; |
!!!next-token; |
| 6340 |
redo B; |
redo B; |
| 6363 |
if ($token->{tag_name} ne $self->{open_elements}->[-1]->[1]) { |
if ($token->{tag_name} ne $self->{open_elements}->[-1]->[1]) { |
| 6364 |
!!!cp ('t431'); |
!!!cp ('t431'); |
| 6365 |
## NOTE: <x><y></x> |
## NOTE: <x><y></x> |
| 6366 |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1]); |
!!!parse-error (type => 'not closed:'.$self->{open_elements}->[-1]->[1], token => $token); |
| 6367 |
} else { |
} else { |
| 6368 |
!!!cp ('t432'); |
!!!cp ('t432'); |
| 6369 |
} |
} |
| 6380 |
($special_category->{$node->[1]} or |
($special_category->{$node->[1]} or |
| 6381 |
$scoping_category->{$node->[1]})) { |
$scoping_category->{$node->[1]})) { |
| 6382 |
!!!cp ('t433'); |
!!!cp ('t433'); |
| 6383 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
| 6384 |
## Ignore the token |
## Ignore the token |
| 6385 |
!!!next-token; |
!!!next-token; |
| 6386 |
last S2; |
last S2; |