| 418 |
redo A; |
redo A; |
| 419 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 420 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 421 |
|
$self->{current_token}->{first_start_tag} |
| 422 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 423 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 424 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 425 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 445 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 446 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 447 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 448 |
|
$self->{current_token}->{first_start_tag} |
| 449 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 450 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 451 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 452 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 493 |
redo A; |
redo A; |
| 494 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 495 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 496 |
|
$self->{current_token}->{first_start_tag} |
| 497 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 498 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 499 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 500 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 533 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 534 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 535 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 536 |
|
$self->{current_token}->{first_start_tag} |
| 537 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 538 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 539 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 540 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 586 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 587 |
$before_leave->(); |
$before_leave->(); |
| 588 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 589 |
|
$self->{current_token}->{first_start_tag} |
| 590 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 591 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 592 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 593 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 627 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 628 |
$before_leave->(); |
$before_leave->(); |
| 629 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 630 |
|
$self->{current_token}->{first_start_tag} |
| 631 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 632 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 633 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 634 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 665 |
redo A; |
redo A; |
| 666 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 667 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 668 |
|
$self->{current_token}->{first_start_tag} |
| 669 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 670 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 671 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 672 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 705 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 706 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 707 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 708 |
|
$self->{current_token}->{first_start_tag} |
| 709 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 710 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 711 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 712 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 752 |
redo A; |
redo A; |
| 753 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 754 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 755 |
|
$self->{current_token}->{first_start_tag} |
| 756 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 757 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 758 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 759 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 772 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 773 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 774 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 775 |
|
$self->{current_token}->{first_start_tag} |
| 776 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 777 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 778 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 779 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 808 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 809 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
| 810 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 811 |
|
$self->{current_token}->{first_start_tag} |
| 812 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 813 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 814 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 815 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 844 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 845 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
| 846 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 847 |
|
$self->{current_token}->{first_start_tag} |
| 848 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 849 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 850 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 851 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 883 |
redo A; |
redo A; |
| 884 |
} elsif ($self->{next_input_character} == 0x003E) { # > |
} elsif ($self->{next_input_character} == 0x003E) { # > |
| 885 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 886 |
|
$self->{current_token}->{first_start_tag} |
| 887 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 888 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 889 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 890 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 903 |
} elsif ($self->{next_input_character} == -1) { |
} elsif ($self->{next_input_character} == -1) { |
| 904 |
!!!parse-error (type => 'unclosed tag'); |
!!!parse-error (type => 'unclosed tag'); |
| 905 |
if ($self->{current_token}->{type} eq 'start tag') { |
if ($self->{current_token}->{type} eq 'start tag') { |
| 906 |
|
$self->{current_token}->{first_start_tag} |
| 907 |
|
= not defined $self->{last_emitted_start_tag_name}; |
| 908 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 909 |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
} elsif ($self->{current_token}->{type} eq 'end tag') { |
| 910 |
$self->{content_model_flag} = 'PCDATA'; # MUST |
$self->{content_model_flag} = 'PCDATA'; # MUST |
| 2597 |
if ($i != -1) { |
if ($i != -1) { |
| 2598 |
!!!parse-error (type => 'end tag missing:'. |
!!!parse-error (type => 'end tag missing:'. |
| 2599 |
$self->{open_elements}->[-1]->[1]); |
$self->{open_elements}->[-1]->[1]); |
|
## TODO: test |
|
| 2600 |
} |
} |
| 2601 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 2602 |
last LI; |
last LI; |
| 2644 |
if ($i != -1) { |
if ($i != -1) { |
| 2645 |
!!!parse-error (type => 'end tag missing:'. |
!!!parse-error (type => 'end tag missing:'. |
| 2646 |
$self->{open_elements}->[-1]->[1]); |
$self->{open_elements}->[-1]->[1]); |
|
## TODO: test |
|
| 2647 |
} |
} |
| 2648 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 2649 |
last LI; |
last LI; |
| 3267 |
redo B; |
redo B; |
| 3268 |
} elsif ($token->{type} eq 'start tag' and |
} elsif ($token->{type} eq 'start tag' and |
| 3269 |
$token->{tag_name} eq 'html') { |
$token->{tag_name} eq 'html') { |
| 3270 |
## TODO: unless it is the first start tag token, parse-error |
## ISSUE: "aa<html>" is not a parse error. |
| 3271 |
|
## ISSUE: "<html>" in fragment is not a parse error. |
| 3272 |
|
unless ($token->{first_start_tag}) { |
| 3273 |
|
!!!parse-error (type => 'not first start tag'); |
| 3274 |
|
} |
| 3275 |
my $top_el = $self->{open_elements}->[0]->[0]; |
my $top_el = $self->{open_elements}->[0]->[0]; |
| 3276 |
for my $attr_name (keys %{$token->{attributes}}) { |
for my $attr_name (keys %{$token->{attributes}}) { |
| 3277 |
unless ($top_el->has_attribute_ns (undef, $attr_name)) { |
unless ($top_el->has_attribute_ns (undef, $attr_name)) { |