/[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.155 by wakaba, Sat Aug 30 12:57:05 2008 UTC revision 1.158 by wakaba, Sun Aug 31 12:11:42 2008 UTC
# Line 1540  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 1575  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 6294  sub _tree_construction_main ($) { Line 6301  sub _tree_construction_main ($) {
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:#text', token => $token);              !!!parse-error (type => 'after frameset:#text', token => $token);
6304            } else { # "after html frameset"            } else { # "after after frameset"
6305              !!!cp ('t313');              !!!cp ('t313');
6306              !!!parse-error (type => 'after html:#text', token => $token);              !!!parse-error (type => 'after html:#text', token => $token);
   
             $self->{insertion_mode} = AFTER_FRAMESET_IM;  
             ## Reprocess in the "after frameset" insertion mode.  
             !!!parse-error (type => 'after frameset:#text', token => $token);  
6307            }            }
6308                        
6309            ## Ignore the token.            ## Ignore the token.
# Line 6316  sub _tree_construction_main ($) { Line 6319  sub _tree_construction_main ($) {
6319                    
6320          die qq[$0: Character "$token->{data}"];          die qq[$0: Character "$token->{data}"];
6321        } elsif ($token->{type} == START_TAG_TOKEN) {        } elsif ($token->{type} == START_TAG_TOKEN) {
         if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {  
           !!!cp ('t316');  
           !!!parse-error (type => 'after html',  
                           text => $token->{tag_name}, token => $token);  
   
           $self->{insertion_mode} = AFTER_FRAMESET_IM;  
           ## Process in the "after frameset" insertion mode.  
         } else {  
           !!!cp ('t317');  
         }  
   
6322          if ($token->{tag_name} eq 'frameset' and          if ($token->{tag_name} eq 'frameset' and
6323              $self->{insertion_mode} == IN_FRAMESET_IM) {              $self->{insertion_mode} == IN_FRAMESET_IM) {
6324            !!!cp ('t318');            !!!cp ('t318');
# Line 6347  sub _tree_construction_main ($) { Line 6339  sub _tree_construction_main ($) {
6339            ## NOTE: As if in head.            ## NOTE: As if in head.
6340            $parse_rcdata->(CDATA_CONTENT_MODEL);            $parse_rcdata->(CDATA_CONTENT_MODEL);
6341            next B;            next B;
6342    
6343              ## NOTE: |<!DOCTYPE HTML><frameset></frameset></html><noframes></noframes>|
6344              ## has no parse error.
6345          } else {          } else {
6346            if ($self->{insertion_mode} == IN_FRAMESET_IM) {            if ($self->{insertion_mode} == IN_FRAMESET_IM) {
6347              !!!cp ('t321');              !!!cp ('t321');
6348              !!!parse-error (type => 'in frameset',              !!!parse-error (type => 'in frameset',
6349                              text => $token->{tag_name}, token => $token);                              text => $token->{tag_name}, token => $token);
6350            } else {            } elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) {
6351              !!!cp ('t322');              !!!cp ('t322');
6352              !!!parse-error (type => 'after frameset',              !!!parse-error (type => 'after frameset',
6353                              text => $token->{tag_name}, token => $token);                              text => $token->{tag_name}, token => $token);
6354              } else { # "after after frameset"
6355                !!!cp ('t322.2');
6356                !!!parse-error (type => 'after after frameset',
6357                                text => $token->{tag_name}, token => $token);
6358            }            }
6359            ## Ignore the token            ## Ignore the token
6360            !!!nack ('t322.1');            !!!nack ('t322.1');
# Line 6363  sub _tree_construction_main ($) { Line 6362  sub _tree_construction_main ($) {
6362            next B;            next B;
6363          }          }
6364        } elsif ($token->{type} == END_TAG_TOKEN) {        } elsif ($token->{type} == END_TAG_TOKEN) {
         if ($self->{insertion_mode} == AFTER_HTML_FRAMESET_IM) {  
           !!!cp ('t323');  
           !!!parse-error (type => 'after html:/',  
                           text => $token->{tag_name}, token => $token);  
   
           $self->{insertion_mode} = AFTER_FRAMESET_IM;  
           ## Process in the "after frameset" insertion mode.  
         } else {  
           !!!cp ('t324');  
         }  
   
6365          if ($token->{tag_name} eq 'frameset' and          if ($token->{tag_name} eq 'frameset' and
6366              $self->{insertion_mode} == IN_FRAMESET_IM) {              $self->{insertion_mode} == IN_FRAMESET_IM) {
6367            if ($self->{open_elements}->[-1]->[1] & HTML_EL and            if ($self->{open_elements}->[-1]->[1] & HTML_EL and
# Line 6408  sub _tree_construction_main ($) { Line 6396  sub _tree_construction_main ($) {
6396              !!!cp ('t330');              !!!cp ('t330');
6397              !!!parse-error (type => 'in frameset:/',              !!!parse-error (type => 'in frameset:/',
6398                              text => $token->{tag_name}, token => $token);                              text => $token->{tag_name}, token => $token);
6399            } else {            } elsif ($self->{insertion_mode} == AFTER_FRAMESET_IM) {
6400              !!!cp ('t331');              !!!cp ('t330.1');
6401              !!!parse-error (type => 'after frameset:/',              !!!parse-error (type => 'after frameset:/',
6402                              text => $token->{tag_name}, token => $token);                              text => $token->{tag_name}, token => $token);
6403              } else { # "after after html"
6404                !!!cp ('t331');
6405                !!!parse-error (type => 'after after frameset:/',
6406                                text => $token->{tag_name}, token => $token);
6407            }            }
6408            ## Ignore the token            ## Ignore the token
6409            !!!next-token;            !!!next-token;
# Line 7134  sub _tree_construction_main ($) { Line 7126  sub _tree_construction_main ($) {
7126            !!!cp ('t413');            !!!cp ('t413');
7127            !!!parse-error (type => 'unmatched end tag',            !!!parse-error (type => 'unmatched end tag',
7128                            text => $token->{tag_name}, token => $token);                            text => $token->{tag_name}, token => $token);
7129              ## NOTE: Ignore the token.
7130          } else {          } else {
7131            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7132            while ({            while ({
# Line 7193  sub _tree_construction_main ($) { Line 7186  sub _tree_construction_main ($) {
7186            !!!cp ('t421');            !!!cp ('t421');
7187            !!!parse-error (type => 'unmatched end tag',            !!!parse-error (type => 'unmatched end tag',
7188                            text => $token->{tag_name}, token => $token);                            text => $token->{tag_name}, token => $token);
7189              ## NOTE: Ignore the token.
7190          } else {          } else {
7191            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7192            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {
# Line 7239  sub _tree_construction_main ($) { Line 7233  sub _tree_construction_main ($) {
7233            !!!cp ('t425.1');            !!!cp ('t425.1');
7234            !!!parse-error (type => 'unmatched end tag',            !!!parse-error (type => 'unmatched end tag',
7235                            text => $token->{tag_name}, token => $token);                            text => $token->{tag_name}, token => $token);
7236              ## NOTE: Ignore the token.
7237          } else {          } else {
7238            ## Step 1. generate implied end tags            ## Step 1. generate implied end tags
7239            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {            while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) {

Legend:
Removed from v.1.155  
changed lines
  Added in v.1.158

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24