/[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.88 by wakaba, Sat Aug 30 10:26:39 2008 UTC revision 1.89 by wakaba, Sat Aug 30 12:33:36 2008 UTC
# Line 84  our $AttrChecker = { Line 84  our $AttrChecker = {
84    
85        ## TODO: test data        ## TODO: test data
86    
87          my $nsuri = $attr->owner_element->namespace_uri;
88          if (defined $nsuri and $nsuri eq $HTML_NS) {
89            my $lang_attr = $attr->owner_element->get_attribute_node_ns
90                (undef, 'lang');
91            if ($lang_attr) {
92              my $lang_attr_value = $lang_attr->value;
93              $lang_attr_value =~ tr/A-Z/a-z/; ## ASCII case-insensitive
94              my $value = $value;
95              $value =~ tr/A-Z/a-z/; ## ASCII case-insensitive
96              if ($lang_attr_value ne $value) {
97                ## NOTE: HTML5 Section "The |lang| and |xml:lang| attributes"
98                $self->{onerror}->(node => $attr,
99                                   type => 'xml:lang ne lang',
100                                   level => $self->{level}->{must});
101              }
102            }
103          }
104    
105        if ($attr->owner_document->manakai_is_html) { # MUST NOT        if ($attr->owner_document->manakai_is_html) { # MUST NOT
106          $self->{onerror}->(node => $attr, type => 'in HTML:xml:lang',          $self->{onerror}->(node => $attr, type => 'in HTML:xml:lang',
107                             level => $self->{level}->{must});                             level => $self->{level}->{must});
# Line 179  our $AttrChecker = { Line 197  our $AttrChecker = {
197  ## ISSUE: Should we really allow these attributes?  ## ISSUE: Should we really allow these attributes?
198  $AttrChecker->{''}->{'xml:space'} = $AttrChecker->{$XML_NS}->{space};  $AttrChecker->{''}->{'xml:space'} = $AttrChecker->{$XML_NS}->{space};
199  $AttrChecker->{''}->{'xml:lang'} = $AttrChecker->{$XML_NS}->{lang};  $AttrChecker->{''}->{'xml:lang'} = $AttrChecker->{$XML_NS}->{lang};
200        ## NOTE: Checker for (null, "xml:lang") attribute is shadowed for
201        ## HTML elements in Whatpm::ContentChecker::HTML.
202  $AttrChecker->{''}->{'xml:base'} = $AttrChecker->{$XML_NS}->{base};  $AttrChecker->{''}->{'xml:base'} = $AttrChecker->{$XML_NS}->{base};
203  $AttrChecker->{''}->{'xml:id'} = $AttrChecker->{$XML_NS}->{id};  $AttrChecker->{''}->{'xml:id'} = $AttrChecker->{$XML_NS}->{id};
204    
# Line 346  my $default_error_level = { Line 366  my $default_error_level = {
366    uncertain => 'u',    uncertain => 'u',
367    
368    html4_fact => 'm',    html4_fact => 'm',
369      html5_no_may => 'm',
370    
371    xml_error => 'm', ## TODO: correct?    xml_error => 'm', ## TODO: correct?
372    xml_id_error => 'm', ## TODO: ?    xml_id_error => 'm', ## TODO: ?
373    nc => 'm', ## XML Namespace Constraints ## TODO: correct?    nc => 'm', ## XML Namespace Constraints ## TODO: correct?

Legend:
Removed from v.1.88  
changed lines
  Added in v.1.89

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24