/[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.34 by wakaba, Sun Jul 1 04:46:48 2007 UTC revision 1.35 by wakaba, Mon Jul 16 07:48:19 2007 UTC
# Line 23  my $AttrChecker = { Line 23  my $AttrChecker = {
23        }        }
24      },      },
25      lang => sub {      lang => sub {
26          my ($self, $attr) = @_;
27        ## NOTE: "The values of the attribute are language identifiers        ## NOTE: "The values of the attribute are language identifiers
28        ## as defined by [IETF RFC 3066], Tags for the Identification        ## as defined by [IETF RFC 3066], Tags for the Identification
29        ## of Languages, or its successor; in addition, the empty string        ## of Languages, or its successor; in addition, the empty string
30        ## may be specified." ("may" in lower case)        ## may be specified." ("may" in lower case)
31        ## TODO: xml:lang MUST NOT in HTML document        if ($attr->owner_document->manakai_is_html) { # MUST NOT
32            $self->{onerror}->(node => $attr, level => 'error',
33                               type => 'in HTML:xml:lang');
34    ## TODO: Test data...
35          }
36      },      },
37      base => sub {      base => sub {
38        my ($self, $attr) = @_;        my ($self, $attr) = @_;
# Line 951  my $HTMLAttrChecker = { Line 956  my $HTMLAttrChecker = {
956    },    },
957    title => sub {}, ## NOTE: No conformance creteria    title => sub {}, ## NOTE: No conformance creteria
958    lang => sub {    lang => sub {
959        my ($self, $attr) = @_;
960      ## TODO: RFC 3066 or empty test      ## TODO: RFC 3066 or empty test
961      ## ISSUE: RFC 4646 (3066bis)?      ## ISSUE: RFC 4646 (3066bis)?
962      ## TODO: HTML vs XHTML      unless ($attr->owner_document->manakai_is_html) {
963          $self->{onerror}->(node => $attr, type => 'in XML:lang');
964        }
965    },    },
966    dir => $GetHTMLEnumeratedAttrChecker->({ltr => 1, rtl => 1}),    dir => $GetHTMLEnumeratedAttrChecker->({ltr => 1, rtl => 1}),
967    class => $HTMLUnorderedSetOfSpaceSeparatedTokensAttrChecker,    class => $HTMLUnorderedSetOfSpaceSeparatedTokensAttrChecker,
# Line 1020  $Element->{$HTML_NS}->{html} = { Line 1028  $Element->{$HTML_NS}->{html} = {
1028        my $value = $attr->value;        my $value = $attr->value;
1029        unless ($value eq $HTML_NS) {        unless ($value eq $HTML_NS) {
1030          $self->{onerror}->(node => $attr, type => 'invalid attribute value');          $self->{onerror}->(node => $attr, type => 'invalid attribute value');
1031          ## TODO: only in HTML documents        }
1032          unless ($attr->owner_document->manakai_is_html) {
1033            $self->{onerror}->(node => $attr, type => 'in XML:xmlns');
1034      ## TODO: Test
1035        }        }
1036      },      },
1037    }),    }),
# Line 1272  $Element->{$HTML_NS}->{meta} = { Line 1283  $Element->{$HTML_NS}->{meta} = {
1283          $self->{onerror}->(node => $content_attr,          $self->{onerror}->(node => $content_attr,
1284                             type => 'attribute not allowed');                             type => 'attribute not allowed');
1285        }        }
       ## TODO: Allowed only in HTML documents  
1286      } else {      } else {
1287        if (defined $content_attr) {        if (defined $content_attr) {
1288          $self->{onerror}->(node => $content_attr,          $self->{onerror}->(node => $content_attr,
# Line 1301  $Element->{$HTML_NS}->{meta} = { Line 1311  $Element->{$HTML_NS}->{meta} = {
1311        }        }
1312      }      }
1313    
1314      ## TODO: charset      if (defined $charset_attr) {
1315          unless ($todo->{node}->owner_document->manakai_is_html) {
1316            $self->{onerror}->(node => $charset_attr,
1317                               type => 'in XML:charset');
1318          }
1319          ## TODO: charset
1320        }
1321    },    },
1322    checker => $HTMLEmptyChecker,    checker => $HTMLEmptyChecker,
1323  };  };
# Line 2675  $Element->{$HTML_NS}->{noscript} = { Line 2691  $Element->{$HTML_NS}->{noscript} = {
2691    },    },
2692  };  };
2693  ## TODO: noscript in head  ## TODO: noscript in head
2694    ## TODO: noscript in XHTML
2695    
2696  $Element->{$HTML_NS}->{'event-source'} = {  $Element->{$HTML_NS}->{'event-source'} = {
2697    attrs_checker => $GetHTMLAttrsChecker->({    attrs_checker => $GetHTMLAttrsChecker->({

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24