/[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.131 by wakaba, Sun Apr 13 05:54:28 2008 UTC revision 1.132 by wakaba, Sun Apr 13 10:36:40 2008 UTC
# Line 8  use Error qw(:try); Line 8  use Error qw(:try);
8  ## doc.write ('');  ## doc.write ('');
9  ## alert (doc.compatMode);  ## alert (doc.compatMode);
10    
 ## TODO: Control charcters and noncharacters are not allowed (HTML5 revision 1263)  
11  ## TODO: 1252 parse error (revision 1264)  ## TODO: 1252 parse error (revision 1264)
12  ## TODO: 8859-11 = 874 (revision 1271)  ## TODO: 8859-11 = 874 (revision 1271)
13    
# Line 443  sub parse_string ($$$;$) { Line 442  sub parse_string ($$$;$) {
442      $self->{column}++;      $self->{column}++;
443            
444      if ($self->{next_char} == 0x000A) { # LF      if ($self->{next_char} == 0x000A) { # LF
445          !!!cp ('j1');
446        $self->{line}++;        $self->{line}++;
447        $self->{column} = 0;        $self->{column} = 0;
448      } elsif ($self->{next_char} == 0x000D) { # CR      } elsif ($self->{next_char} == 0x000D) { # CR
449          !!!cp ('j2');
450        $i++ if substr ($$s, $i, 1) eq "\x0A";        $i++ if substr ($$s, $i, 1) eq "\x0A";
451        $self->{next_char} = 0x000A; # LF # MUST        $self->{next_char} = 0x000A; # LF # MUST
452        $self->{line}++;        $self->{line}++;
453        $self->{column} = 0;        $self->{column} = 0;
454      } elsif ($self->{next_char} > 0x10FFFF) {      } elsif ($self->{next_char} > 0x10FFFF) {
455          !!!cp ('j3');
456        $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST        $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
457      } elsif ($self->{next_char} == 0x0000) { # NULL      } elsif ($self->{next_char} == 0x0000) { # NULL
458          !!!cp ('j4');
459        !!!parse-error (type => 'NULL');        !!!parse-error (type => 'NULL');
460        $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST        $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
461        } elsif ($self->{next_char} <= 0x0008 or
462                 (0x000E <= $self->{next_char} and $self->{next_char} <= 0x001F) or
463                 (0x007F <= $self->{next_char} and $self->{next_char} <= 0x009F) or
464                 (0xD800 <= $self->{next_char} and $self->{next_char} <= 0xDFFF) or
465                 (0xFDD0 <= $self->{next_char} and $self->{next_char} <= 0xFDDF) or
466                 {
467                  0xFFFE => 1, 0xFFFF => 1, 0x1FFFE => 1, 0x1FFFF => 1,
468                  0x2FFFE => 1, 0x2FFFF => 1, 0x3FFFE => 1, 0x3FFFF => 1,
469                  0x4FFFE => 1, 0x4FFFF => 1, 0x5FFFE => 1, 0x5FFFF => 1,
470                  0x6FFFE => 1, 0x6FFFF => 1, 0x7FFFE => 1, 0x7FFFF => 1,
471                  0x8FFFE => 1, 0x8FFFF => 1, 0x9FFFE => 1, 0x9FFFF => 1,
472                  0xAFFFE => 1, 0xAFFFF => 1, 0xBFFFE => 1, 0xBFFFF => 1,
473                  0xCFFFE => 1, 0xCFFFF => 1, 0xDFFFE => 1, 0xDFFFF => 1,
474                  0xEFFFE => 1, 0xEFFFF => 1, 0xFFFFE => 1, 0xFFFFF => 1,
475                  0x10FFFE => 1, 0x10FFFF => 1,
476                 }->{$self->{next_char}}) {
477          !!!cp ('j5');
478          !!!parse-error (type => 'control char', level => $self->{must_level});
479    ## TODO: error type documentation
480      }      }
481    };    };
482    $self->{prev_char} = [-1, -1, -1];    $self->{prev_char} = [-1, -1, -1];
# Line 7059  sub set_inner_html ($$$) { Line 7081  sub set_inner_html ($$$) {
7081          !!!cp ('i4');          !!!cp ('i4');
7082          !!!parse-error (type => 'NULL');          !!!parse-error (type => 'NULL');
7083          $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST          $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
7084          } elsif ($self->{next_char} <= 0x0008 or
7085                   (0x000E <= $self->{next_char} and
7086                    $self->{next_char} <= 0x001F) or
7087                   (0x007F <= $self->{next_char} and
7088                    $self->{next_char} <= 0x009F) or
7089                   (0xD800 <= $self->{next_char} and
7090                    $self->{next_char} <= 0xDFFF) or
7091                   (0xFDD0 <= $self->{next_char} and
7092                    $self->{next_char} <= 0xFDDF) or
7093                   {
7094                    0xFFFE => 1, 0xFFFF => 1, 0x1FFFE => 1, 0x1FFFF => 1,
7095                    0x2FFFE => 1, 0x2FFFF => 1, 0x3FFFE => 1, 0x3FFFF => 1,
7096                    0x4FFFE => 1, 0x4FFFF => 1, 0x5FFFE => 1, 0x5FFFF => 1,
7097                    0x6FFFE => 1, 0x6FFFF => 1, 0x7FFFE => 1, 0x7FFFF => 1,
7098                    0x8FFFE => 1, 0x8FFFF => 1, 0x9FFFE => 1, 0x9FFFF => 1,
7099                    0xAFFFE => 1, 0xAFFFF => 1, 0xBFFFE => 1, 0xBFFFF => 1,
7100                    0xCFFFE => 1, 0xCFFFF => 1, 0xDFFFE => 1, 0xDFFFF => 1,
7101                    0xEFFFE => 1, 0xEFFFF => 1, 0xFFFFE => 1, 0xFFFFF => 1,
7102                    0x10FFFE => 1, 0x10FFFF => 1,
7103                   }->{$self->{next_char}}) {
7104            !!!cp ('i4.1');
7105            !!!parse-error (type => 'control char', level => $self->{must_level});
7106    ## TODO: error type documentation
7107        }        }
7108      };      };
7109      $p->{prev_char} = [-1, -1, -1];      $p->{prev_char} = [-1, -1, -1];

Legend:
Removed from v.1.131  
changed lines
  Added in v.1.132

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24