/[suikacvs]/markup/html/whatpm/Whatpm/ContentChecker.pm
Suika

Diff of /markup/html/whatpm/Whatpm/ContentChecker.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.70 by wakaba, Tue Feb 26 08:28:00 2008 UTC revision 1.71 by wakaba, Sun Mar 2 11:16:34 2008 UTC
# Line 243  sub check_document ($$$;$) { Line 243  sub check_document ($$$;$) {
243    $self->{should_level} = 's';    $self->{should_level} = 's';
244    $self->{good_level} = 'w';    $self->{good_level} = 'w';
245    $self->{info_level} = 'i';    $self->{info_level} = 'i';
246    $self->{unsupported_lavel} = 'u';    $self->{unsupported_level} = 'u';
247    
248    my $docel = $doc->document_element;    my $docel = $doc->document_element;
249    unless (defined $docel) {    unless (defined $docel) {
# Line 293  sub check_document ($$$;$) { Line 293  sub check_document ($$$;$) {
293      require Message::Charset::Info;      require Message::Charset::Info;
294      my $charset = $Message::Charset::Info::IANACharset->{$charset_name};      my $charset = $Message::Charset::Info::IANACharset->{$charset_name};
295    
296      if ($doc->manakai_is_html and      if ($doc->manakai_is_html) {
297          not $doc->manakai_has_bom and        if (not $doc->manakai_has_bom and
298          not defined $doc->manakai_charset) {            not defined $doc->manakai_charset) {
299        unless ($charset->{is_html_ascii_superset}) {          unless ($charset->{is_html_ascii_superset}) {
300          $onerror->(node => $doc, level => $self->{must_level},            $onerror->(node => $doc, level => $self->{must_level},
301                     type => 'non ascii superset:'.$charset_name);                       type => 'non ascii superset:'.$charset_name);
302            }
303            
304            if (not $self->{has_charset} and ## TODO: This does not work now.
305                not $charset->{iana_names}->{'us-ascii'}) {
306              $onerror->(node => $doc, level => $self->{must_level},
307                         type => 'no character encoding declaration:'.$charset_name);
308            }
309        }        }
         
       if (not $self->{has_charset} and ## TODO: This does not work now.  
           not $charset->{iana_names}->{'us-ascii'}) {  
         $onerror->(node => $doc, level => $self->{must_level},  
                    type => 'no character encoding declaration:'.$charset_name);  
       }  
     }  
310    
311      if ($charset->{iana_names}->{'utf-8'}) {        if ($charset->{iana_names}->{'utf-8'}) {
312        #          #
313      } elsif ($charset->{iana_names}->{'jis_x0212-1990'} or        } elsif ($charset->{iana_names}->{'jis_x0212-1990'} or
314               $charset->{iana_names}->{'x-jis0208'} or                 $charset->{iana_names}->{'x-jis0208'} or
315               $charset->{iana_names}->{'utf-32'} or ## ISSUE: UTF-32BE? UTF-32LE?                 $charset->{iana_names}->{'utf-32'} or ## ISSUE: UTF-32BE? UTF-32LE?
316               $charset->{is_ebcdic_based}) {                 $charset->{is_ebcdic_based}) {
317        $onerror->(node => $doc,          $onerror->(node => $doc,
318                   type => 'character encoding:'.$charset_name,                     type => 'character encoding:'.$charset_name,
319                   level => $self->{should_level});                     level => $self->{should_level});
320      } elsif ($charset->{iana_names}->{'cesu-8'} or        } elsif ($charset->{iana_names}->{'cesu-8'} or
321               $charset->{iana_names}->{'utf-8'} or ## ISSUE: UNICODE-1-1-UTF-7?                 $charset->{iana_names}->{'utf-8'} or ## ISSUE: UNICODE-1-1-UTF-7?
322               $charset->{iana_names}->{'bocu-1'} or                 $charset->{iana_names}->{'bocu-1'} or
323               $charset->{iana_names}->{'scsu'}) {                 $charset->{iana_names}->{'scsu'}) {
324        $onerror->(node => $doc,          $onerror->(node => $doc,
325                   type => 'character encoding:'.$charset_name,                     type => 'character encoding:'.$charset_name,
326                   level => $self->{must_level});                     level => $self->{must_level});
327      } else {        } else {
328        $onerror->(node => $doc,          $onerror->(node => $doc,
329                   type => 'character encoding:'.$charset_name,                     type => 'character encoding:'.$charset_name,
330                   level => $self->{good_level});                     level => $self->{good_level});
331          }
332      }      }
333    } elsif ($doc->manakai_is_html) {    } elsif ($doc->manakai_is_html) {
334      ## NOTE: MUST and SHOULD requirements above cannot be tested,      ## NOTE: MUST and SHOULD requirements above cannot be tested,
# Line 353  sub check_element ($$$;$) { Line 354  sub check_element ($$$;$) {
354    $self->{should_level} = 's';    $self->{should_level} = 's';
355    $self->{good_level} = 'w';    $self->{good_level} = 'w';
356    $self->{info_level} = 'i';    $self->{info_level} = 'i';
357    $self->{unsupported_lavel} = 'u';    $self->{unsupported_level} = 'u';
358    
359    $self->{plus_elements} = {};    $self->{plus_elements} = {};
360    $self->{minus_elements} = {};    $self->{minus_elements} = {};

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24