/[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.6 by wakaba, Sat May 26 08:12:34 2007 UTC revision 1.10 by wakaba, Sat Jun 23 03:30:06 2007 UTC
# Line 280  my $entity_char = { Line 280  my $entity_char = {
280    zwnj => "\x{200C}",    zwnj => "\x{200C}",
281  }; # $entity_char  }; # $entity_char
282    
 ## <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562>  
283  my $c1_entity_char = {  my $c1_entity_char = {
284       128, 8364,    0x80 => 0x20AC,
285       129, 65533,    0x81 => 0xFFFD,
286       130, 8218,    0x82 => 0x201A,
287       131, 402,    0x83 => 0x0192,
288       132, 8222,    0x84 => 0x201E,
289       133, 8230,    0x85 => 0x2026,
290       134, 8224,    0x86 => 0x2020,
291       135, 8225,    0x87 => 0x2021,
292       136, 710,    0x88 => 0x02C6,
293       137, 8240,    0x89 => 0x2030,
294       138, 352,    0x8A => 0x0160,
295       139, 8249,    0x8B => 0x2039,
296       140, 338,    0x8C => 0x0152,
297       141, 65533,    0x8D => 0xFFFD,
298       142, 381,    0x8E => 0x017D,
299       143, 65533,    0x8F => 0xFFFD,
300       144, 65533,    0x90 => 0xFFFD,
301       145, 8216,    0x91 => 0x2018,
302       146, 8217,    0x92 => 0x2019,
303       147, 8220,    0x93 => 0x201C,
304       148, 8221,    0x94 => 0x201D,
305       149, 8226,    0x95 => 0x2022,
306       150, 8211,    0x96 => 0x2013,
307       151, 8212,    0x97 => 0x2014,
308       152, 732,    0x98 => 0x02DC,
309       153, 8482,    0x99 => 0x2122,
310       154, 353,    0x9A => 0x0161,
311       155, 8250,    0x9B => 0x203A,
312       156, 339,    0x9C => 0x0153,
313       157, 65533,    0x9D => 0xFFFD,
314       158, 382,    0x9E => 0x017E,
315       159, 376,    0x9F => 0x0178,
316  }; # $c1_entity_char  }; # $c1_entity_char
317    
318  my $special_category = {  my $special_category = {
# Line 374  sub parse_string ($$$;$) { Line 373  sub parse_string ($$$;$) {
373      } elsif ($self->{next_input_character} > 0x10FFFF) {      } elsif ($self->{next_input_character} > 0x10FFFF) {
374        $self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST        $self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
375      } elsif ($self->{next_input_character} == 0x0000) { # NULL      } elsif ($self->{next_input_character} == 0x0000) { # NULL
376          !!!parse-error (type => 'NULL');
377    ## TODO: test
378        $self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST        $self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
379      }      }
380    };    };
# Line 444  sub _initialize_tokenizer ($) { Line 445  sub _initialize_tokenizer ($) {
445  ## has completed loading.  If one has, then it MUST be executed  ## has completed loading.  If one has, then it MUST be executed
446  ## and removed from the list.  ## and removed from the list.
447    
448    ## ISSUE: <http://html5.org/tools/web-apps-tracker?from=874&to=876>
449    
450  sub _get_next_token ($) {  sub _get_next_token ($) {
451    my $self = shift;    my $self = shift;
452    if (@{$self->{token}}) {    if (@{$self->{token}}) {
# Line 1538  sub _tokenize_attempt_to_consume_an_enti Line 1541  sub _tokenize_attempt_to_consume_an_enti
1541            $num = 0xFFFD; # REPLACEMENT CHARACTER            $num = 0xFFFD; # REPLACEMENT CHARACTER
1542            ## ISSUE: Why this is not an error?            ## ISSUE: Why this is not an error?
1543          } elsif (0x80 <= $num and $num <= 0x9F) {          } elsif (0x80 <= $num and $num <= 0x9F) {
1544            ## NOTE: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562>            !!!parse-error (type => sprintf 'c1 entity:U+%04X', $num);
           ## ISSUE: Not in the spec yet; parse error?  
1545            $num = $c1_entity_char->{$num};            $num = $c1_entity_char->{$num};
1546          }          }
1547    
# Line 1569  sub _tokenize_attempt_to_consume_an_enti Line 1571  sub _tokenize_attempt_to_consume_an_enti
1571          $code = 0xFFFD; # REPLACEMENT CHARACTER          $code = 0xFFFD; # REPLACEMENT CHARACTER
1572          ## ISSUE: Why this is not an error?          ## ISSUE: Why this is not an error?
1573        } elsif (0x80 <= $code and $code <= 0x9F) {        } elsif (0x80 <= $code and $code <= 0x9F) {
1574          ## NOTE: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562>          !!!parse-error (type => sprintf 'c1 entity:U+%04X', $code);
         ## ISSUE: Not in the spec yet; parse error?  
1575          $code = $c1_entity_char->{$code};          $code = $c1_entity_char->{$code};
1576        }        }
1577                
# Line 2320  sub _tree_construction_main ($) { Line 2321  sub _tree_construction_main ($) {
2321          if (defined $self->{form_element}) {          if (defined $self->{form_element}) {
2322            !!!parse-error (type => 'in form:form');            !!!parse-error (type => 'in form:form');
2323            ## Ignore the token            ## Ignore the token
2324              !!!next-token;
2325              return;
2326          } else {          } else {
2327            ## has a p element in scope            ## has a p element in scope
2328            INSCOPE: for (reverse @{$self->{open_elements}}) {            INSCOPE: for (reverse @{$self->{open_elements}}) {
# Line 2361  sub _tree_construction_main ($) { Line 2364  sub _tree_construction_main ($) {
2364          LI: {          LI: {
2365            ## Step 2            ## Step 2
2366            if ($node->[1] eq 'li') {            if ($node->[1] eq 'li') {
2367                if ($i != -1) {
2368                  !!!parse-error (type => 'end tag missing:'.
2369                                  $self->{open_elements}->[-1]->[1]);
2370                  ## TODO: test
2371                }
2372              splice @{$self->{open_elements}}, $i;              splice @{$self->{open_elements}}, $i;
2373              last LI;              last LI;
2374            }            }
# Line 2404  sub _tree_construction_main ($) { Line 2412  sub _tree_construction_main ($) {
2412          LI: {          LI: {
2413            ## Step 2            ## Step 2
2414            if ($node->[1] eq 'dt' or $node->[1] eq 'dd') {            if ($node->[1] eq 'dt' or $node->[1] eq 'dd') {
2415                if ($i != -1) {
2416                  !!!parse-error (type => 'end tag missing:'.
2417                                  $self->{open_elements}->[-1]->[1]);
2418                  ## TODO: test
2419                }
2420              splice @{$self->{open_elements}}, $i;              splice @{$self->{open_elements}}, $i;
2421              last LI;              last LI;
2422            }            }
# Line 2697  sub _tree_construction_main ($) { Line 2710  sub _tree_construction_main ($) {
2710          $insert->($el);          $insert->($el);
2711                    
2712          my $text = '';          my $text = '';
2713          !!!next-token;          if ($token->{tag_name} eq 'textarea') {
2714              !!!next-token;
2715              if ($token->{type} eq 'character') {
2716                $token->{data} =~ s/^\x0A//;
2717                unless (length $token->{data}) {
2718                  !!!next-token;
2719                }
2720              }
2721            } else {
2722              !!!next-token;
2723            }
2724          while ($token->{type} eq 'character') {          while ($token->{type} eq 'character') {
2725            $text .= $token->{data};            $text .= $token->{data};
2726            !!!next-token;            !!!next-token;
# Line 2713  sub _tree_construction_main ($) { Line 2736  sub _tree_construction_main ($) {
2736            ## Ignore the token            ## Ignore the token
2737          } else {          } else {
2738            if ($token->{tag_name} eq 'textarea') {            if ($token->{tag_name} eq 'textarea') {
             !!!parse-error (type => 'in CDATA:#'.$token->{type});  
           } else {  
2739              !!!parse-error (type => 'in RCDATA:#'.$token->{type});              !!!parse-error (type => 'in RCDATA:#'.$token->{type});
2740              } else {
2741                !!!parse-error (type => 'in CDATA:#'.$token->{type});
2742            }            }
2743            ## ISSUE: And ignore?            ## ISSUE: And ignore?
2744          }          }
# Line 2873  sub _tree_construction_main ($) { Line 2896  sub _tree_construction_main ($) {
2896                  strong => 1, tt => 1, u => 1,                  strong => 1, tt => 1, u => 1,
2897                 }->{$token->{tag_name}}) {                 }->{$token->{tag_name}}) {
2898          $formatting_end_tag->($token->{tag_name});          $formatting_end_tag->($token->{tag_name});
2899    ## TODO: <http://html5.org/tools/web-apps-tracker?from=883&to=884>
2900          return;          return;
2901        } elsif ({        } elsif ({
2902                  caption => 1, col => 1, colgroup => 1, frame => 1,                  caption => 1, col => 1, colgroup => 1, frame => 1,

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24