/[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.104 by wakaba, Sun Mar 9 08:47:33 2008 UTC revision 1.107 by wakaba, Sun Mar 9 10:49:13 2008 UTC
# Line 4535  sub _tree_construction_main ($) { Line 4535  sub _tree_construction_main ($) {
4535                  redo B;                  redo B;
4536                }                }
4537                                
4538    ## TODO: Followings are removed from the latest spec.
4539                ## generate implied end tags                ## generate implied end tags
4540                while ({                while ({
4541                        dd => 1, dt => 1, li => 1, p => 1,                        dd => 1, dt => 1, li => 1, p => 1,
# Line 4901  sub _tree_construction_main ($) { Line 4902  sub _tree_construction_main ($) {
4902        } elsif ($token->{type} == END_OF_FILE_TOKEN) {        } elsif ($token->{type} == END_OF_FILE_TOKEN) {
4903          unless ($self->{open_elements}->[-1]->[1] eq 'html' and          unless ($self->{open_elements}->[-1]->[1] eq 'html' and
4904                  @{$self->{open_elements}} == 1) { # redundant, maybe                  @{$self->{open_elements}} == 1) { # redundant, maybe
           !!!cp ('t259.1');  
4905            !!!parse-error (type => 'in body:#eof');            !!!parse-error (type => 'in body:#eof');
4906              !!!cp ('t259.1');
4907              #
4908          } else {          } else {
4909            !!!cp ('t259.2');            !!!cp ('t259.2');
4910              #
4911          }          }
4912    
4913          ## Stop parsing          ## Stop parsing
# Line 6115  sub _tree_construction_main ($) { Line 6118  sub _tree_construction_main ($) {
6118        }        }
6119      } elsif ($token->{type} == END_TAG_TOKEN) {      } elsif ($token->{type} == END_TAG_TOKEN) {
6120        if ($token->{tag_name} eq 'body') {        if ($token->{tag_name} eq 'body') {
6121          if (@{$self->{open_elements}} > 1 and          ## has a |body| element in scope
6122              $self->{open_elements}->[1]->[1] eq 'body') {          my $i;
6123            for (@{$self->{open_elements}}) {          INSCOPE: for (reverse @{$self->{open_elements}}) {
6124              unless ({            if ($_->[1] eq 'body') {
6125                         dd => 1, dt => 1, li => 1, p => 1, td => 1,              !!!cp ('t405');
6126                         th => 1, tr => 1, body => 1, html => 1,              $i = $_;
6127                       tbody => 1, tfoot => 1, thead => 1,              last INSCOPE;
6128                      }->{$_->[1]}) {            } elsif ({
6129                !!!cp ('t403');                      applet => 1, table => 1, caption => 1, td => 1, th => 1,
6130                !!!parse-error (type => 'not closed:'.$_->[1]);                      button => 1, marquee => 1, object => 1, html => 1,
6131              } else {                     }->{$_->[1]}) {
6132                !!!cp ('t404');              !!!cp ('t405.1');
6133              }              last INSCOPE;
6134            }            }
6135            } # INSCOPE
6136            $self->{insertion_mode} = AFTER_BODY_IM;          unless (defined $i) {
           !!!next-token;  
           redo B;  
         } else {  
           !!!cp ('t405');  
6137            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name});            !!!parse-error (type => 'unmatched end tag:'.$token->{tag_name});
6138            ## Ignore the token            ## NOTE: Ignore the token.
6139            !!!next-token;            !!!next-token;
6140            redo B;            redo B;
6141          }          }
6142    
6143            for (@{$self->{open_elements}}) {
6144              unless ({
6145                       dd => 1, dt => 1, li => 1, p => 1, td => 1,
6146                       th => 1, tr => 1, body => 1, html => 1,
6147                       tbody => 1, tfoot => 1, thead => 1,
6148                      }->{$_->[1]}) {
6149                !!!cp ('t403');
6150                !!!parse-error (type => 'not closed:'.$_->[1]);
6151                last;
6152              } else {
6153                !!!cp ('t404');
6154              }
6155            }
6156    
6157            $self->{insertion_mode} = AFTER_BODY_IM;
6158            !!!next-token;
6159            redo B;
6160        } elsif ($token->{tag_name} eq 'html') {        } elsif ($token->{tag_name} eq 'html') {
6161          if (@{$self->{open_elements}} > 1 and $self->{open_elements}->[1]->[1] eq 'body') {          if (@{$self->{open_elements}} > 1 and $self->{open_elements}->[1]->[1] eq 'body') {
6162            ## ISSUE: There is an issue in the spec.            ## ISSUE: There is an issue in the spec.

Legend:
Removed from v.1.104  
changed lines
  Added in v.1.107

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24