/[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.223 by wakaba, Sun Aug 16 04:59:53 2009 UTC revision 1.224 by wakaba, Sun Aug 16 05:15:09 2009 UTC
# Line 2500  sub _tree_construction_main ($) { Line 2500  sub _tree_construction_main ($) {
2500                ## Ignore the token                ## Ignore the token
2501                !!!next-token;                !!!next-token;
2502                next B;                next B;
2503              } elsif ($token->{tag_name} eq 'br') {          } elsif ($token->{tag_name} eq 'br') {
2504                if ($self->{insertion_mode} == BEFORE_HEAD_IM) {            if ($self->{insertion_mode} == BEFORE_HEAD_IM) {
2505                  !!!cp ('t142.2');              !!!cp ('t142.2');
2506                  ## (before head) as if <head>, (in head) as if </head>              ## (before head) as if <head>, (in head) as if </head>
2507                  !!!create-element ($self->{head_element}, $HTML_NS, 'head',, $token);              !!!create-element ($self->{head_element}, $HTML_NS, 'head',, $token);
2508                  $self->{open_elements}->[-1]->[0]->append_child ($self->{head_element});              $self->{open_elements}->[-1]->[0]->append_child ($self->{head_element});
2509                  $self->{insertion_mode} = AFTER_HEAD_IM;              $self->{insertion_mode} = AFTER_HEAD_IM;
2510        
2511                  ## Reprocess in the "after head" insertion mode...              ## Reprocess in the "after head" insertion mode...
2512                } elsif ($self->{insertion_mode} == IN_HEAD_IM) {            } elsif ($self->{insertion_mode} == IN_HEAD_IM) {
2513                  !!!cp ('t143.2');              !!!cp ('t143.2');
2514                  ## As if </head>              ## As if </head>
2515                  pop @{$self->{open_elements}};              pop @{$self->{open_elements}};
2516                  $self->{insertion_mode} = AFTER_HEAD_IM;              $self->{insertion_mode} = AFTER_HEAD_IM;
2517        
2518                  ## Reprocess in the "after head" insertion mode...              ## Reprocess in the "after head" insertion mode...
2519                } elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) {            } elsif ($self->{insertion_mode} == IN_HEAD_NOSCRIPT_IM) {
2520                  !!!cp ('t143.3');              !!!cp ('t143.3');
2521                  ## NOTE: Two parse errors for <head><noscript></br>              ## NOTE: Two parse errors for <head><noscript></br>
2522                  !!!parse-error (type => 'unmatched end tag',              !!!parse-error (type => 'unmatched end tag',
2523                                  text => 'br', token => $token);                              text => 'br', token => $token);
2524                  ## As if </noscript>              ## As if </noscript>
2525                  pop @{$self->{open_elements}};              pop @{$self->{open_elements}};
2526                  $self->{insertion_mode} = IN_HEAD_IM;              $self->{insertion_mode} = IN_HEAD_IM;
2527    
2528                  ## Reprocess in the "in head" insertion mode...              ## Reprocess in the "in head" insertion mode...
2529                  ## As if </head>              ## As if </head>
2530                  pop @{$self->{open_elements}};              pop @{$self->{open_elements}};
2531                  $self->{insertion_mode} = AFTER_HEAD_IM;              $self->{insertion_mode} = AFTER_HEAD_IM;
2532    
2533                  ## Reprocess in the "after head" insertion mode...              ## Reprocess in the "after head" insertion mode...
2534                } elsif ($self->{insertion_mode} == AFTER_HEAD_IM) {            } elsif ($self->{insertion_mode} == AFTER_HEAD_IM) {
2535                  !!!cp ('t143.4');              !!!cp ('t143.4');
2536                  #              #
2537                } else {            } else {
2538                  die "$0: $self->{insertion_mode}: Unknown insertion mode";              die "$0: $self->{insertion_mode}: Unknown insertion mode";
2539                }            }
2540    
2541                ## ISSUE: does not agree with IE7 - it doesn't ignore </br>.            #
2542                !!!parse-error (type => 'unmatched end tag',          } else { ## Other end tags
                               text => 'br', token => $token);  
               ## Ignore the token  
               !!!next-token;  
               next B;  
             } else {  
2543                !!!cp ('t145');                !!!cp ('t145');
2544                !!!parse-error (type => 'unmatched end tag',                !!!parse-error (type => 'unmatched end tag',
2545                                text => $token->{tag_name}, token => $token);                                text => $token->{tag_name}, token => $token);
# Line 2588  sub _tree_construction_main ($) { Line 2583  sub _tree_construction_main ($) {
2583              !!!insert-element ('body',, $token);              !!!insert-element ('body',, $token);
2584              $self->{insertion_mode} = IN_BODY_IM;              $self->{insertion_mode} = IN_BODY_IM;
2585              ## reprocess              ## reprocess
2586              next B;          next B;
2587        } elsif ($token->{type} == END_OF_FILE_TOKEN) {        } elsif ($token->{type} == END_OF_FILE_TOKEN) {
2588          if ($self->{insertion_mode} == BEFORE_HEAD_IM) {          if ($self->{insertion_mode} == BEFORE_HEAD_IM) {
2589            !!!cp ('t149.1');            !!!cp ('t149.1');
# Line 4857  sub _tree_construction_main ($) { Line 4852  sub _tree_construction_main ($) {
4852            next B;            next B;
4853          }          }
4854        } elsif ($token->{tag_name} eq 'textarea') {        } elsif ($token->{tag_name} eq 'textarea') {
4855          ## Step 1          ## 1. Insert
4856          !!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token);          !!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token);
4857                    
4858          ## Step 2          ## Step 2 # XXX
4859          ## TODO: $self->{form_element} if defined          ## TODO: $self->{form_element} if defined
4860    
4861          ## Step 3          ## 2. Drop U+000A LINE FEED
4862          $self->{ignore_newline} = 1;          $self->{ignore_newline} = 1;
4863    
4864          ## Step 4          ## 3. RCDATA
         ## ISSUE: This step is wrong. (r2302 enbugged)  
   
         ## Step 5  
4865          $self->{content_model} = RCDATA_CONTENT_MODEL;          $self->{content_model} = RCDATA_CONTENT_MODEL;
4866          delete $self->{escape}; # MUST          delete $self->{escape}; # MUST
4867    
4868          ## Step 6-7          ## 4., 6. Insertion mode
4869          $self->{insertion_mode} |= IN_CDATA_RCDATA_IM;          $self->{insertion_mode} |= IN_CDATA_RCDATA_IM;
4870    
4871            ## XXX: 5. frameset-ok flag
4872    
4873          !!!nack ('t392.1');          !!!nack ('t392.1');
4874          !!!next-token;          !!!next-token;
4875          next B;          next B;

Legend:
Removed from v.1.223  
changed lines
  Added in v.1.224

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24