| 45 |
sub FOREIGN_EL () { 0b10000000000000000000000000 } |
sub FOREIGN_EL () { 0b10000000000000000000000000 } |
| 46 |
sub FOREIGN_FLOW_CONTENT_EL () { 0b100000000000000000000000000 } |
sub FOREIGN_FLOW_CONTENT_EL () { 0b100000000000000000000000000 } |
| 47 |
sub MML_AXML_EL () { 0b1000000000000000000000000000 } |
sub MML_AXML_EL () { 0b1000000000000000000000000000 } |
| 48 |
|
sub RUBY_EL () { 0b10000000000000000000000000000 } |
| 49 |
|
sub RUBY_COMPONENT_EL () { 0b100000000000000000000000000000 } |
| 50 |
|
|
| 51 |
sub TABLE_ROWS_EL () { |
sub TABLE_ROWS_EL () { |
| 52 |
TABLE_EL | |
TABLE_EL | |
| 54 |
TABLE_ROW_GROUP_EL |
TABLE_ROW_GROUP_EL |
| 55 |
} |
} |
| 56 |
|
|
| 57 |
|
## NOTE: Used in "generate implied end tags" algorithm. |
| 58 |
|
## NOTE: There is a code where a modified version of END_TAG_OPTIONAL_EL |
| 59 |
|
## is used in "generate implied end tags" implementation (search for the |
| 60 |
|
## function mae). |
| 61 |
sub END_TAG_OPTIONAL_EL () { |
sub END_TAG_OPTIONAL_EL () { |
| 62 |
DD_EL | |
DD_EL | |
| 63 |
DT_EL | |
DT_EL | |
| 64 |
LI_EL | |
LI_EL | |
| 65 |
P_EL |
P_EL | |
| 66 |
|
RUBY_COMPONENT_EL |
| 67 |
} |
} |
| 68 |
|
|
| 69 |
|
## NOTE: Used in </body> and EOF algorithms. |
| 70 |
sub ALL_END_TAG_OPTIONAL_EL () { |
sub ALL_END_TAG_OPTIONAL_EL () { |
| 71 |
END_TAG_OPTIONAL_EL | |
DD_EL | |
| 72 |
|
DT_EL | |
| 73 |
|
LI_EL | |
| 74 |
|
P_EL | |
| 75 |
|
|
| 76 |
BODY_EL | |
BODY_EL | |
| 77 |
HTML_EL | |
HTML_EL | |
| 78 |
TABLE_CELL_EL | |
TABLE_CELL_EL | |
| 108 |
ADDRESS_EL | |
ADDRESS_EL | |
| 109 |
BODY_EL | |
BODY_EL | |
| 110 |
DIV_EL | |
DIV_EL | |
| 111 |
END_TAG_OPTIONAL_EL | |
|
| 112 |
|
DD_EL | |
| 113 |
|
DT_EL | |
| 114 |
|
LI_EL | |
| 115 |
|
P_EL | |
| 116 |
|
|
| 117 |
FORM_EL | |
FORM_EL | |
| 118 |
FRAMESET_EL | |
FRAMESET_EL | |
| 119 |
HEADING_EL | |
HEADING_EL | |
| 187 |
param => MISC_SPECIAL_EL, |
param => MISC_SPECIAL_EL, |
| 188 |
plaintext => MISC_SPECIAL_EL, |
plaintext => MISC_SPECIAL_EL, |
| 189 |
pre => MISC_SPECIAL_EL, |
pre => MISC_SPECIAL_EL, |
| 190 |
|
rp => RUBY_COMPONENT_EL, |
| 191 |
|
rt => RUBY_COMPONENT_EL, |
| 192 |
|
ruby => RUBY_EL, |
| 193 |
s => FORMATTING_EL, |
s => FORMATTING_EL, |
| 194 |
script => MISC_SPECIAL_EL, |
script => MISC_SPECIAL_EL, |
| 195 |
select => SELECT_EL, |
select => SELECT_EL, |
| 443 |
allow_fallback => 1, byte_buffer => \$byte_buffer); |
allow_fallback => 1, byte_buffer => \$byte_buffer); |
| 444 |
if ($char_stream) { |
if ($char_stream) { |
| 445 |
$buffer->{buffer} = $byte_buffer; |
$buffer->{buffer} = $byte_buffer; |
| 446 |
!!!parse-error (type => 'sniffing:chardet', ## TODO: type name |
!!!parse-error (type => 'sniffing:chardet', |
| 447 |
value => $charset_name, |
text => $charset_name, |
| 448 |
level => $self->{info_level}, |
level => $self->{level}->{info}, |
| 449 |
|
layer => 'encode', |
| 450 |
line => 1, column => 1); |
line => 1, column => 1); |
| 451 |
$self->{confident} = 0; |
$self->{confident} = 0; |
| 452 |
last SNIFFING; |
last SNIFFING; |
| 467 |
allow_fallback => 1, |
allow_fallback => 1, |
| 468 |
byte_buffer => \$byte_buffer); |
byte_buffer => \$byte_buffer); |
| 469 |
$buffer->{buffer} = $byte_buffer; |
$buffer->{buffer} = $byte_buffer; |
| 470 |
!!!parse-error (type => 'sniffing:default', ## TODO: type name |
!!!parse-error (type => 'sniffing:default', |
| 471 |
value => 'windows-1252', |
text => 'windows-1252', |
| 472 |
level => $self->{info_level}, |
level => $self->{level}->{info}, |
| 473 |
line => 1, column => 1); |
line => 1, column => 1, |
| 474 |
|
layer => 'encode'); |
| 475 |
$self->{confident} = 0; |
$self->{confident} = 0; |
| 476 |
} # SNIFFING |
} # SNIFFING |
| 477 |
|
|
| 478 |
$self->{input_encoding} = $charset->get_iana_name; |
$self->{input_encoding} = $charset->get_iana_name; |
| 479 |
if ($e_status & Message::Charset::Info::FALLBACK_ENCODING_IMPL ()) { |
if ($e_status & Message::Charset::Info::FALLBACK_ENCODING_IMPL ()) { |
| 480 |
!!!parse-error (type => 'chardecode:fallback', ## TODO: type name |
!!!parse-error (type => 'chardecode:fallback', |
| 481 |
value => $self->{input_encoding}, |
text => $self->{input_encoding}, |
| 482 |
level => $self->{unsupported_level}, |
level => $self->{level}->{uncertain}, |
| 483 |
line => 1, column => 1); |
line => 1, column => 1, |
| 484 |
|
layer => 'encode'); |
| 485 |
} elsif (not ($e_status & |
} elsif (not ($e_status & |
| 486 |
Message::Charset::Info::ERROR_REPORTING_ENCODING_IMPL())) { |
Message::Charset::Info::ERROR_REPORTING_ENCODING_IMPL())) { |
| 487 |
!!!parse-error (type => 'chardecode:no error', ## TODO: type name |
!!!parse-error (type => 'chardecode:no error', |
| 488 |
value => $self->{input_encoding}, |
text => $self->{input_encoding}, |
| 489 |
level => $self->{unsupported_level}, |
level => $self->{level}->{uncertain}, |
| 490 |
line => 1, column => 1); |
line => 1, column => 1, |
| 491 |
|
layer => 'encode'); |
| 492 |
} |
} |
| 493 |
|
|
| 494 |
$self->{change_encoding} = sub { |
$self->{change_encoding} = sub { |
| 517 |
## Step 2 |
## Step 2 |
| 518 |
if (defined $self->{input_encoding} and |
if (defined $self->{input_encoding} and |
| 519 |
$self->{input_encoding} eq $charset_name) { |
$self->{input_encoding} eq $charset_name) { |
| 520 |
!!!parse-error (type => 'charset label:matching', ## TODO: type |
!!!parse-error (type => 'charset label:matching', |
| 521 |
value => $charset_name, |
text => $charset_name, |
| 522 |
level => $self->{info_level}); |
level => $self->{level}->{info}); |
| 523 |
$self->{confident} = 1; |
$self->{confident} = 1; |
| 524 |
return; |
return; |
| 525 |
} |
} |
| 526 |
|
|
| 527 |
!!!parse-error (type => 'charset label detected:'.$self->{input_encoding}. |
!!!parse-error (type => 'charset label detected', |
| 528 |
':'.$charset_name, level => 'w', token => $token); |
text => $self->{input_encoding}, |
| 529 |
|
value => $charset_name, |
| 530 |
|
level => $self->{level}->{warn}, |
| 531 |
|
token => $token); |
| 532 |
|
|
| 533 |
## Step 3 |
## Step 3 |
| 534 |
# if (can) { |
# if (can) { |
| 544 |
|
|
| 545 |
my $char_onerror = sub { |
my $char_onerror = sub { |
| 546 |
my (undef, $type, %opt) = @_; |
my (undef, $type, %opt) = @_; |
| 547 |
!!!parse-error (%opt, type => $type, |
!!!parse-error (layer => 'encode', |
| 548 |
|
%opt, type => $type, |
| 549 |
line => $self->{line}, column => $self->{column} + 1); |
line => $self->{line}, column => $self->{column} + 1); |
| 550 |
if ($opt{octets}) { |
if ($opt{octets}) { |
| 551 |
${$opt{octets}} = "\x{FFFD}"; # relacement character |
${$opt{octets}} = "\x{FFFD}"; # relacement character |
| 562 |
|
|
| 563 |
$self->{input_encoding} = $charset->get_iana_name; |
$self->{input_encoding} = $charset->get_iana_name; |
| 564 |
if ($e_status & Message::Charset::Info::FALLBACK_ENCODING_IMPL ()) { |
if ($e_status & Message::Charset::Info::FALLBACK_ENCODING_IMPL ()) { |
| 565 |
!!!parse-error (type => 'chardecode:fallback', ## TODO: type name |
!!!parse-error (type => 'chardecode:fallback', |
| 566 |
value => $self->{input_encoding}, |
text => $self->{input_encoding}, |
| 567 |
level => $self->{unsupported_level}, |
level => $self->{level}->{uncertain}, |
| 568 |
line => 1, column => 1); |
line => 1, column => 1, |
| 569 |
|
layer => 'encode'); |
| 570 |
} elsif (not ($e_status & |
} elsif (not ($e_status & |
| 571 |
Message::Charset::Info::ERROR_REPORTING_ENCODING_IMPL())) { |
Message::Charset::Info::ERROR_REPORTING_ENCODING_IMPL())) { |
| 572 |
!!!parse-error (type => 'chardecode:no error', ## TODO: type name |
!!!parse-error (type => 'chardecode:no error', |
| 573 |
value => $self->{input_encoding}, |
text => $self->{input_encoding}, |
| 574 |
level => $self->{unsupported_level}, |
level => $self->{level}->{uncertain}, |
| 575 |
line => 1, column => 1); |
line => 1, column => 1, |
| 576 |
|
layer => 'encode'); |
| 577 |
} |
} |
| 578 |
$self->{confident} = 1; |
$self->{confident} = 1; |
| 579 |
$char_stream->onerror ($char_onerror); |
$char_stream->onerror ($char_onerror); |
| 672 |
0x10FFFE => 1, 0x10FFFF => 1, |
0x10FFFE => 1, 0x10FFFF => 1, |
| 673 |
}->{$self->{next_char}}) { |
}->{$self->{next_char}}) { |
| 674 |
!!!cp ('j5'); |
!!!cp ('j5'); |
| 675 |
!!!parse-error (type => 'control char', level => $self->{must_level}); |
if ($self->{next_char} < 0x10000) { |
| 676 |
## TODO: error type documentation |
!!!parse-error (type => 'control char', |
| 677 |
|
text => (sprintf 'U+%04X', $self->{next_char})); |
| 678 |
|
} else { |
| 679 |
|
!!!parse-error (type => 'control char', |
| 680 |
|
text => (sprintf 'U-%08X', $self->{next_char})); |
| 681 |
|
} |
| 682 |
} |
} |
| 683 |
}; |
}; |
| 684 |
$self->{prev_char} = [-1, -1, -1]; |
$self->{prev_char} = [-1, -1, -1]; |
| 707 |
sub new ($) { |
sub new ($) { |
| 708 |
my $class = shift; |
my $class = shift; |
| 709 |
my $self = bless { |
my $self = bless { |
| 710 |
must_level => 'm', |
level => {must => 'm', |
| 711 |
should_level => 's', |
warn => 'w', |
| 712 |
good_level => 'w', |
info => 'i', |
| 713 |
warn_level => 'w', |
uncertain => 'u'}, |
|
info_level => 'i', |
|
|
unsupported_level => 'u', |
|
| 714 |
}, $class; |
}, $class; |
| 715 |
$self->{set_next_char} = sub { |
$self->{set_next_char} = sub { |
| 716 |
$self->{next_char} = -1; |
$self->{next_char} = -1; |
| 857 |
## |->{self_closing}| is used to save the value of |$self->{self_closing}| |
## |->{self_closing}| is used to save the value of |$self->{self_closing}| |
| 858 |
## while the token is pushed back to the stack. |
## while the token is pushed back to the stack. |
| 859 |
|
|
|
## ISSUE: "When a DOCTYPE token is created, its |
|
|
## <i>self-closing flag</i> must be unset (its other state is that it |
|
|
## be set), and its attributes list must be empty.": Wrong subject? |
|
|
|
|
| 860 |
## Emitted token MUST immediately be handled by the tree construction state. |
## Emitted token MUST immediately be handled by the tree construction state. |
| 861 |
|
|
| 862 |
## Before each step, UA MAY check to see if either one of the scripts in |
## Before each step, UA MAY check to see if either one of the scripts in |
| 1369 |
if (exists $self->{current_token}->{attributes} # start tag or end tag |
if (exists $self->{current_token}->{attributes} # start tag or end tag |
| 1370 |
->{$self->{current_attribute}->{name}}) { # MUST |
->{$self->{current_attribute}->{name}}) { # MUST |
| 1371 |
!!!cp (57); |
!!!cp (57); |
| 1372 |
!!!parse-error (type => 'duplicate attribute:'.$self->{current_attribute}->{name}, line => $self->{current_attribute}->{line}, column => $self->{current_attribute}->{column}); |
!!!parse-error (type => 'duplicate attribute', text => $self->{current_attribute}->{name}, line => $self->{current_attribute}->{line}, column => $self->{current_attribute}->{column}); |
| 1373 |
## Discard $self->{current_attribute} # MUST |
## Discard $self->{current_attribute} # MUST |
| 1374 |
} else { |
} else { |
| 1375 |
!!!cp (58); |
!!!cp (58); |
| 1540 |
|
|
| 1541 |
redo A; |
redo A; |
| 1542 |
} else { |
} else { |
| 1543 |
!!!cp (82); |
if ($self->{next_char} == 0x0022 or # " |
| 1544 |
|
$self->{next_char} == 0x0027) { # ' |
| 1545 |
|
!!!cp (78); |
| 1546 |
|
!!!parse-error (type => 'bad attribute name'); |
| 1547 |
|
} else { |
| 1548 |
|
!!!cp (82); |
| 1549 |
|
} |
| 1550 |
$self->{current_attribute} |
$self->{current_attribute} |
| 1551 |
= {name => chr ($self->{next_char}), |
= {name => chr ($self->{next_char}), |
| 1552 |
value => '', |
value => '', |
| 1581 |
!!!next-input-character; |
!!!next-input-character; |
| 1582 |
redo A; |
redo A; |
| 1583 |
} elsif ($self->{next_char} == 0x003E) { # > |
} elsif ($self->{next_char} == 0x003E) { # > |
| 1584 |
|
!!!parse-error (type => 'empty unquoted attribute value'); |
| 1585 |
if ($self->{current_token}->{type} == START_TAG_TOKEN) { |
if ($self->{current_token}->{type} == START_TAG_TOKEN) { |
| 1586 |
!!!cp (87); |
!!!cp (87); |
| 1587 |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 2687 |
redo A; |
redo A; |
| 2688 |
} elsif ($self->{next_char} == 0x003E) { # > |
} elsif ($self->{next_char} == 0x003E) { # > |
| 2689 |
!!!cp (208); |
!!!cp (208); |
| 2690 |
!!!parse-error (type => 'unclosed PUBLIC literal'); |
!!!parse-error (type => 'unclosed SYSTEM literal'); |
| 2691 |
|
|
| 2692 |
$self->{state} = DATA_STATE; |
$self->{state} = DATA_STATE; |
| 2693 |
!!!next-input-character; |
!!!next-input-character; |
| 2723 |
redo A; |
redo A; |
| 2724 |
} elsif ($self->{next_char} == 0x003E) { # > |
} elsif ($self->{next_char} == 0x003E) { # > |
| 2725 |
!!!cp (212); |
!!!cp (212); |
| 2726 |
!!!parse-error (type => 'unclosed PUBLIC literal'); |
!!!parse-error (type => 'unclosed SYSTEM literal'); |
| 2727 |
|
|
| 2728 |
$self->{state} = DATA_STATE; |
$self->{state} = DATA_STATE; |
| 2729 |
!!!next-input-character; |
!!!next-input-character; |
| 2770 |
redo A; |
redo A; |
| 2771 |
} elsif ($self->{next_char} == -1) { |
} elsif ($self->{next_char} == -1) { |
| 2772 |
!!!cp (217); |
!!!cp (217); |
| 2773 |
|
!!!parse-error (type => 'unclosed DOCTYPE'); |
| 2774 |
$self->{state} = DATA_STATE; |
$self->{state} = DATA_STATE; |
| 2775 |
## reconsume |
## reconsume |
| 2776 |
|
|
| 2932 |
|
|
| 2933 |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
| 2934 |
!!!cp (1008); |
!!!cp (1008); |
| 2935 |
!!!parse-error (type => (sprintf 'invalid character reference:U+%04X', $code), line => $l, column => $c); |
!!!parse-error (type => 'invalid character reference', |
| 2936 |
|
text => (sprintf 'U+%04X', $code), |
| 2937 |
|
line => $l, column => $c); |
| 2938 |
$code = 0xFFFD; |
$code = 0xFFFD; |
| 2939 |
} elsif ($code > 0x10FFFF) { |
} elsif ($code > 0x10FFFF) { |
| 2940 |
!!!cp (1009); |
!!!cp (1009); |
| 2941 |
!!!parse-error (type => (sprintf 'invalid character reference:U-%08X', $code), line => $l, column => $c); |
!!!parse-error (type => 'invalid character reference', |
| 2942 |
|
text => (sprintf 'U-%08X', $code), |
| 2943 |
|
line => $l, column => $c); |
| 2944 |
$code = 0xFFFD; |
$code = 0xFFFD; |
| 2945 |
} elsif ($code == 0x000D) { |
} elsif ($code == 0x000D) { |
| 2946 |
!!!cp (1010); |
!!!cp (1010); |
| 2948 |
$code = 0x000A; |
$code = 0x000A; |
| 2949 |
} elsif (0x80 <= $code and $code <= 0x9F) { |
} elsif (0x80 <= $code and $code <= 0x9F) { |
| 2950 |
!!!cp (1011); |
!!!cp (1011); |
| 2951 |
!!!parse-error (type => (sprintf 'C1 character reference:U+%04X', $code), line => $l, column => $c); |
!!!parse-error (type => 'C1 character reference', text => (sprintf 'U+%04X', $code), line => $l, column => $c); |
| 2952 |
$code = $c1_entity_char->{$code}; |
$code = $c1_entity_char->{$code}; |
| 2953 |
} |
} |
| 2954 |
|
|
| 2981 |
|
|
| 2982 |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
if ($code == 0 or (0xD800 <= $code and $code <= 0xDFFF)) { |
| 2983 |
!!!cp (1015); |
!!!cp (1015); |
| 2984 |
!!!parse-error (type => (sprintf 'invalid character reference:U+%04X', $code), line => $l, column => $c); |
!!!parse-error (type => 'invalid character reference', |
| 2985 |
|
text => (sprintf 'U+%04X', $code), |
| 2986 |
|
line => $l, column => $c); |
| 2987 |
$code = 0xFFFD; |
$code = 0xFFFD; |
| 2988 |
} elsif ($code > 0x10FFFF) { |
} elsif ($code > 0x10FFFF) { |
| 2989 |
!!!cp (1016); |
!!!cp (1016); |
| 2990 |
!!!parse-error (type => (sprintf 'invalid character reference:U-%08X', $code), line => $l, column => $c); |
!!!parse-error (type => 'invalid character reference', |
| 2991 |
|
text => (sprintf 'U-%08X', $code), |
| 2992 |
|
line => $l, column => $c); |
| 2993 |
$code = 0xFFFD; |
$code = 0xFFFD; |
| 2994 |
} elsif ($code == 0x000D) { |
} elsif ($code == 0x000D) { |
| 2995 |
!!!cp (1017); |
!!!cp (1017); |
| 2996 |
!!!parse-error (type => 'CR character reference', line => $l, column => $c); |
!!!parse-error (type => 'CR character reference', |
| 2997 |
|
line => $l, column => $c); |
| 2998 |
$code = 0x000A; |
$code = 0x000A; |
| 2999 |
} elsif (0x80 <= $code and $code <= 0x9F) { |
} elsif (0x80 <= $code and $code <= 0x9F) { |
| 3000 |
!!!cp (1018); |
!!!cp (1018); |
| 3001 |
!!!parse-error (type => (sprintf 'C1 character reference:U+%04X', $code), line => $l, column => $c); |
!!!parse-error (type => 'C1 character reference', |
| 3002 |
|
text => (sprintf 'U+%04X', $code), |
| 3003 |
|
line => $l, column => $c); |
| 3004 |
$code = $c1_entity_char->{$code}; |
$code = $c1_entity_char->{$code}; |
| 3005 |
} |
} |
| 3006 |
|
|
| 3098 |
## TODO: Turn mutation events off # MUST |
## TODO: Turn mutation events off # MUST |
| 3099 |
## TODO: Turn loose Document option (manakai extension) on |
## TODO: Turn loose Document option (manakai extension) on |
| 3100 |
$self->{document}->manakai_is_html (1); # MUST |
$self->{document}->manakai_is_html (1); # MUST |
| 3101 |
|
$self->{document}->set_user_data (manakai_source_line => 1); |
| 3102 |
|
$self->{document}->set_user_data (manakai_source_column => 1); |
| 3103 |
} # _initialize_tree_constructor |
} # _initialize_tree_constructor |
| 3104 |
|
|
| 3105 |
sub _terminate_tree_constructor ($) { |
sub _terminate_tree_constructor ($) { |
| 3667 |
## NOTE: An end-of-file token. |
## NOTE: An end-of-file token. |
| 3668 |
if ($content_model_flag == CDATA_CONTENT_MODEL) { |
if ($content_model_flag == CDATA_CONTENT_MODEL) { |
| 3669 |
!!!cp ('t43'); |
!!!cp ('t43'); |
| 3670 |
!!!parse-error (type => 'in CDATA:#'.$token->{type}, token => $token); |
!!!parse-error (type => 'in CDATA:#eof', token => $token); |
| 3671 |
} elsif ($content_model_flag == RCDATA_CONTENT_MODEL) { |
} elsif ($content_model_flag == RCDATA_CONTENT_MODEL) { |
| 3672 |
!!!cp ('t44'); |
!!!cp ('t44'); |
| 3673 |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}, token => $token); |
!!!parse-error (type => 'in RCDATA:#eof', token => $token); |
| 3674 |
} else { |
} else { |
| 3675 |
die "$0: $content_model_flag in parse_rcdata"; |
die "$0: $content_model_flag in parse_rcdata"; |
| 3676 |
} |
} |
| 3707 |
## Ignore the token |
## Ignore the token |
| 3708 |
} else { |
} else { |
| 3709 |
!!!cp ('t48'); |
!!!cp ('t48'); |
| 3710 |
!!!parse-error (type => 'in CDATA:#'.$token->{type}, token => $token); |
!!!parse-error (type => 'in CDATA:#eof', token => $token); |
| 3711 |
## ISSUE: And ignore? |
## ISSUE: And ignore? |
| 3712 |
## TODO: mark as "already executed" |
## TODO: mark as "already executed" |
| 3713 |
} |
} |
| 3758 |
} # AFE |
} # AFE |
| 3759 |
unless (defined $formatting_element) { |
unless (defined $formatting_element) { |
| 3760 |
!!!cp ('t53'); |
!!!cp ('t53'); |
| 3761 |
!!!parse-error (type => 'unmatched end tag:'.$tag_name, token => $end_tag_token); |
!!!parse-error (type => 'unmatched end tag', text => $tag_name, token => $end_tag_token); |
| 3762 |
## Ignore the token |
## Ignore the token |
| 3763 |
!!!next-token; |
!!!next-token; |
| 3764 |
return; |
return; |
| 3775 |
last INSCOPE; |
last INSCOPE; |
| 3776 |
} else { # in open elements but not in scope |
} else { # in open elements but not in scope |
| 3777 |
!!!cp ('t55'); |
!!!cp ('t55'); |
| 3778 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, |
!!!parse-error (type => 'unmatched end tag', |
| 3779 |
|
text => $token->{tag_name}, |
| 3780 |
token => $end_tag_token); |
token => $end_tag_token); |
| 3781 |
## Ignore the token |
## Ignore the token |
| 3782 |
!!!next-token; |
!!!next-token; |
| 3789 |
} # INSCOPE |
} # INSCOPE |
| 3790 |
unless (defined $formatting_element_i_in_open) { |
unless (defined $formatting_element_i_in_open) { |
| 3791 |
!!!cp ('t57'); |
!!!cp ('t57'); |
| 3792 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, |
!!!parse-error (type => 'unmatched end tag', |
| 3793 |
|
text => $token->{tag_name}, |
| 3794 |
token => $end_tag_token); |
token => $end_tag_token); |
| 3795 |
pop @$active_formatting_elements; # $formatting_element |
pop @$active_formatting_elements; # $formatting_element |
| 3796 |
!!!next-token; ## TODO: ok? |
!!!next-token; ## TODO: ok? |
| 3799 |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
if (not $self->{open_elements}->[-1]->[0] eq $formatting_element->[0]) { |
| 3800 |
!!!cp ('t58'); |
!!!cp ('t58'); |
| 3801 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 3802 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 3803 |
->manakai_local_name, |
->manakai_local_name, |
| 3804 |
token => $end_tag_token); |
token => $end_tag_token); |
| 3805 |
} |
} |
| 4008 |
B: while (1) { |
B: while (1) { |
| 4009 |
if ($token->{type} == DOCTYPE_TOKEN) { |
if ($token->{type} == DOCTYPE_TOKEN) { |
| 4010 |
!!!cp ('t73'); |
!!!cp ('t73'); |
| 4011 |
!!!parse-error (type => 'DOCTYPE in the middle', token => $token); |
!!!parse-error (type => 'in html:#DOCTYPE', token => $token); |
| 4012 |
## Ignore the token |
## Ignore the token |
| 4013 |
## Stay in the phase |
## Stay in the phase |
| 4014 |
!!!next-token; |
!!!next-token; |
| 4017 |
$token->{tag_name} eq 'html') { |
$token->{tag_name} eq 'html') { |
| 4018 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 4019 |
!!!cp ('t79'); |
!!!cp ('t79'); |
| 4020 |
!!!parse-error (type => 'after html:html', token => $token); |
!!!parse-error (type => 'after html', text => 'html', token => $token); |
| 4021 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = AFTER_BODY_IM; |
| 4022 |
} elsif ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
| 4023 |
!!!cp ('t80'); |
!!!cp ('t80'); |
| 4024 |
!!!parse-error (type => 'after html:html', token => $token); |
!!!parse-error (type => 'after html', text => 'html', token => $token); |
| 4025 |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
| 4026 |
} else { |
} else { |
| 4027 |
!!!cp ('t81'); |
!!!cp ('t81'); |
| 4082 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 4083 |
!!!cp ('t87.2'); |
!!!cp ('t87.2'); |
| 4084 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 4085 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 4086 |
->manakai_local_name, |
->manakai_local_name, |
| 4087 |
token => $token); |
token => $token); |
| 4088 |
|
|
| 4160 |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
| 4161 |
!!!cp ('t87.6'); |
!!!cp ('t87.6'); |
| 4162 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 4163 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 4164 |
->manakai_local_name, |
->manakai_local_name, |
| 4165 |
token => $token); |
token => $token); |
| 4166 |
|
|
| 4210 |
!!!cp ('t90'); |
!!!cp ('t90'); |
| 4211 |
## As if </noscript> |
## As if </noscript> |
| 4212 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4213 |
!!!parse-error (type => 'in noscript:#character', token => $token); |
!!!parse-error (type => 'in noscript:#text', token => $token); |
| 4214 |
|
|
| 4215 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4216 |
## As if </head> |
## As if </head> |
| 4247 |
next B; |
next B; |
| 4248 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4249 |
!!!cp ('t93.2'); |
!!!cp ('t93.2'); |
| 4250 |
!!!parse-error (type => 'after head:head', token => $token); ## TODO: error type |
!!!parse-error (type => 'after head', text => 'head', |
| 4251 |
|
token => $token); |
| 4252 |
## Ignore the token |
## Ignore the token |
| 4253 |
!!!nack ('t93.3'); |
!!!nack ('t93.3'); |
| 4254 |
!!!next-token; |
!!!next-token; |
| 4255 |
next B; |
next B; |
| 4256 |
} else { |
} else { |
| 4257 |
!!!cp ('t95'); |
!!!cp ('t95'); |
| 4258 |
!!!parse-error (type => 'in head:head', token => $token); # or in head noscript |
!!!parse-error (type => 'in head:head', |
| 4259 |
|
token => $token); # or in head noscript |
| 4260 |
## Ignore the token |
## Ignore the token |
| 4261 |
!!!nack ('t95.1'); |
!!!nack ('t95.1'); |
| 4262 |
!!!next-token; |
!!!next-token; |
| 4281 |
!!!cp ('t98'); |
!!!cp ('t98'); |
| 4282 |
## As if </noscript> |
## As if </noscript> |
| 4283 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4284 |
!!!parse-error (type => 'in noscript:base', token => $token); |
!!!parse-error (type => 'in noscript', text => 'base', |
| 4285 |
|
token => $token); |
| 4286 |
|
|
| 4287 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 4288 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4293 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4294 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4295 |
!!!cp ('t100'); |
!!!cp ('t100'); |
| 4296 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4297 |
|
text => $token->{tag_name}, token => $token); |
| 4298 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4299 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4300 |
} else { |
} else { |
| 4311 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4312 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4313 |
!!!cp ('t102'); |
!!!cp ('t102'); |
| 4314 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4315 |
|
text => $token->{tag_name}, token => $token); |
| 4316 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4317 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4318 |
} else { |
} else { |
| 4329 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4330 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4331 |
!!!cp ('t104'); |
!!!cp ('t104'); |
| 4332 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4333 |
|
text => $token->{tag_name}, token => $token); |
| 4334 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4335 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4336 |
} else { |
} else { |
| 4399 |
!!!cp ('t111'); |
!!!cp ('t111'); |
| 4400 |
## As if </noscript> |
## As if </noscript> |
| 4401 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4402 |
!!!parse-error (type => 'in noscript:title', token => $token); |
!!!parse-error (type => 'in noscript', text => 'title', |
| 4403 |
|
token => $token); |
| 4404 |
|
|
| 4405 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 4406 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4407 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4408 |
!!!cp ('t112'); |
!!!cp ('t112'); |
| 4409 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4410 |
|
text => $token->{tag_name}, token => $token); |
| 4411 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4412 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4413 |
} else { |
} else { |
| 4428 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4429 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4430 |
!!!cp ('t114'); |
!!!cp ('t114'); |
| 4431 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4432 |
|
text => $token->{tag_name}, token => $token); |
| 4433 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4434 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4435 |
} else { |
} else { |
| 4450 |
next B; |
next B; |
| 4451 |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 4452 |
!!!cp ('t117'); |
!!!cp ('t117'); |
| 4453 |
!!!parse-error (type => 'in noscript:noscript', token => $token); |
!!!parse-error (type => 'in noscript', text => 'noscript', |
| 4454 |
|
token => $token); |
| 4455 |
## Ignore the token |
## Ignore the token |
| 4456 |
!!!nack ('t117.1'); |
!!!nack ('t117.1'); |
| 4457 |
!!!next-token; |
!!!next-token; |
| 4465 |
!!!cp ('t119'); |
!!!cp ('t119'); |
| 4466 |
## As if </noscript> |
## As if </noscript> |
| 4467 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4468 |
!!!parse-error (type => 'in noscript:script', token => $token); |
!!!parse-error (type => 'in noscript', text => 'script', |
| 4469 |
|
token => $token); |
| 4470 |
|
|
| 4471 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 4472 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4473 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4474 |
!!!cp ('t120'); |
!!!cp ('t120'); |
| 4475 |
!!!parse-error (type => 'after head:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after head', |
| 4476 |
|
text => $token->{tag_name}, token => $token); |
| 4477 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4478 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4479 |
} else { |
} else { |
| 4491 |
!!!cp ('t122'); |
!!!cp ('t122'); |
| 4492 |
## As if </noscript> |
## As if </noscript> |
| 4493 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4494 |
!!!parse-error (type => 'in noscript:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in noscript', |
| 4495 |
|
text => $token->{tag_name}, token => $token); |
| 4496 |
|
|
| 4497 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4498 |
## As if </head> |
## As if </head> |
| 4531 |
!!!cp ('t129'); |
!!!cp ('t129'); |
| 4532 |
## As if </noscript> |
## As if </noscript> |
| 4533 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4534 |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in noscript:/', |
| 4535 |
|
text => $token->{tag_name}, token => $token); |
| 4536 |
|
|
| 4537 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4538 |
## As if </head> |
## As if </head> |
| 4575 |
!!!cp ('t133'); |
!!!cp ('t133'); |
| 4576 |
## As if </noscript> |
## As if </noscript> |
| 4577 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4578 |
!!!parse-error (type => 'in noscript:/head', token => $token); |
!!!parse-error (type => 'in noscript:/', |
| 4579 |
|
text => 'head', token => $token); |
| 4580 |
|
|
| 4581 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4582 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4591 |
next B; |
next B; |
| 4592 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4593 |
!!!cp ('t134.1'); |
!!!cp ('t134.1'); |
| 4594 |
!!!parse-error (type => 'unmatched end tag:head', token => $token); |
!!!parse-error (type => 'unmatched end tag', text => 'head', |
| 4595 |
|
token => $token); |
| 4596 |
## Ignore the token |
## Ignore the token |
| 4597 |
!!!next-token; |
!!!next-token; |
| 4598 |
next B; |
next B; |
| 4609 |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM or |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM or |
| 4610 |
$self->{insertion_mode} == AFTER_HEAD_IM) { |
$self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4611 |
!!!cp ('t137'); |
!!!cp ('t137'); |
| 4612 |
!!!parse-error (type => 'unmatched end tag:noscript', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4613 |
|
text => 'noscript', token => $token); |
| 4614 |
## Ignore the token ## ISSUE: An issue in the spec. |
## Ignore the token ## ISSUE: An issue in the spec. |
| 4615 |
!!!next-token; |
!!!next-token; |
| 4616 |
next B; |
next B; |
| 4625 |
$self->{insertion_mode} == IN_HEAD_IM or |
$self->{insertion_mode} == IN_HEAD_IM or |
| 4626 |
$self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
$self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 4627 |
!!!cp ('t140'); |
!!!cp ('t140'); |
| 4628 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4629 |
|
text => $token->{tag_name}, token => $token); |
| 4630 |
## Ignore the token |
## Ignore the token |
| 4631 |
!!!next-token; |
!!!next-token; |
| 4632 |
next B; |
next B; |
| 4633 |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
} elsif ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4634 |
!!!cp ('t140.1'); |
!!!cp ('t140.1'); |
| 4635 |
!!!parse-error (type => 'unmatched end tag:' . $token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4636 |
|
text => $token->{tag_name}, token => $token); |
| 4637 |
## Ignore the token |
## Ignore the token |
| 4638 |
!!!next-token; |
!!!next-token; |
| 4639 |
next B; |
next B; |
| 4642 |
} |
} |
| 4643 |
} elsif ($token->{tag_name} eq 'p') { |
} elsif ($token->{tag_name} eq 'p') { |
| 4644 |
!!!cp ('t142'); |
!!!cp ('t142'); |
| 4645 |
!!!parse-error (type => 'unmatched end tag:p', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4646 |
|
text => $token->{tag_name}, token => $token); |
| 4647 |
## Ignore the token |
## Ignore the token |
| 4648 |
!!!next-token; |
!!!next-token; |
| 4649 |
next B; |
next B; |
| 4666 |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
} elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) { |
| 4667 |
!!!cp ('t143.3'); |
!!!cp ('t143.3'); |
| 4668 |
## ISSUE: Two parse errors for <head><noscript></br> |
## ISSUE: Two parse errors for <head><noscript></br> |
| 4669 |
!!!parse-error (type => 'unmatched end tag:br', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4670 |
|
text => 'br', token => $token); |
| 4671 |
## As if </noscript> |
## As if </noscript> |
| 4672 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4673 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 4686 |
} |
} |
| 4687 |
|
|
| 4688 |
## ISSUE: does not agree with IE7 - it doesn't ignore </br>. |
## ISSUE: does not agree with IE7 - it doesn't ignore </br>. |
| 4689 |
!!!parse-error (type => 'unmatched end tag:br', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4690 |
|
text => 'br', token => $token); |
| 4691 |
## Ignore the token |
## Ignore the token |
| 4692 |
!!!next-token; |
!!!next-token; |
| 4693 |
next B; |
next B; |
| 4694 |
} else { |
} else { |
| 4695 |
!!!cp ('t145'); |
!!!cp ('t145'); |
| 4696 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4697 |
|
text => $token->{tag_name}, token => $token); |
| 4698 |
## Ignore the token |
## Ignore the token |
| 4699 |
!!!next-token; |
!!!next-token; |
| 4700 |
next B; |
next B; |
| 4704 |
!!!cp ('t146'); |
!!!cp ('t146'); |
| 4705 |
## As if </noscript> |
## As if </noscript> |
| 4706 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4707 |
!!!parse-error (type => 'in noscript:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in noscript:/', |
| 4708 |
|
text => $token->{tag_name}, token => $token); |
| 4709 |
|
|
| 4710 |
## Reprocess in the "in head" insertion mode... |
## Reprocess in the "in head" insertion mode... |
| 4711 |
## As if </head> |
## As if </head> |
| 4721 |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 4722 |
## ISSUE: This case cannot be reached? |
## ISSUE: This case cannot be reached? |
| 4723 |
!!!cp ('t148'); |
!!!cp ('t148'); |
| 4724 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4725 |
|
text => $token->{tag_name}, token => $token); |
| 4726 |
## Ignore the token ## ISSUE: An issue in the spec. |
## Ignore the token ## ISSUE: An issue in the spec. |
| 4727 |
!!!next-token; |
!!!next-token; |
| 4728 |
next B; |
next B; |
| 4833 |
|
|
| 4834 |
!!!cp ('t153'); |
!!!cp ('t153'); |
| 4835 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 4836 |
value => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 4837 |
## Ignore the token |
## Ignore the token |
| 4838 |
!!!nack ('t153.1'); |
!!!nack ('t153.1'); |
| 4839 |
!!!next-token; |
!!!next-token; |
| 4840 |
next B; |
next B; |
| 4841 |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 4842 |
!!!parse-error (type => 'not closed:caption', token => $token); |
!!!parse-error (type => 'not closed', text => 'caption', |
| 4843 |
|
token => $token); |
| 4844 |
|
|
| 4845 |
## NOTE: As if </caption>. |
## NOTE: As if </caption>. |
| 4846 |
## have a table element in table scope |
## have a table element in table scope |
| 4860 |
|
|
| 4861 |
!!!cp ('t157'); |
!!!cp ('t157'); |
| 4862 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 4863 |
value => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 4864 |
## Ignore the token |
## Ignore the token |
| 4865 |
!!!nack ('t157.1'); |
!!!nack ('t157.1'); |
| 4866 |
!!!next-token; |
!!!next-token; |
| 4877 |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
| 4878 |
!!!cp ('t159'); |
!!!cp ('t159'); |
| 4879 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 4880 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 4881 |
->manakai_local_name, |
->manakai_local_name, |
| 4882 |
token => $token); |
token => $token); |
| 4883 |
} else { |
} else { |
| 4919 |
} # INSCOPE |
} # INSCOPE |
| 4920 |
unless (defined $i) { |
unless (defined $i) { |
| 4921 |
!!!cp ('t165'); |
!!!cp ('t165'); |
| 4922 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4923 |
|
text => $token->{tag_name}, |
| 4924 |
|
token => $token); |
| 4925 |
## Ignore the token |
## Ignore the token |
| 4926 |
!!!next-token; |
!!!next-token; |
| 4927 |
next B; |
next B; |
| 4938 |
ne $token->{tag_name}) { |
ne $token->{tag_name}) { |
| 4939 |
!!!cp ('t167'); |
!!!cp ('t167'); |
| 4940 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 4941 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 4942 |
->manakai_local_name, |
->manakai_local_name, |
| 4943 |
token => $token); |
token => $token); |
| 4944 |
} else { |
} else { |
| 4955 |
next B; |
next B; |
| 4956 |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
} elsif ($self->{insertion_mode} == IN_CAPTION_IM) { |
| 4957 |
!!!cp ('t169'); |
!!!cp ('t169'); |
| 4958 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 4959 |
|
text => $token->{tag_name}, token => $token); |
| 4960 |
## Ignore the token |
## Ignore the token |
| 4961 |
!!!next-token; |
!!!next-token; |
| 4962 |
next B; |
next B; |
| 4983 |
|
|
| 4984 |
!!!cp ('t173'); |
!!!cp ('t173'); |
| 4985 |
!!!parse-error (type => 'unmatched end tag', |
!!!parse-error (type => 'unmatched end tag', |
| 4986 |
value => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 4987 |
## Ignore the token |
## Ignore the token |
| 4988 |
!!!next-token; |
!!!next-token; |
| 4989 |
next B; |
next B; |
| 4999 |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
| 5000 |
!!!cp ('t175'); |
!!!cp ('t175'); |
| 5001 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 5002 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 5003 |
->manakai_local_name, |
->manakai_local_name, |
| 5004 |
token => $token); |
token => $token); |
| 5005 |
} else { |
} else { |
| 5016 |
next B; |
next B; |
| 5017 |
} elsif ($self->{insertion_mode} == IN_CELL_IM) { |
} elsif ($self->{insertion_mode} == IN_CELL_IM) { |
| 5018 |
!!!cp ('t177'); |
!!!cp ('t177'); |
| 5019 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5020 |
|
text => $token->{tag_name}, token => $token); |
| 5021 |
## Ignore the token |
## Ignore the token |
| 5022 |
!!!next-token; |
!!!next-token; |
| 5023 |
next B; |
next B; |
| 5060 |
|
|
| 5061 |
!!!cp ('t182'); |
!!!cp ('t182'); |
| 5062 |
!!!parse-error (type => 'unmatched end tag', |
!!!parse-error (type => 'unmatched end tag', |
| 5063 |
value => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 5064 |
## Ignore the token |
## Ignore the token |
| 5065 |
!!!next-token; |
!!!next-token; |
| 5066 |
next B; |
next B; |
| 5067 |
} # INSCOPE |
} # INSCOPE |
| 5068 |
} elsif ($token->{tag_name} eq 'table' and |
} elsif ($token->{tag_name} eq 'table' and |
| 5069 |
$self->{insertion_mode} == IN_CAPTION_IM) { |
$self->{insertion_mode} == IN_CAPTION_IM) { |
| 5070 |
!!!parse-error (type => 'not closed:caption', token => $token); |
!!!parse-error (type => 'not closed', text => 'caption', |
| 5071 |
|
token => $token); |
| 5072 |
|
|
| 5073 |
## As if </caption> |
## As if </caption> |
| 5074 |
## have a table element in table scope |
## have a table element in table scope |
| 5086 |
} # INSCOPE |
} # INSCOPE |
| 5087 |
unless (defined $i) { |
unless (defined $i) { |
| 5088 |
!!!cp ('t186'); |
!!!cp ('t186'); |
| 5089 |
!!!parse-error (type => 'unmatched end tag:caption', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5090 |
|
text => 'caption', token => $token); |
| 5091 |
## Ignore the token |
## Ignore the token |
| 5092 |
!!!next-token; |
!!!next-token; |
| 5093 |
next B; |
next B; |
| 5102 |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
unless ($self->{open_elements}->[-1]->[1] & CAPTION_EL) { |
| 5103 |
!!!cp ('t188'); |
!!!cp ('t188'); |
| 5104 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 5105 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 5106 |
->manakai_local_name, |
->manakai_local_name, |
| 5107 |
token => $token); |
token => $token); |
| 5108 |
} else { |
} else { |
| 5122 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5123 |
if ($self->{insertion_mode} & BODY_TABLE_IMS) { |
if ($self->{insertion_mode} & BODY_TABLE_IMS) { |
| 5124 |
!!!cp ('t190'); |
!!!cp ('t190'); |
| 5125 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5126 |
|
text => $token->{tag_name}, token => $token); |
| 5127 |
## Ignore the token |
## Ignore the token |
| 5128 |
!!!next-token; |
!!!next-token; |
| 5129 |
next B; |
next B; |
| 5137 |
}->{$token->{tag_name}} and |
}->{$token->{tag_name}} and |
| 5138 |
$self->{insertion_mode} == IN_CAPTION_IM) { |
$self->{insertion_mode} == IN_CAPTION_IM) { |
| 5139 |
!!!cp ('t192'); |
!!!cp ('t192'); |
| 5140 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5141 |
|
text => $token->{tag_name}, token => $token); |
| 5142 |
## Ignore the token |
## Ignore the token |
| 5143 |
!!!next-token; |
!!!next-token; |
| 5144 |
next B; |
next B; |
| 5178 |
} |
} |
| 5179 |
} |
} |
| 5180 |
|
|
| 5181 |
!!!parse-error (type => 'in table:#character', token => $token); |
!!!parse-error (type => 'in table:#text', token => $token); |
| 5182 |
|
|
| 5183 |
## As if in body, but insert into foster parent element |
## As if in body, but insert into foster parent element |
| 5184 |
## ISSUE: Spec says that "whenever a node would be inserted |
## ISSUE: Spec says that "whenever a node would be inserted |
| 5229 |
!!!next-token; |
!!!next-token; |
| 5230 |
next B; |
next B; |
| 5231 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 5232 |
if ({ |
if ({ |
| 5233 |
tr => ($self->{insertion_mode} != IN_ROW_IM), |
tr => ($self->{insertion_mode} != IN_ROW_IM), |
| 5234 |
th => 1, td => 1, |
th => 1, td => 1, |
| 5235 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5236 |
if ($self->{insertion_mode} == IN_TABLE_IM) { |
if ($self->{insertion_mode} == IN_TABLE_IM) { |
| 5237 |
## Clear back to table context |
## Clear back to table context |
| 5238 |
while (not ($self->{open_elements}->[-1]->[1] |
while (not ($self->{open_elements}->[-1]->[1] |
| 5239 |
& TABLE_SCOPING_EL)) { |
& TABLE_SCOPING_EL)) { |
| 5240 |
!!!cp ('t201'); |
!!!cp ('t201'); |
| 5241 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5242 |
} |
} |
| 5243 |
|
|
| 5244 |
!!!insert-element ('tbody',, $token); |
!!!insert-element ('tbody',, $token); |
| 5245 |
$self->{insertion_mode} = IN_TABLE_BODY_IM; |
$self->{insertion_mode} = IN_TABLE_BODY_IM; |
| 5246 |
## reprocess in the "in table body" insertion mode... |
## reprocess in the "in table body" insertion mode... |
| 5247 |
} |
} |
| 5248 |
|
|
| 5249 |
if ($self->{insertion_mode} == IN_TABLE_BODY_IM) { |
if ($self->{insertion_mode} == IN_TABLE_BODY_IM) { |
| 5250 |
unless ($token->{tag_name} eq 'tr') { |
unless ($token->{tag_name} eq 'tr') { |
| 5251 |
!!!cp ('t202'); |
!!!cp ('t202'); |
| 5252 |
!!!parse-error (type => 'missing start tag:tr', token => $token); |
!!!parse-error (type => 'missing start tag:tr', token => $token); |
| 5253 |
} |
} |
| 5254 |
|
|
| 5255 |
## Clear back to table body context |
## Clear back to table body context |
| 5256 |
while (not ($self->{open_elements}->[-1]->[1] |
while (not ($self->{open_elements}->[-1]->[1] |
| 5257 |
& TABLE_ROWS_SCOPING_EL)) { |
& TABLE_ROWS_SCOPING_EL)) { |
| 5258 |
!!!cp ('t203'); |
!!!cp ('t203'); |
| 5259 |
## ISSUE: Can this case be reached? |
## ISSUE: Can this case be reached? |
| 5260 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5261 |
} |
} |
| 5262 |
|
|
| 5263 |
$self->{insertion_mode} = IN_ROW_IM; |
$self->{insertion_mode} = IN_ROW_IM; |
| 5264 |
if ($token->{tag_name} eq 'tr') { |
if ($token->{tag_name} eq 'tr') { |
| 5314 |
unless (defined $i) { |
unless (defined $i) { |
| 5315 |
!!!cp ('t210'); |
!!!cp ('t210'); |
| 5316 |
## TODO: This type is wrong. |
## TODO: This type is wrong. |
| 5317 |
!!!parse-error (type => 'unmacthed end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmacthed end tag', |
| 5318 |
|
text => $token->{tag_name}, token => $token); |
| 5319 |
## Ignore the token |
## Ignore the token |
| 5320 |
!!!nack ('t210.1'); |
!!!nack ('t210.1'); |
| 5321 |
!!!next-token; |
!!!next-token; |
| 5359 |
} # INSCOPE |
} # INSCOPE |
| 5360 |
unless (defined $i) { |
unless (defined $i) { |
| 5361 |
!!!cp ('t216'); |
!!!cp ('t216'); |
| 5362 |
## TODO: This erorr type ios wrong. |
## TODO: This erorr type is wrong. |
| 5363 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5364 |
|
text => $token->{tag_name}, token => $token); |
| 5365 |
## Ignore the token |
## Ignore the token |
| 5366 |
!!!nack ('t216.1'); |
!!!nack ('t216.1'); |
| 5367 |
!!!next-token; |
!!!next-token; |
| 5436 |
} |
} |
| 5437 |
} elsif ($token->{tag_name} eq 'table') { |
} elsif ($token->{tag_name} eq 'table') { |
| 5438 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 5439 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 5440 |
->manakai_local_name, |
->manakai_local_name, |
| 5441 |
token => $token); |
token => $token); |
| 5442 |
|
|
| 5457 |
unless (defined $i) { |
unless (defined $i) { |
| 5458 |
!!!cp ('t223'); |
!!!cp ('t223'); |
| 5459 |
## TODO: The following is wrong, maybe. |
## TODO: The following is wrong, maybe. |
| 5460 |
!!!parse-error (type => 'unmatched end tag:table', token => $token); |
!!!parse-error (type => 'unmatched end tag', text => 'table', |
| 5461 |
|
token => $token); |
| 5462 |
## Ignore tokens </table><table> |
## Ignore tokens </table><table> |
| 5463 |
!!!nack ('t223.1'); |
!!!nack ('t223.1'); |
| 5464 |
!!!next-token; |
!!!next-token; |
| 5465 |
next B; |
next B; |
| 5466 |
} |
} |
| 5467 |
|
|
| 5468 |
## TODO: Followings are removed from the latest spec. |
## TODO: Followings are removed from the latest spec. |
| 5469 |
## generate implied end tags |
## generate implied end tags |
| 5470 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 5471 |
!!!cp ('t224'); |
!!!cp ('t224'); |
| 5476 |
!!!cp ('t225'); |
!!!cp ('t225'); |
| 5477 |
## NOTE: |<table><tr><table>| |
## NOTE: |<table><tr><table>| |
| 5478 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 5479 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 5480 |
->manakai_local_name, |
->manakai_local_name, |
| 5481 |
token => $token); |
token => $token); |
| 5482 |
} else { |
} else { |
| 5517 |
my $type = lc $token->{attributes}->{type}->{value}; |
my $type = lc $token->{attributes}->{type}->{value}; |
| 5518 |
if ($type eq 'hidden') { |
if ($type eq 'hidden') { |
| 5519 |
!!!cp ('t227.3'); |
!!!cp ('t227.3'); |
| 5520 |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in table', |
| 5521 |
|
text => $token->{tag_name}, token => $token); |
| 5522 |
|
|
| 5523 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5524 |
|
|
| 5546 |
# |
# |
| 5547 |
} |
} |
| 5548 |
|
|
| 5549 |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in table', text => $token->{tag_name}, |
| 5550 |
|
token => $token); |
| 5551 |
|
|
| 5552 |
$insert = $insert_to_foster; |
$insert = $insert_to_foster; |
| 5553 |
# |
# |
| 5569 |
} # INSCOPE |
} # INSCOPE |
| 5570 |
unless (defined $i) { |
unless (defined $i) { |
| 5571 |
!!!cp ('t230'); |
!!!cp ('t230'); |
| 5572 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5573 |
|
text => $token->{tag_name}, token => $token); |
| 5574 |
## Ignore the token |
## Ignore the token |
| 5575 |
!!!nack ('t230.1'); |
!!!nack ('t230.1'); |
| 5576 |
!!!next-token; |
!!!next-token; |
| 5611 |
unless (defined $i) { |
unless (defined $i) { |
| 5612 |
!!!cp ('t235'); |
!!!cp ('t235'); |
| 5613 |
## TODO: The following is wrong. |
## TODO: The following is wrong. |
| 5614 |
!!!parse-error (type => 'unmatched end tag:'.$token->{type}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5615 |
|
text => $token->{type}, token => $token); |
| 5616 |
## Ignore the token |
## Ignore the token |
| 5617 |
!!!nack ('t236.1'); |
!!!nack ('t236.1'); |
| 5618 |
!!!next-token; |
!!!next-token; |
| 5648 |
} # INSCOPE |
} # INSCOPE |
| 5649 |
unless (defined $i) { |
unless (defined $i) { |
| 5650 |
!!!cp ('t239'); |
!!!cp ('t239'); |
| 5651 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5652 |
|
text => $token->{tag_name}, token => $token); |
| 5653 |
## Ignore the token |
## Ignore the token |
| 5654 |
!!!nack ('t239.1'); |
!!!nack ('t239.1'); |
| 5655 |
!!!next-token; |
!!!next-token; |
| 5695 |
} # INSCOPE |
} # INSCOPE |
| 5696 |
unless (defined $i) { |
unless (defined $i) { |
| 5697 |
!!!cp ('t243'); |
!!!cp ('t243'); |
| 5698 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5699 |
|
text => $token->{tag_name}, token => $token); |
| 5700 |
## Ignore the token |
## Ignore the token |
| 5701 |
!!!nack ('t243.1'); |
!!!nack ('t243.1'); |
| 5702 |
!!!next-token; |
!!!next-token; |
| 5730 |
} # INSCOPE |
} # INSCOPE |
| 5731 |
unless (defined $i) { |
unless (defined $i) { |
| 5732 |
!!!cp ('t249'); |
!!!cp ('t249'); |
| 5733 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5734 |
|
text => $token->{tag_name}, token => $token); |
| 5735 |
## Ignore the token |
## Ignore the token |
| 5736 |
!!!nack ('t249.1'); |
!!!nack ('t249.1'); |
| 5737 |
!!!next-token; |
!!!next-token; |
| 5754 |
} # INSCOPE |
} # INSCOPE |
| 5755 |
unless (defined $i) { |
unless (defined $i) { |
| 5756 |
!!!cp ('t252'); |
!!!cp ('t252'); |
| 5757 |
!!!parse-error (type => 'unmatched end tag:tr', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5758 |
|
text => 'tr', token => $token); |
| 5759 |
## Ignore the token |
## Ignore the token |
| 5760 |
!!!nack ('t252.1'); |
!!!nack ('t252.1'); |
| 5761 |
!!!next-token; |
!!!next-token; |
| 5790 |
} # INSCOPE |
} # INSCOPE |
| 5791 |
unless (defined $i) { |
unless (defined $i) { |
| 5792 |
!!!cp ('t256'); |
!!!cp ('t256'); |
| 5793 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5794 |
|
text => $token->{tag_name}, token => $token); |
| 5795 |
## Ignore the token |
## Ignore the token |
| 5796 |
!!!nack ('t256.1'); |
!!!nack ('t256.1'); |
| 5797 |
!!!next-token; |
!!!next-token; |
| 5818 |
tbody => 1, tfoot => 1, thead => 1, # $self->{insertion_mode} == IN_TABLE_IM |
tbody => 1, tfoot => 1, thead => 1, # $self->{insertion_mode} == IN_TABLE_IM |
| 5819 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5820 |
!!!cp ('t258'); |
!!!cp ('t258'); |
| 5821 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5822 |
|
text => $token->{tag_name}, token => $token); |
| 5823 |
## Ignore the token |
## Ignore the token |
| 5824 |
!!!nack ('t258.1'); |
!!!nack ('t258.1'); |
| 5825 |
!!!next-token; |
!!!next-token; |
| 5826 |
next B; |
next B; |
| 5827 |
} else { |
} else { |
| 5828 |
!!!cp ('t259'); |
!!!cp ('t259'); |
| 5829 |
!!!parse-error (type => 'in table:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in table:/', |
| 5830 |
|
text => $token->{tag_name}, token => $token); |
| 5831 |
|
|
| 5832 |
$insert = $insert_to_foster; |
$insert = $insert_to_foster; |
| 5833 |
# |
# |
| 5877 |
if ($token->{tag_name} eq 'colgroup') { |
if ($token->{tag_name} eq 'colgroup') { |
| 5878 |
if ($self->{open_elements}->[-1]->[1] & HTML_EL) { |
if ($self->{open_elements}->[-1]->[1] & HTML_EL) { |
| 5879 |
!!!cp ('t264'); |
!!!cp ('t264'); |
| 5880 |
!!!parse-error (type => 'unmatched end tag:colgroup', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5881 |
|
text => 'colgroup', token => $token); |
| 5882 |
## Ignore the token |
## Ignore the token |
| 5883 |
!!!next-token; |
!!!next-token; |
| 5884 |
next B; |
next B; |
| 5891 |
} |
} |
| 5892 |
} elsif ($token->{tag_name} eq 'col') { |
} elsif ($token->{tag_name} eq 'col') { |
| 5893 |
!!!cp ('t266'); |
!!!cp ('t266'); |
| 5894 |
!!!parse-error (type => 'unmatched end tag:col', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5895 |
|
text => 'col', token => $token); |
| 5896 |
## Ignore the token |
## Ignore the token |
| 5897 |
!!!next-token; |
!!!next-token; |
| 5898 |
next B; |
next B; |
| 5922 |
if ($self->{open_elements}->[-1]->[1] & HTML_EL) { |
if ($self->{open_elements}->[-1]->[1] & HTML_EL) { |
| 5923 |
!!!cp ('t269'); |
!!!cp ('t269'); |
| 5924 |
## TODO: Wrong error type? |
## TODO: Wrong error type? |
| 5925 |
!!!parse-error (type => 'unmatched end tag:colgroup', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 5926 |
|
text => 'colgroup', token => $token); |
| 5927 |
## Ignore the token |
## Ignore the token |
| 5928 |
!!!nack ('t269.1'); |
!!!nack ('t269.1'); |
| 5929 |
!!!next-token; |
!!!next-token; |
| 5987 |
tr => 1, td => 1, th => 1, |
tr => 1, td => 1, th => 1, |
| 5988 |
}->{$token->{tag_name}})) { |
}->{$token->{tag_name}})) { |
| 5989 |
## TODO: The type below is not good - <select> is replaced by </select> |
## TODO: The type below is not good - <select> is replaced by </select> |
| 5990 |
!!!parse-error (type => 'not closed:select', token => $token); |
!!!parse-error (type => 'not closed', text => 'select', |
| 5991 |
|
token => $token); |
| 5992 |
## NOTE: As if the token were </select> (<select> case) or |
## NOTE: As if the token were </select> (<select> case) or |
| 5993 |
## as if there were </select> (otherwise). |
## as if there were </select> (otherwise). |
| 5994 |
## have an element in table scope |
## have an element in table scope |
| 6006 |
} # INSCOPE |
} # INSCOPE |
| 6007 |
unless (defined $i) { |
unless (defined $i) { |
| 6008 |
!!!cp ('t280'); |
!!!cp ('t280'); |
| 6009 |
!!!parse-error (type => 'unmatched end tag:select', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6010 |
|
text => 'select', token => $token); |
| 6011 |
## Ignore the token |
## Ignore the token |
| 6012 |
!!!nack ('t280.1'); |
!!!nack ('t280.1'); |
| 6013 |
!!!next-token; |
!!!next-token; |
| 6031 |
} |
} |
| 6032 |
} else { |
} else { |
| 6033 |
!!!cp ('t282'); |
!!!cp ('t282'); |
| 6034 |
!!!parse-error (type => 'in select:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in select', |
| 6035 |
|
text => $token->{tag_name}, token => $token); |
| 6036 |
## Ignore the token |
## Ignore the token |
| 6037 |
!!!nack ('t282.1'); |
!!!nack ('t282.1'); |
| 6038 |
!!!next-token; |
!!!next-token; |
| 6050 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 6051 |
} else { |
} else { |
| 6052 |
!!!cp ('t285'); |
!!!cp ('t285'); |
| 6053 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6054 |
|
text => $token->{tag_name}, token => $token); |
| 6055 |
## Ignore the token |
## Ignore the token |
| 6056 |
} |
} |
| 6057 |
!!!nack ('t285.1'); |
!!!nack ('t285.1'); |
| 6063 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 6064 |
} else { |
} else { |
| 6065 |
!!!cp ('t287'); |
!!!cp ('t287'); |
| 6066 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6067 |
|
text => $token->{tag_name}, token => $token); |
| 6068 |
## Ignore the token |
## Ignore the token |
| 6069 |
} |
} |
| 6070 |
!!!nack ('t287.1'); |
!!!nack ('t287.1'); |
| 6086 |
} # INSCOPE |
} # INSCOPE |
| 6087 |
unless (defined $i) { |
unless (defined $i) { |
| 6088 |
!!!cp ('t290'); |
!!!cp ('t290'); |
| 6089 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6090 |
|
text => $token->{tag_name}, token => $token); |
| 6091 |
## Ignore the token |
## Ignore the token |
| 6092 |
!!!nack ('t290.1'); |
!!!nack ('t290.1'); |
| 6093 |
!!!next-token; |
!!!next-token; |
| 6108 |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
tfoot => 1, thead => 1, tr => 1, td => 1, th => 1, |
| 6109 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6110 |
## TODO: The following is wrong? |
## TODO: The following is wrong? |
| 6111 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6112 |
|
text => $token->{tag_name}, token => $token); |
| 6113 |
|
|
| 6114 |
## have an element in table scope |
## have an element in table scope |
| 6115 |
my $i; |
my $i; |
| 6150 |
unless (defined $i) { |
unless (defined $i) { |
| 6151 |
!!!cp ('t297'); |
!!!cp ('t297'); |
| 6152 |
## TODO: The following error type is correct? |
## TODO: The following error type is correct? |
| 6153 |
!!!parse-error (type => 'unmatched end tag:select', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6154 |
|
text => 'select', token => $token); |
| 6155 |
## Ignore the </select> token |
## Ignore the </select> token |
| 6156 |
!!!nack ('t297.1'); |
!!!nack ('t297.1'); |
| 6157 |
!!!next-token; ## TODO: ok? |
!!!next-token; ## TODO: ok? |
| 6168 |
next B; |
next B; |
| 6169 |
} else { |
} else { |
| 6170 |
!!!cp ('t299'); |
!!!cp ('t299'); |
| 6171 |
!!!parse-error (type => 'in select:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in select:/', |
| 6172 |
|
text => $token->{tag_name}, token => $token); |
| 6173 |
## Ignore the token |
## Ignore the token |
| 6174 |
!!!nack ('t299.3'); |
!!!nack ('t299.3'); |
| 6175 |
!!!next-token; |
!!!next-token; |
| 6207 |
|
|
| 6208 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 6209 |
!!!cp ('t301'); |
!!!cp ('t301'); |
| 6210 |
!!!parse-error (type => 'after html:#character', token => $token); |
!!!parse-error (type => 'after html:#text', token => $token); |
| 6211 |
|
|
| 6212 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 6213 |
} else { |
} else { |
| 6215 |
} |
} |
| 6216 |
|
|
| 6217 |
## "after body" insertion mode |
## "after body" insertion mode |
| 6218 |
!!!parse-error (type => 'after body:#character', token => $token); |
!!!parse-error (type => 'after body:#text', token => $token); |
| 6219 |
|
|
| 6220 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6221 |
## reprocess |
## reprocess |
| 6223 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 6224 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 6225 |
!!!cp ('t303'); |
!!!cp ('t303'); |
| 6226 |
!!!parse-error (type => 'after html:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after html', |
| 6227 |
|
text => $token->{tag_name}, token => $token); |
| 6228 |
|
|
| 6229 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 6230 |
} else { |
} else { |
| 6232 |
} |
} |
| 6233 |
|
|
| 6234 |
## "after body" insertion mode |
## "after body" insertion mode |
| 6235 |
!!!parse-error (type => 'after body:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after body', |
| 6236 |
|
text => $token->{tag_name}, token => $token); |
| 6237 |
|
|
| 6238 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6239 |
!!!ack-later; |
!!!ack-later; |
| 6242 |
} elsif ($token->{type} == END_TAG_TOKEN) { |
} elsif ($token->{type} == END_TAG_TOKEN) { |
| 6243 |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
if ($self->{insertion_mode} == AFTER_HTML_BODY_IM) { |
| 6244 |
!!!cp ('t305'); |
!!!cp ('t305'); |
| 6245 |
!!!parse-error (type => 'after html:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after html:/', |
| 6246 |
|
text => $token->{tag_name}, token => $token); |
| 6247 |
|
|
| 6248 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = AFTER_BODY_IM; |
| 6249 |
## Reprocess in the "after body" insertion mode. |
## Reprocess in the "after body" insertion mode. |
| 6255 |
if ($token->{tag_name} eq 'html') { |
if ($token->{tag_name} eq 'html') { |
| 6256 |
if (defined $self->{inner_html_node}) { |
if (defined $self->{inner_html_node}) { |
| 6257 |
!!!cp ('t307'); |
!!!cp ('t307'); |
| 6258 |
!!!parse-error (type => 'unmatched end tag:html', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6259 |
|
text => 'html', token => $token); |
| 6260 |
## Ignore the token |
## Ignore the token |
| 6261 |
!!!next-token; |
!!!next-token; |
| 6262 |
next B; |
next B; |
| 6268 |
} |
} |
| 6269 |
} else { |
} else { |
| 6270 |
!!!cp ('t309'); |
!!!cp ('t309'); |
| 6271 |
!!!parse-error (type => 'after body:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after body:/', |
| 6272 |
|
text => $token->{tag_name}, token => $token); |
| 6273 |
|
|
| 6274 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 6275 |
## reprocess |
## reprocess |
| 6297 |
if ($token->{data} =~ s/^[^\x09\x0A\x0B\x0C\x20]+//) { |
if ($token->{data} =~ s/^[^\x09\x0A\x0B\x0C\x20]+//) { |
| 6298 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6299 |
!!!cp ('t311'); |
!!!cp ('t311'); |
| 6300 |
!!!parse-error (type => 'in frameset:#character', token => $token); |
!!!parse-error (type => 'in frameset:#text', token => $token); |
| 6301 |
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
| 6302 |
!!!cp ('t312'); |
!!!cp ('t312'); |
| 6303 |
!!!parse-error (type => 'after frameset:#character', token => $token); |
!!!parse-error (type => 'after frameset:#text', token => $token); |
| 6304 |
} else { # "after html frameset" |
} else { # "after after frameset" |
| 6305 |
!!!cp ('t313'); |
!!!cp ('t313'); |
| 6306 |
!!!parse-error (type => 'after html:#character', token => $token); |
!!!parse-error (type => 'after html:#text', token => $token); |
|
|
|
|
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
|
|
## Reprocess in the "after frameset" insertion mode. |
|
|
!!!parse-error (type => 'after frameset:#character', token => $token); |
|
| 6307 |
} |
} |
| 6308 |
|
|
| 6309 |
## Ignore the token. |
## Ignore the token. |
| 6319 |
|
|
| 6320 |
die qq[$0: Character "$token->{data}"]; |
die qq[$0: Character "$token->{data}"]; |
| 6321 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
|
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
|
|
!!!cp ('t316'); |
|
|
!!!parse-error (type => 'after html:'.$token->{tag_name}, token => $token); |
|
|
|
|
|
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
|
|
## Process in the "after frameset" insertion mode. |
|
|
} else { |
|
|
!!!cp ('t317'); |
|
|
} |
|
|
|
|
| 6322 |
if ($token->{tag_name} eq 'frameset' and |
if ($token->{tag_name} eq 'frameset' and |
| 6323 |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6324 |
!!!cp ('t318'); |
!!!cp ('t318'); |
| 6339 |
## NOTE: As if in head. |
## NOTE: As if in head. |
| 6340 |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
| 6341 |
next B; |
next B; |
| 6342 |
|
|
| 6343 |
|
## NOTE: |<!DOCTYPE HTML><frameset></frameset></html><noframes></noframes>| |
| 6344 |
|
## has no parse error. |
| 6345 |
} else { |
} else { |
| 6346 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6347 |
!!!cp ('t321'); |
!!!cp ('t321'); |
| 6348 |
!!!parse-error (type => 'in frameset:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in frameset', |
| 6349 |
} else { |
text => $token->{tag_name}, token => $token); |
| 6350 |
|
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
| 6351 |
!!!cp ('t322'); |
!!!cp ('t322'); |
| 6352 |
!!!parse-error (type => 'after frameset:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after frameset', |
| 6353 |
|
text => $token->{tag_name}, token => $token); |
| 6354 |
|
} else { # "after after frameset" |
| 6355 |
|
!!!cp ('t322.2'); |
| 6356 |
|
!!!parse-error (type => 'after after frameset', |
| 6357 |
|
text => $token->{tag_name}, token => $token); |
| 6358 |
} |
} |
| 6359 |
## Ignore the token |
## Ignore the token |
| 6360 |
!!!nack ('t322.1'); |
!!!nack ('t322.1'); |
| 6362 |
next B; |
next B; |
| 6363 |
} |
} |
| 6364 |
} elsif ($token->{type} == END_TAG_TOKEN) { |
} elsif ($token->{type} == END_TAG_TOKEN) { |
|
if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) { |
|
|
!!!cp ('t323'); |
|
|
!!!parse-error (type => 'after html:/'.$token->{tag_name}, token => $token); |
|
|
|
|
|
$self->{insertion_mode} = AFTER_FRAMESET_IM; |
|
|
## Process in the "after frameset" insertion mode. |
|
|
} else { |
|
|
!!!cp ('t324'); |
|
|
} |
|
|
|
|
| 6365 |
if ($token->{tag_name} eq 'frameset' and |
if ($token->{tag_name} eq 'frameset' and |
| 6366 |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6367 |
if ($self->{open_elements}->[-1]->[1] & HTML_EL and |
if ($self->{open_elements}->[-1]->[1] & HTML_EL and |
| 6368 |
@{$self->{open_elements}} == 1) { |
@{$self->{open_elements}} == 1) { |
| 6369 |
!!!cp ('t325'); |
!!!cp ('t325'); |
| 6370 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 6371 |
|
text => $token->{tag_name}, token => $token); |
| 6372 |
## Ignore the token |
## Ignore the token |
| 6373 |
!!!next-token; |
!!!next-token; |
| 6374 |
} else { |
} else { |
| 6394 |
} else { |
} else { |
| 6395 |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
if ($self->{insertion_mode} == IN_FRAMESET_IM) { |
| 6396 |
!!!cp ('t330'); |
!!!cp ('t330'); |
| 6397 |
!!!parse-error (type => 'in frameset:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in frameset:/', |
| 6398 |
} else { |
text => $token->{tag_name}, token => $token); |
| 6399 |
|
} elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) { |
| 6400 |
|
!!!cp ('t330.1'); |
| 6401 |
|
!!!parse-error (type => 'after frameset:/', |
| 6402 |
|
text => $token->{tag_name}, token => $token); |
| 6403 |
|
} else { # "after after html" |
| 6404 |
!!!cp ('t331'); |
!!!cp ('t331'); |
| 6405 |
!!!parse-error (type => 'after frameset:/'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'after after frameset:/', |
| 6406 |
|
text => $token->{tag_name}, token => $token); |
| 6407 |
} |
} |
| 6408 |
## Ignore the token |
## Ignore the token |
| 6409 |
!!!next-token; |
!!!next-token; |
| 6511 |
$parse_rcdata->(RCDATA_CONTENT_MODEL); |
$parse_rcdata->(RCDATA_CONTENT_MODEL); |
| 6512 |
next B; |
next B; |
| 6513 |
} elsif ($token->{tag_name} eq 'body') { |
} elsif ($token->{tag_name} eq 'body') { |
| 6514 |
!!!parse-error (type => 'in body:body', token => $token); |
!!!parse-error (type => 'in body', text => 'body', token => $token); |
| 6515 |
|
|
| 6516 |
if (@{$self->{open_elements}} == 1 or |
if (@{$self->{open_elements}} == 1 or |
| 6517 |
not ($self->{open_elements}->[1]->[1] & BODY_EL)) { |
not ($self->{open_elements}->[1]->[1] & BODY_EL)) { |
| 6631 |
if ($i != -1) { |
if ($i != -1) { |
| 6632 |
!!!cp ('t355'); |
!!!cp ('t355'); |
| 6633 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 6634 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 6635 |
->manakai_local_name, |
->manakai_local_name, |
| 6636 |
token => $token); |
token => $token); |
| 6637 |
} else { |
} else { |
| 6899 |
## Ignore the token |
## Ignore the token |
| 6900 |
} else { |
} else { |
| 6901 |
!!!cp ('t398'); |
!!!cp ('t398'); |
| 6902 |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}, token => $token); |
!!!parse-error (type => 'in RCDATA:#eof', token => $token); |
| 6903 |
} |
} |
| 6904 |
!!!next-token; |
!!!next-token; |
| 6905 |
next B; |
next B; |
| 6906 |
|
} elsif ($token->{tag_name} eq 'rt' or |
| 6907 |
|
$token->{tag_name} eq 'rp') { |
| 6908 |
|
## has a |ruby| element in scope |
| 6909 |
|
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 6910 |
|
my $node = $self->{open_elements}->[$_]; |
| 6911 |
|
if ($node->[1] & RUBY_EL) { |
| 6912 |
|
!!!cp ('t398.1'); |
| 6913 |
|
## generate implied end tags |
| 6914 |
|
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 6915 |
|
!!!cp ('t398.2'); |
| 6916 |
|
pop @{$self->{open_elements}}; |
| 6917 |
|
} |
| 6918 |
|
unless ($self->{open_elements}->[-1]->[1] & RUBY_EL) { |
| 6919 |
|
!!!cp ('t398.3'); |
| 6920 |
|
!!!parse-error (type => 'not closed', |
| 6921 |
|
text => $self->{open_elements}->[-1]->[0] |
| 6922 |
|
->manakai_local_name, |
| 6923 |
|
token => $token); |
| 6924 |
|
pop @{$self->{open_elements}} |
| 6925 |
|
while not $self->{open_elements}->[-1]->[1] & RUBY_EL; |
| 6926 |
|
} |
| 6927 |
|
last INSCOPE; |
| 6928 |
|
} elsif ($node->[1] & SCOPING_EL) { |
| 6929 |
|
!!!cp ('t398.4'); |
| 6930 |
|
last INSCOPE; |
| 6931 |
|
} |
| 6932 |
|
} # INSCOPE |
| 6933 |
|
|
| 6934 |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6935 |
|
|
| 6936 |
|
!!!nack ('t398.5'); |
| 6937 |
|
!!!next-token; |
| 6938 |
|
redo B; |
| 6939 |
} elsif ($token->{tag_name} eq 'math' or |
} elsif ($token->{tag_name} eq 'math' or |
| 6940 |
$token->{tag_name} eq 'svg') { |
$token->{tag_name} eq 'svg') { |
| 6941 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 6942 |
|
|
| 6943 |
|
## "Adjust MathML attributes" ('math' only) - done in insert-element-f |
| 6944 |
|
|
| 6945 |
## "adjust SVG attributes" ('svg' only) - done in insert-element-f |
## "adjust SVG attributes" ('svg' only) - done in insert-element-f |
| 6946 |
|
|
| 6947 |
## "adjust foreign attributes" - done in insert-element-f |
## "adjust foreign attributes" - done in insert-element-f |
| 6968 |
thead => 1, tr => 1, |
thead => 1, tr => 1, |
| 6969 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6970 |
!!!cp ('t401'); |
!!!cp ('t401'); |
| 6971 |
!!!parse-error (type => 'in body:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in body', |
| 6972 |
|
text => $token->{tag_name}, token => $token); |
| 6973 |
## Ignore the token |
## Ignore the token |
| 6974 |
!!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error. |
!!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error. |
| 6975 |
!!!next-token; |
!!!next-token; |
| 7054 |
} |
} |
| 7055 |
|
|
| 7056 |
!!!parse-error (type => 'start tag not allowed', |
!!!parse-error (type => 'start tag not allowed', |
| 7057 |
value => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 7058 |
## NOTE: Ignore the token. |
## NOTE: Ignore the token. |
| 7059 |
!!!next-token; |
!!!next-token; |
| 7060 |
next B; |
next B; |
| 7064 |
unless ($_->[1] & ALL_END_TAG_OPTIONAL_EL) { |
unless ($_->[1] & ALL_END_TAG_OPTIONAL_EL) { |
| 7065 |
!!!cp ('t403'); |
!!!cp ('t403'); |
| 7066 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7067 |
value => $_->[0]->manakai_local_name, |
text => $_->[0]->manakai_local_name, |
| 7068 |
token => $token); |
token => $token); |
| 7069 |
last; |
last; |
| 7070 |
} else { |
} else { |
| 7084 |
unless ($self->{open_elements}->[-1]->[1] & BODY_EL) { |
unless ($self->{open_elements}->[-1]->[1] & BODY_EL) { |
| 7085 |
!!!cp ('t406'); |
!!!cp ('t406'); |
| 7086 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7087 |
value => $self->{open_elements}->[1]->[0] |
text => $self->{open_elements}->[1]->[0] |
| 7088 |
->manakai_local_name, |
->manakai_local_name, |
| 7089 |
token => $token); |
token => $token); |
| 7090 |
} else { |
} else { |
| 7095 |
next B; |
next B; |
| 7096 |
} else { |
} else { |
| 7097 |
!!!cp ('t408'); |
!!!cp ('t408'); |
| 7098 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7099 |
|
text => $token->{tag_name}, token => $token); |
| 7100 |
## Ignore the token |
## Ignore the token |
| 7101 |
!!!next-token; |
!!!next-token; |
| 7102 |
next B; |
next B; |
| 7124 |
|
|
| 7125 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 7126 |
!!!cp ('t413'); |
!!!cp ('t413'); |
| 7127 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7128 |
|
text => $token->{tag_name}, token => $token); |
| 7129 |
|
## NOTE: Ignore the token. |
| 7130 |
} else { |
} else { |
| 7131 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 7132 |
while ({ |
while ({ |
| 7133 |
|
## END_TAG_OPTIONAL_EL |
| 7134 |
dd => ($token->{tag_name} ne 'dd'), |
dd => ($token->{tag_name} ne 'dd'), |
| 7135 |
dt => ($token->{tag_name} ne 'dt'), |
dt => ($token->{tag_name} ne 'dt'), |
| 7136 |
li => ($token->{tag_name} ne 'li'), |
li => ($token->{tag_name} ne 'li'), |
| 7137 |
p => 1, |
p => 1, |
| 7138 |
|
rt => 1, |
| 7139 |
|
rp => 1, |
| 7140 |
}->{$self->{open_elements}->[-1]->[0]->manakai_local_name}) { |
}->{$self->{open_elements}->[-1]->[0]->manakai_local_name}) { |
| 7141 |
!!!cp ('t409'); |
!!!cp ('t409'); |
| 7142 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7147 |
ne $token->{tag_name}) { |
ne $token->{tag_name}) { |
| 7148 |
!!!cp ('t412'); |
!!!cp ('t412'); |
| 7149 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7150 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 7151 |
->manakai_local_name, |
->manakai_local_name, |
| 7152 |
token => $token); |
token => $token); |
| 7153 |
} else { |
} else { |
| 7184 |
|
|
| 7185 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 7186 |
!!!cp ('t421'); |
!!!cp ('t421'); |
| 7187 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7188 |
|
text => $token->{tag_name}, token => $token); |
| 7189 |
|
## NOTE: Ignore the token. |
| 7190 |
} else { |
} else { |
| 7191 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 7192 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 7199 |
ne $token->{tag_name}) { |
ne $token->{tag_name}) { |
| 7200 |
!!!cp ('t417.1'); |
!!!cp ('t417.1'); |
| 7201 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7202 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 7203 |
->manakai_local_name, |
->manakai_local_name, |
| 7204 |
token => $token); |
token => $token); |
| 7205 |
} else { |
} else { |
| 7231 |
|
|
| 7232 |
unless (defined $i) { # has an element in scope |
unless (defined $i) { # has an element in scope |
| 7233 |
!!!cp ('t425.1'); |
!!!cp ('t425.1'); |
| 7234 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7235 |
|
text => $token->{tag_name}, token => $token); |
| 7236 |
|
## NOTE: Ignore the token. |
| 7237 |
} else { |
} else { |
| 7238 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 7239 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 7245 |
if ($self->{open_elements}->[-1]->[0]->manakai_local_name |
if ($self->{open_elements}->[-1]->[0]->manakai_local_name |
| 7246 |
ne $token->{tag_name}) { |
ne $token->{tag_name}) { |
| 7247 |
!!!cp ('t425'); |
!!!cp ('t425'); |
| 7248 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7249 |
|
text => $token->{tag_name}, token => $token); |
| 7250 |
} else { |
} else { |
| 7251 |
!!!cp ('t426'); |
!!!cp ('t426'); |
| 7252 |
} |
} |
| 7277 |
ne $token->{tag_name}) { |
ne $token->{tag_name}) { |
| 7278 |
!!!cp ('t412.1'); |
!!!cp ('t412.1'); |
| 7279 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7280 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 7281 |
->manakai_local_name, |
->manakai_local_name, |
| 7282 |
token => $token); |
token => $token); |
| 7283 |
} else { |
} else { |
| 7287 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 7288 |
} else { |
} else { |
| 7289 |
!!!cp ('t413.1'); |
!!!cp ('t413.1'); |
| 7290 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7291 |
|
text => $token->{tag_name}, token => $token); |
| 7292 |
|
|
| 7293 |
!!!cp ('t415.1'); |
!!!cp ('t415.1'); |
| 7294 |
## As if <p>, then reprocess the current token |
## As if <p>, then reprocess the current token |
| 7311 |
next B; |
next B; |
| 7312 |
} elsif ($token->{tag_name} eq 'br') { |
} elsif ($token->{tag_name} eq 'br') { |
| 7313 |
!!!cp ('t428'); |
!!!cp ('t428'); |
| 7314 |
!!!parse-error (type => 'unmatched end tag:br', token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7315 |
|
text => 'br', token => $token); |
| 7316 |
|
|
| 7317 |
## As if <br> |
## As if <br> |
| 7318 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 7337 |
noscript => 0, ## TODO: if scripting is enabled |
noscript => 0, ## TODO: if scripting is enabled |
| 7338 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 7339 |
!!!cp ('t429'); |
!!!cp ('t429'); |
| 7340 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7341 |
|
text => $token->{tag_name}, token => $token); |
| 7342 |
## Ignore the token |
## Ignore the token |
| 7343 |
!!!next-token; |
!!!next-token; |
| 7344 |
next B; |
next B; |
| 7357 |
## generate implied end tags |
## generate implied end tags |
| 7358 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 7359 |
!!!cp ('t430'); |
!!!cp ('t430'); |
| 7360 |
## ISSUE: Can this case be reached? |
## NOTE: |<ruby><rt></ruby>|. |
| 7361 |
|
## ISSUE: <ruby><rt></rt> will also take this code path, |
| 7362 |
|
## which seems wrong. |
| 7363 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7364 |
|
$node_i++; |
| 7365 |
} |
} |
| 7366 |
|
|
| 7367 |
## Step 2 |
## Step 2 |
| 7370 |
!!!cp ('t431'); |
!!!cp ('t431'); |
| 7371 |
## NOTE: <x><y></x> |
## NOTE: <x><y></x> |
| 7372 |
!!!parse-error (type => 'not closed', |
!!!parse-error (type => 'not closed', |
| 7373 |
value => $self->{open_elements}->[-1]->[0] |
text => $self->{open_elements}->[-1]->[0] |
| 7374 |
->manakai_local_name, |
->manakai_local_name, |
| 7375 |
token => $token); |
token => $token); |
| 7376 |
} else { |
} else { |
| 7378 |
} |
} |
| 7379 |
|
|
| 7380 |
## Step 3 |
## Step 3 |
| 7381 |
splice @{$self->{open_elements}}, $node_i; |
splice @{$self->{open_elements}}, $node_i if $node_i < 0; |
| 7382 |
|
|
| 7383 |
!!!next-token; |
!!!next-token; |
| 7384 |
last S2; |
last S2; |
| 7389 |
($node->[1] & SPECIAL_EL or |
($node->[1] & SPECIAL_EL or |
| 7390 |
$node->[1] & SCOPING_EL)) { |
$node->[1] & SCOPING_EL)) { |
| 7391 |
!!!cp ('t433'); |
!!!cp ('t433'); |
| 7392 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'unmatched end tag', |
| 7393 |
|
text => $token->{tag_name}, token => $token); |
| 7394 |
## Ignore the token |
## Ignore the token |
| 7395 |
!!!next-token; |
!!!next-token; |
| 7396 |
last S2; |
last S2; |
| 7526 |
0x10FFFE => 1, 0x10FFFF => 1, |
0x10FFFE => 1, 0x10FFFF => 1, |
| 7527 |
}->{$self->{next_char}}) { |
}->{$self->{next_char}}) { |
| 7528 |
!!!cp ('i4.1'); |
!!!cp ('i4.1'); |
| 7529 |
!!!parse-error (type => 'control char', level => $self->{must_level}); |
if ($self->{next_char} < 0x10000) { |
| 7530 |
## TODO: error type documentation |
!!!parse-error (type => 'control char', |
| 7531 |
|
text => (sprintf 'U+%04X', $self->{next_char})); |
| 7532 |
|
} else { |
| 7533 |
|
!!!parse-error (type => 'control char', |
| 7534 |
|
text => (sprintf 'U-%08X', $self->{next_char})); |
| 7535 |
|
} |
| 7536 |
} |
} |
| 7537 |
}; |
}; |
| 7538 |
$p->{prev_char} = [-1, -1, -1]; |
$p->{prev_char} = [-1, -1, -1]; |