/[suikacvs]/markup/html/whatpm/Whatpm/HTML.pm.src
Suika

Diff of /markup/html/whatpm/Whatpm/HTML.pm.src

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.152 by wakaba, Sun Jun 29 11:15:53 2008 UTC revision 1.156 by wakaba, Sat Aug 30 13:43:50 2008 UTC
# Line 443  sub parse_byte_stream ($$$$;$) { Line 443  sub parse_byte_stream ($$$$;$) {
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;
# Line 466  sub parse_byte_stream ($$$$;$) { Line 467  sub parse_byte_stream ($$$$;$) {
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 {
# Line 513  sub parse_byte_stream ($$$$;$) { Line 517  sub parse_byte_stream ($$$$;$) {
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) {
# Line 537  sub parse_byte_stream ($$$$;$) { Line 544  sub parse_byte_stream ($$$$;$) {
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
# Line 554  sub parse_byte_stream ($$$$;$) { Line 562  sub parse_byte_stream ($$$$;$) {
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);
# Line 662  sub parse_char_stream ($$$;$) { Line 672  sub parse_char_stream ($$$;$) {
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];
# Line 692  sub parse_char_stream ($$$;$) { Line 707  sub parse_char_stream ($$$;$) {
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;
# Line 1356  sub _get_next_token ($) { Line 1369  sub _get_next_token ($) {
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);
# Line 1527  sub _get_next_token ($) { Line 1540  sub _get_next_token ($) {
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 => '',
# Line 1562  sub _get_next_token ($) { Line 1581  sub _get_next_token ($) {
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};
# Line 2667  sub _get_next_token ($) { Line 2687  sub _get_next_token ($) {
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;
# Line 2703  sub _get_next_token ($) { Line 2723  sub _get_next_token ($) {
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;
# Line 2912  sub _tokenize_attempt_to_consume_an_enti Line 2932  sub _tokenize_attempt_to_consume_an_enti
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);
# Line 2924  sub _tokenize_attempt_to_consume_an_enti Line 2948  sub _tokenize_attempt_to_consume_an_enti
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    
# Line 2957  sub _tokenize_attempt_to_consume_an_enti Line 2981  sub _tokenize_attempt_to_consume_an_enti
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                
# Line 3067  sub _initialize_tree_constructor ($) { Line 3098  sub _initialize_tree_constructor ($) {
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 ($) {
# Line 3317  sub _tree_construction_root_element ($) Line 3350  sub _tree_construction_root_element ($)
3350    B: {    B: {
3351        if ($token->{type} == DOCTYPE_TOKEN) {        if ($token->{type} == DOCTYPE_TOKEN) {
3352          !!!cp ('t19');          !!!cp ('t19');
3353          !!!parse-error (type => 'in html:#DOCTYPE', token => $token); ## TODO: type          !!!parse-error (type => 'in html:#DOCTYPE', token => $token);
3354          ## Ignore the token          ## Ignore the token
3355          ## Stay in the insertion mode.          ## Stay in the insertion mode.
3356          !!!next-token;          !!!next-token;
# Line 3634  sub _tree_construction_main ($) { Line 3667  sub _tree_construction_main ($) {
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        }        }
# Line 3674  sub _tree_construction_main ($) { Line 3707  sub _tree_construction_main ($) {
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      }      }
# Line 3725  sub _tree_construction_main ($) { Line 3758  sub _tree_construction_main ($) {
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;
# Line 3742  sub _tree_construction_main ($) { Line 3775  sub _tree_construction_main ($) {
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;
# Line 3755  sub _tree_construction_main ($) { Line 3789  sub _tree_construction_main ($) {
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?
# Line 3764  sub _tree_construction_main ($) { Line 3799  sub _tree_construction_main ($) {
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        }        }
# Line 3973  sub _tree_construction_main ($) { Line 4008  sub _tree_construction_main ($) {
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;
# Line 3982  sub _tree_construction_main ($) { Line 4017  sub _tree_construction_main ($) {
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');
# Line 4047  sub _tree_construction_main ($) { Line 4082  sub _tree_construction_main ($) {
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    
# Line 4125  sub _tree_construction_main ($) { Line 4160  sub _tree_construction_main ($) {
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    
# Line 4175  sub _tree_construction_main ($) { Line 4210  sub _tree_construction_main ($) {
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>
# Line 4212  sub _tree_construction_main ($) { Line 4247  sub _tree_construction_main ($) {
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;
# Line 4244  sub _tree_construction_main ($) { Line 4281  sub _tree_construction_main ($) {
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...
# Line 4255  sub _tree_construction_main ($) { Line 4293  sub _tree_construction_main ($) {
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 {
# Line 4272  sub _tree_construction_main ($) { Line 4311  sub _tree_construction_main ($) {
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 {
# Line 4289  sub _tree_construction_main ($) { Line 4329  sub _tree_construction_main ($) {
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 {
# Line 4358  sub _tree_construction_main ($) { Line 4399  sub _tree_construction_main ($) {
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 {
# Line 4385  sub _tree_construction_main ($) { Line 4428  sub _tree_construction_main ($) {
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 {
# Line 4406  sub _tree_construction_main ($) { Line 4450  sub _tree_construction_main ($) {
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;
# Line 4420  sub _tree_construction_main ($) { Line 4465  sub _tree_construction_main ($) {
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 {
# Line 4444  sub _tree_construction_main ($) { Line 4491  sub _tree_construction_main ($) {
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>
# Line 4483  sub _tree_construction_main ($) { Line 4531  sub _tree_construction_main ($) {
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>
# Line 4526  sub _tree_construction_main ($) { Line 4575  sub _tree_construction_main ($) {
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}};
# Line 4541  sub _tree_construction_main ($) { Line 4591  sub _tree_construction_main ($) {
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;
# Line 4558  sub _tree_construction_main ($) { Line 4609  sub _tree_construction_main ($) {
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;
# Line 4573  sub _tree_construction_main ($) { Line 4625  sub _tree_construction_main ($) {
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;
# Line 4588  sub _tree_construction_main ($) { Line 4642  sub _tree_construction_main ($) {
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;
# Line 4611  sub _tree_construction_main ($) { Line 4666  sub _tree_construction_main ($) {
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;
# Line 4630  sub _tree_construction_main ($) { Line 4686  sub _tree_construction_main ($) {
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;
# Line 4646  sub _tree_construction_main ($) { Line 4704  sub _tree_construction_main ($) {
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>
# Line 4662  sub _tree_construction_main ($) { Line 4721  sub _tree_construction_main ($) {
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;
# Line 4773  sub _tree_construction_main ($) { Line 4833  sub _tree_construction_main ($) {
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
# Line 4799  sub _tree_construction_main ($) { Line 4860  sub _tree_construction_main ($) {
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;
# Line 4816  sub _tree_construction_main ($) { Line 4877  sub _tree_construction_main ($) {
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 {
# Line 4858  sub _tree_construction_main ($) { Line 4919  sub _tree_construction_main ($) {
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;
# Line 4875  sub _tree_construction_main ($) { Line 4938  sub _tree_construction_main ($) {
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 {
# Line 4892  sub _tree_construction_main ($) { Line 4955  sub _tree_construction_main ($) {
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;
# Line 4919  sub _tree_construction_main ($) { Line 4983  sub _tree_construction_main ($) {
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;
# Line 4935  sub _tree_construction_main ($) { Line 4999  sub _tree_construction_main ($) {
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 {
# Line 4952  sub _tree_construction_main ($) { Line 5016  sub _tree_construction_main ($) {
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;
# Line 4995  sub _tree_construction_main ($) { Line 5060  sub _tree_construction_main ($) {
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
# Line 5020  sub _tree_construction_main ($) { Line 5086  sub _tree_construction_main ($) {
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;
# Line 5035  sub _tree_construction_main ($) { Line 5102  sub _tree_construction_main ($) {
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 {
# Line 5055  sub _tree_construction_main ($) { Line 5122  sub _tree_construction_main ($) {
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;
# Line 5069  sub _tree_construction_main ($) { Line 5137  sub _tree_construction_main ($) {
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;
# Line 5109  sub _tree_construction_main ($) { Line 5178  sub _tree_construction_main ($) {
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
# Line 5160  sub _tree_construction_main ($) { Line 5229  sub _tree_construction_main ($) {
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') {
# Line 5245  sub _tree_construction_main ($) { Line 5314  sub _tree_construction_main ($) {
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;
# Line 5289  sub _tree_construction_main ($) { Line 5359  sub _tree_construction_main ($) {
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;
# Line 5365  sub _tree_construction_main ($) { Line 5436  sub _tree_construction_main ($) {
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    
# Line 5386  sub _tree_construction_main ($) { Line 5457  sub _tree_construction_main ($) {
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;
# Line 5404  sub _tree_construction_main ($) { Line 5476  sub _tree_construction_main ($) {
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 {
# Line 5445  sub _tree_construction_main ($) { Line 5517  sub _tree_construction_main ($) {
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    
# Line 5473  sub _tree_construction_main ($) { Line 5546  sub _tree_construction_main ($) {
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          #          #
# Line 5495  sub _tree_construction_main ($) { Line 5569  sub _tree_construction_main ($) {
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;
# Line 5536  sub _tree_construction_main ($) { Line 5611  sub _tree_construction_main ($) {
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;
# Line 5572  sub _tree_construction_main ($) { Line 5648  sub _tree_construction_main ($) {
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;
# Line 5618  sub _tree_construction_main ($) { Line 5695  sub _tree_construction_main ($) {
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;
# Line 5652  sub _tree_construction_main ($) { Line 5730  sub _tree_construction_main ($) {
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;
# Line 5675  sub _tree_construction_main ($) { Line 5754  sub _tree_construction_main ($) {
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;
# Line 5710  sub _tree_construction_main ($) { Line 5790  sub _tree_construction_main ($) {
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;
# Line 5737  sub _tree_construction_main ($) { Line 5818  sub _tree_construction_main ($) {
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            #            #
# Line 5794  sub _tree_construction_main ($) { Line 5877  sub _tree_construction_main ($) {
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;
# Line 5807  sub _tree_construction_main ($) { Line 5891  sub _tree_construction_main ($) {
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;
# Line 5837  sub _tree_construction_main ($) { Line 5922  sub _tree_construction_main ($) {
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;
# Line 5901  sub _tree_construction_main ($) { Line 5987  sub _tree_construction_main ($) {
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
# Line 5919  sub _tree_construction_main ($) { Line 6006  sub _tree_construction_main ($) {
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;
# Line 5943  sub _tree_construction_main ($) { Line 6031  sub _tree_construction_main ($) {
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;
# Line 5961  sub _tree_construction_main ($) { Line 6050  sub _tree_construction_main ($) {
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');
# Line 5973  sub _tree_construction_main ($) { Line 6063  sub _tree_construction_main ($) {
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');
# Line 5995  sub _tree_construction_main ($) { Line 6086  sub _tree_construction_main ($) {
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;
# Line 6016  sub _tree_construction_main ($) { Line 6108  sub _tree_construction_main ($) {
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;
# Line 6057  sub _tree_construction_main ($) { Line 6150  sub _tree_construction_main ($) {
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?
# Line 6074  sub _tree_construction_main ($) { Line 6168  sub _tree_construction_main ($) {
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;
# Line 6112  sub _tree_construction_main ($) { Line 6207  sub _tree_construction_main ($) {
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 {
# Line 6120  sub _tree_construction_main ($) { Line 6215  sub _tree_construction_main ($) {
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
# Line 6128  sub _tree_construction_main ($) { Line 6223  sub _tree_construction_main ($) {
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 {
# Line 6136  sub _tree_construction_main ($) { Line 6232  sub _tree_construction_main ($) {
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;
# Line 6145  sub _tree_construction_main ($) { Line 6242  sub _tree_construction_main ($) {
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.
# Line 6157  sub _tree_construction_main ($) { Line 6255  sub _tree_construction_main ($) {
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;
# Line 6169  sub _tree_construction_main ($) { Line 6268  sub _tree_construction_main ($) {
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
# Line 6197  sub _tree_construction_main ($) { Line 6297  sub _tree_construction_main ($) {
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 html frameset"
6305              !!!cp ('t313');              !!!cp ('t313');
6306              !!!parse-error (type => 'after html:#character', token => $token);              !!!parse-error (type => 'after html:#text', token => $token);
6307    
6308              $self->{insertion_mode} = AFTER_FRAMESET_IM;              $self->{insertion_mode} = AFTER_FRAMESET_IM;
6309              ## Reprocess in the "after frameset" insertion mode.              ## Reprocess in the "after frameset" insertion mode.
6310              !!!parse-error (type => 'after frameset:#character', token => $token);              !!!parse-error (type => 'after frameset:#text', token => $token);
6311            }            }
6312                        
6313            ## Ignore the token.            ## Ignore the token.
# Line 6225  sub _tree_construction_main ($) { Line 6325  sub _tree_construction_main ($) {
6325        } elsif ($token->{type} == START_TAG_TOKEN) {        } elsif ($token->{type} == START_TAG_TOKEN) {
6326          if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {          if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {
6327            !!!cp ('t316');            !!!cp ('t316');
6328            !!!parse-error (type => 'after html:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'after html',
6329                              text => $token->{tag_name}, token => $token);
6330    
6331            $self->{insertion_mode} = AFTER_FRAMESET_IM;            $self->{insertion_mode} = AFTER_FRAMESET_IM;
6332            ## Process in the "after frameset" insertion mode.            ## Process in the "after frameset" insertion mode.
# Line 6256  sub _tree_construction_main ($) { Line 6357  sub _tree_construction_main ($) {
6357          } else {          } else {
6358            if ($self->{insertion_mode} == IN_FRAMESET_IM) {            if ($self->{insertion_mode} == IN_FRAMESET_IM) {
6359              !!!cp ('t321');              !!!cp ('t321');
6360              !!!parse-error (type => 'in frameset:'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'in frameset',
6361                                text => $token->{tag_name}, token => $token);
6362            } else {            } else {
6363              !!!cp ('t322');              !!!cp ('t322');
6364              !!!parse-error (type => 'after frameset:'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'after frameset',
6365                                text => $token->{tag_name}, token => $token);
6366            }            }
6367            ## Ignore the token            ## Ignore the token
6368            !!!nack ('t322.1');            !!!nack ('t322.1');
# Line 6269  sub _tree_construction_main ($) { Line 6372  sub _tree_construction_main ($) {
6372        } elsif ($token->{type} == END_TAG_TOKEN) {        } elsif ($token->{type} == END_TAG_TOKEN) {
6373          if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {          if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {
6374            !!!cp ('t323');            !!!cp ('t323');
6375            !!!parse-error (type => 'after html:/'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'after html:/',
6376                              text => $token->{tag_name}, token => $token);
6377    
6378            $self->{insertion_mode} = AFTER_FRAMESET_IM;            $self->{insertion_mode} = AFTER_FRAMESET_IM;
6379            ## Process in the "after frameset" insertion mode.            ## Process in the "after frameset" insertion mode.
# Line 6282  sub _tree_construction_main ($) { Line 6386  sub _tree_construction_main ($) {
6386            if ($self->{open_elements}->[-1]->[1] & HTML_EL and            if ($self->{open_elements}->[-1]->[1] & HTML_EL and
6387                @{$self->{open_elements}} == 1) {                @{$self->{open_elements}} == 1) {
6388              !!!cp ('t325');              !!!cp ('t325');
6389              !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'unmatched end tag',
6390                                text => $token->{tag_name}, token => $token);
6391              ## Ignore the token              ## Ignore the token
6392              !!!next-token;              !!!next-token;
6393            } else {            } else {
# Line 6308  sub _tree_construction_main ($) { Line 6413  sub _tree_construction_main ($) {
6413          } else {          } else {
6414            if ($self->{insertion_mode} == IN_FRAMESET_IM) {            if ($self->{insertion_mode} == IN_FRAMESET_IM) {
6415              !!!cp ('t330');              !!!cp ('t330');
6416              !!!parse-error (type => 'in frameset:/'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'in frameset:/',
6417                                text => $token->{tag_name}, token => $token);
6418            } else {            } else {
6419              !!!cp ('t331');              !!!cp ('t331');
6420              !!!parse-error (type => 'after frameset:/'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'after frameset:/',
6421                                text => $token->{tag_name}, token => $token);
6422            }            }
6423            ## Ignore the token            ## Ignore the token
6424            !!!next-token;            !!!next-token;
# Line 6419  sub _tree_construction_main ($) { Line 6526  sub _tree_construction_main ($) {
6526          $parse_rcdata->(RCDATA_CONTENT_MODEL);          $parse_rcdata->(RCDATA_CONTENT_MODEL);
6527          next B;          next B;
6528        } elsif ($token->{tag_name} eq 'body') {        } elsif ($token->{tag_name} eq 'body') {
6529          !!!parse-error (type => 'in body:body', token => $token);          !!!parse-error (type => 'in body', text => 'body', token => $token);
6530                                
6531          if (@{$self->{open_elements}} == 1 or          if (@{$self->{open_elements}} == 1 or
6532              not ($self->{open_elements}->[1]->[1] & BODY_EL)) {              not ($self->{open_elements}->[1]->[1] & BODY_EL)) {
# Line 6539  sub _tree_construction_main ($) { Line 6646  sub _tree_construction_main ($) {
6646              if ($i != -1) {              if ($i != -1) {
6647                !!!cp ('t355');                !!!cp ('t355');
6648                !!!parse-error (type => 'not closed',                !!!parse-error (type => 'not closed',
6649                                value => $self->{open_elements}->[-1]->[0]                                text => $self->{open_elements}->[-1]->[0]
6650                                    ->manakai_local_name,                                    ->manakai_local_name,
6651                                token => $token);                                token => $token);
6652              } else {              } else {
# Line 6807  sub _tree_construction_main ($) { Line 6914  sub _tree_construction_main ($) {
6914            ## Ignore the token            ## Ignore the token
6915          } else {          } else {
6916            !!!cp ('t398');            !!!cp ('t398');
6917            !!!parse-error (type => 'in RCDATA:#'.$token->{type}, token => $token);            !!!parse-error (type => 'in RCDATA:#eof', token => $token);
6918          }          }
6919          !!!next-token;          !!!next-token;
6920          next B;          next B;
# Line 6826  sub _tree_construction_main ($) { Line 6933  sub _tree_construction_main ($) {
6933              unless ($self->{open_elements}->[-1]->[1] & RUBY_EL) {              unless ($self->{open_elements}->[-1]->[1] & RUBY_EL) {
6934                !!!cp ('t398.3');                !!!cp ('t398.3');
6935                !!!parse-error (type => 'not closed',                !!!parse-error (type => 'not closed',
6936                                value => $self->{open_elements}->[-1]->[0]                                text => $self->{open_elements}->[-1]->[0]
6937                                    ->manakai_local_name,                                    ->manakai_local_name,
6938                                token => $token);                                token => $token);
6939                pop @{$self->{open_elements}}                pop @{$self->{open_elements}}
# Line 6848  sub _tree_construction_main ($) { Line 6955  sub _tree_construction_main ($) {
6955                 $token->{tag_name} eq 'svg') {                 $token->{tag_name} eq 'svg') {
6956          $reconstruct_active_formatting_elements->($insert_to_current);          $reconstruct_active_formatting_elements->($insert_to_current);
6957    
6958            ## "Adjust MathML attributes" ('math' only) - done in insert-element-f
6959    
6960          ## "adjust SVG attributes" ('svg' only) - done in insert-element-f          ## "adjust SVG attributes" ('svg' only) - done in insert-element-f
6961    
6962          ## "adjust foreign attributes" - done in insert-element-f          ## "adjust foreign attributes" - done in insert-element-f
# Line 6874  sub _tree_construction_main ($) { Line 6983  sub _tree_construction_main ($) {
6983                  thead => 1, tr => 1,                  thead => 1, tr => 1,
6984                 }->{$token->{tag_name}}) {                 }->{$token->{tag_name}}) {
6985          !!!cp ('t401');          !!!cp ('t401');
6986          !!!parse-error (type => 'in body:'.$token->{tag_name}, token => $token);          !!!parse-error (type => 'in body',
6987                            text => $token->{tag_name}, token => $token);
6988          ## Ignore the token          ## Ignore the token
6989          !!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error.          !!!nack ('t401.1'); ## NOTE: |<col/>| or |<frame/>| here is an error.
6990          !!!next-token;          !!!next-token;
# Line 6959  sub _tree_construction_main ($) { Line 7069  sub _tree_construction_main ($) {
7069            }            }
7070    
7071            !!!parse-error (type => 'start tag not allowed',            !!!parse-error (type => 'start tag not allowed',
7072                            value => $token->{tag_name}, token => $token);                            text => $token->{tag_name}, token => $token);
7073            ## NOTE: Ignore the token.            ## NOTE: Ignore the token.
7074            !!!next-token;            !!!next-token;
7075            next B;            next B;
# Line 6969  sub _tree_construction_main ($) { Line 7079  sub _tree_construction_main ($) {
7079            unless ($_->[1] & ALL_END_TAG_OPTIONAL_EL) {            unless ($_->[1] & ALL_END_TAG_OPTIONAL_EL) {
7080              !!!cp ('t403');              !!!cp ('t403');
7081              !!!parse-error (type => 'not closed',              !!!parse-error (type => 'not closed',
7082                              value => $_->[0]->manakai_local_name,                              text => $_->[0]->manakai_local_name,
7083                              token => $token);                              token => $token);
7084              last;              last;
7085            } else {            } else {
# Line 6989  sub _tree_construction_main ($) { Line 7099  sub _tree_construction_main ($) {
7099            unless ($self->{open_elements}->[-1]->[1] & BODY_EL) {            unless ($self->{open_elements}->[-1]->[1] & BODY_EL) {
7100              !!!cp ('t406');              !!!cp ('t406');
7101              !!!parse-error (type => 'not closed',              !!!parse-error (type => 'not closed',
7102                              value => $self->{open_elements}->[1]->[0]                              text => $self->{open_elements}->[1]->[0]
7103                                  ->manakai_local_name,                                  ->manakai_local_name,
7104                              token => $token);                              token => $token);
7105            } else {            } else {
# Line 7000  sub _tree_construction_main ($) { Line 7110  sub _tree_construction_main ($) {
7110            next B;            next B;
7111          } else {          } else {
7112            !!!cp ('t408');            !!!cp ('t408');
7113            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'unmatched end tag',
7114                              text => $token->{tag_name}, token => $token);
7115            ## Ignore the token            ## Ignore the token
7116            !!!next-token;            !!!next-token;
7117            next B;            next B;
# Line 7028  sub _tree_construction_main ($) { Line 7139  sub _tree_construction_main ($) {
7139    
7140          unless (defined $i) { # has an element in scope          unless (defined $i) { # has an element in scope
7141            !!!cp ('t413');            !!!cp ('t413');
7142            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'unmatched end tag',
7143                              text => $token->{tag_name}, token => $token);
7144          } else {          } else {
7145            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7146            while ({            while ({
# Line 7049  sub _tree_construction_main ($) { Line 7161  sub _tree_construction_main ($) {
7161                    ne $token->{tag_name}) {                    ne $token->{tag_name}) {
7162              !!!cp ('t412');              !!!cp ('t412');
7163              !!!parse-error (type => 'not closed',              !!!parse-error (type => 'not closed',
7164                              value => $self->{open_elements}->[-1]->[0]                              text => $self->{open_elements}->[-1]->[0]
7165                                  ->manakai_local_name,                                  ->manakai_local_name,
7166                              token => $token);                              token => $token);
7167            } else {            } else {
# Line 7086  sub _tree_construction_main ($) { Line 7198  sub _tree_construction_main ($) {
7198    
7199          unless (defined $i) { # has an element in scope          unless (defined $i) { # has an element in scope
7200            !!!cp ('t421');            !!!cp ('t421');
7201            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'unmatched end tag',
7202                              text => $token->{tag_name}, token => $token);
7203          } else {          } else {
7204            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7205            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {
# Line 7099  sub _tree_construction_main ($) { Line 7212  sub _tree_construction_main ($) {
7212                    ne $token->{tag_name}) {                    ne $token->{tag_name}) {
7213              !!!cp ('t417.1');              !!!cp ('t417.1');
7214              !!!parse-error (type => 'not closed',              !!!parse-error (type => 'not closed',
7215                              value => $self->{open_elements}->[-1]->[0]                              text => $self->{open_elements}->[-1]->[0]
7216                                  ->manakai_local_name,                                  ->manakai_local_name,
7217                              token => $token);                              token => $token);
7218            } else {            } else {
# Line 7131  sub _tree_construction_main ($) { Line 7244  sub _tree_construction_main ($) {
7244    
7245          unless (defined $i) { # has an element in scope          unless (defined $i) { # has an element in scope
7246            !!!cp ('t425.1');            !!!cp ('t425.1');
7247            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'unmatched end tag',
7248                              text => $token->{tag_name}, token => $token);
7249          } else {          } else {
7250            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7251            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {
# Line 7143  sub _tree_construction_main ($) { Line 7257  sub _tree_construction_main ($) {
7257            if ($self->{open_elements}->[-1]->[0]->manakai_local_name            if ($self->{open_elements}->[-1]->[0]->manakai_local_name
7258                    ne $token->{tag_name}) {                    ne $token->{tag_name}) {
7259              !!!cp ('t425');              !!!cp ('t425');
7260              !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);              !!!parse-error (type => 'unmatched end tag',
7261                                text => $token->{tag_name}, token => $token);
7262            } else {            } else {
7263              !!!cp ('t426');              !!!cp ('t426');
7264            }            }
# Line 7174  sub _tree_construction_main ($) { Line 7289  sub _tree_construction_main ($) {
7289                    ne $token->{tag_name}) {                    ne $token->{tag_name}) {
7290              !!!cp ('t412.1');              !!!cp ('t412.1');
7291              !!!parse-error (type => 'not closed',              !!!parse-error (type => 'not closed',
7292                              value => $self->{open_elements}->[-1]->[0]                              text => $self->{open_elements}->[-1]->[0]
7293                                  ->manakai_local_name,                                  ->manakai_local_name,
7294                              token => $token);                              token => $token);
7295            } else {            } else {
# Line 7184  sub _tree_construction_main ($) { Line 7299  sub _tree_construction_main ($) {
7299            splice @{$self->{open_elements}}, $i;            splice @{$self->{open_elements}}, $i;
7300          } else {          } else {
7301            !!!cp ('t413.1');            !!!cp ('t413.1');
7302            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);            !!!parse-error (type => 'unmatched end tag',
7303                              text => $token->{tag_name}, token => $token);
7304    
7305            !!!cp ('t415.1');            !!!cp ('t415.1');
7306            ## As if <p>, then reprocess the current token            ## As if <p>, then reprocess the current token
# Line 7207  sub _tree_construction_main ($) { Line 7323  sub _tree_construction_main ($) {
7323          next B;          next B;
7324        } elsif ($token->{tag_name} eq 'br') {        } elsif ($token->{tag_name} eq 'br') {
7325          !!!cp ('t428');          !!!cp ('t428');
7326          !!!parse-error (type => 'unmatched end tag:br', token => $token);          !!!parse-error (type => 'unmatched end tag',
7327                            text => 'br', token => $token);
7328    
7329          ## As if <br>          ## As if <br>
7330          $reconstruct_active_formatting_elements->($insert_to_current);          $reconstruct_active_formatting_elements->($insert_to_current);
# Line 7232  sub _tree_construction_main ($) { Line 7349  sub _tree_construction_main ($) {
7349                  noscript => 0, ## TODO: if scripting is enabled                  noscript => 0, ## TODO: if scripting is enabled
7350                 }->{$token->{tag_name}}) {                 }->{$token->{tag_name}}) {
7351          !!!cp ('t429');          !!!cp ('t429');
7352          !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);          !!!parse-error (type => 'unmatched end tag',
7353                            text => $token->{tag_name}, token => $token);
7354          ## Ignore the token          ## Ignore the token
7355          !!!next-token;          !!!next-token;
7356          next B;          next B;
# Line 7264  sub _tree_construction_main ($) { Line 7382  sub _tree_construction_main ($) {
7382                !!!cp ('t431');                !!!cp ('t431');
7383                ## NOTE: <x><y></x>                ## NOTE: <x><y></x>
7384                !!!parse-error (type => 'not closed',                !!!parse-error (type => 'not closed',
7385                                value => $self->{open_elements}->[-1]->[0]                                text => $self->{open_elements}->[-1]->[0]
7386                                    ->manakai_local_name,                                    ->manakai_local_name,
7387                                token => $token);                                token => $token);
7388              } else {              } else {
# Line 7283  sub _tree_construction_main ($) { Line 7401  sub _tree_construction_main ($) {
7401                  ($node->[1] & SPECIAL_EL or                  ($node->[1] & SPECIAL_EL or
7402                   $node->[1] & SCOPING_EL)) {                   $node->[1] & SCOPING_EL)) {
7403                !!!cp ('t433');                !!!cp ('t433');
7404                !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}, token => $token);                !!!parse-error (type => 'unmatched end tag',
7405                                  text => $token->{tag_name}, token => $token);
7406                ## Ignore the token                ## Ignore the token
7407                !!!next-token;                !!!next-token;
7408                last S2;                last S2;
# Line 7419  sub set_inner_html ($$$) { Line 7538  sub set_inner_html ($$$) {
7538                  0x10FFFE => 1, 0x10FFFF => 1,                  0x10FFFE => 1, 0x10FFFF => 1,
7539                 }->{$self->{next_char}}) {                 }->{$self->{next_char}}) {
7540          !!!cp ('i4.1');          !!!cp ('i4.1');
7541          !!!parse-error (type => 'control char', level => $self->{must_level});          if ($self->{next_char} < 0x10000) {
7542  ## TODO: error type documentation            !!!parse-error (type => 'control char',
7543                              text => (sprintf 'U+%04X', $self->{next_char}));
7544            } else {
7545              !!!parse-error (type => 'control char',
7546                              text => (sprintf 'U-%08X', $self->{next_char}));
7547            }
7548        }        }
7549      };      };
7550      $p->{prev_char} = [-1, -1, -1];      $p->{prev_char} = [-1, -1, -1];

Legend:
Removed from v.1.152  
changed lines
  Added in v.1.156

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24