/[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.98 by wakaba, Sun Sep 21 11:55:49 2008 UTC revision 1.99 by wakaba, Sun Sep 21 12:37:09 2008 UTC
# Line 221  $AttrStatus->{$XMLNS_NS}->{''} = FEATURE Line 221  $AttrStatus->{$XMLNS_NS}->{''} = FEATURE
221  ## TODO: xsi:schemaLocation for XHTML2 support (very, very low priority)  ## TODO: xsi:schemaLocation for XHTML2 support (very, very low priority)
222    
223  our %AnyChecker = (  our %AnyChecker = (
224      ## NOTE: |check_start| is invoked before anything on the element's
225      ## attributes and contents is checked.
226    check_start => sub { },    check_start => sub { },
227      ## NOTE: |check_attrs| is invoked after |check_start| and before
228      ## anything on the element's contents is checked.
229    check_attrs => sub {    check_attrs => sub {
230      my ($self, $item, $element_state) = @_;      my ($self, $item, $element_state) = @_;
231      for my $attr (@{$item->{node}->attributes}) {      for my $attr (@{$item->{node}->attributes}) {
# Line 256  our %AnyChecker = ( Line 260  our %AnyChecker = (
260        $self->_attr_status_info ($attr, $status);        $self->_attr_status_info ($attr, $status);
261      }      }
262    },    },
263      ## NOTE: |check_child_element| is invoked for each occurence of
264      ## child elements.  It is invoked after |check_attrs| and before
265      ## |check_end|.  |check_child_element| and |check_child_text| are
266      ## invoked for each child elements and text nodes in tree order.
267    check_child_element => sub {    check_child_element => sub {
268      my ($self, $item, $child_el, $child_nsuri, $child_ln,      my ($self, $item, $child_el, $child_nsuri, $child_ln,
269          $child_is_transparent, $element_state) = @_;          $child_is_transparent, $element_state) = @_;
# Line 269  our %AnyChecker = ( Line 277  our %AnyChecker = (
277        #        #
278      }      }
279    },    },
280      ## NOTE: |check_child_text| is invoked for each occurence of child
281      ## text nodes.  It is invoked after |check_attrs| and before
282      ## |check_end|.  |check_child_element| and |check_child_text| are
283      ## invoked for each child elements and text nodes in tree order.
284    check_child_text => sub { },    check_child_text => sub { },
285      ## NOTE: |check_end| is invoked after everything on the element's
286      ## attributes and contents are checked.
287    check_end => sub {    check_end => sub {
288      my ($self, $item, $element_state) = @_;      my ($self, $item, $element_state) = @_;
289      ## NOTE: There is a modified copy of the code below for |html:ruby|.      ## NOTE: There is a modified copy of the code below for |html:ruby|.
# Line 559  sub check_element ($$$;$) { Line 573  sub check_element ($$$;$) {
573    $self->{plus_elements} = {};    $self->{plus_elements} = {};
574    $self->{minus_elements} = {};    $self->{minus_elements} = {};
575    $self->{id} = {};    $self->{id} = {};
576    $self->{id_type} = {}; # 'menu' / 'labelable'    $self->{id_type} = {}; # 'form' / 'labelable' / 'menu'
577    $self->{form} = {};    $self->{form} = {}; # form/@name
578      $self->{form_ref} = []; # @form
579    $self->{term} = {};    $self->{term} = {};
580    $self->{usemap} = [];    $self->{usemap} = [];
581    $self->{ref} = []; # datetemplate data references    $self->{ref} = []; # datetemplate data references
# Line 778  next unless $code;## TODO: temp. Line 793  next unless $code;## TODO: temp.
793      }      }
794    }    }
795    
796      for (@{$self->{form_ref}}) {
797        if ($self->{id}->{$_->[0]} and
798            $self->{id_type}->{$_->[0]} eq 'form') {
799          #
800        } else {
801          $self->{onerror}->(node => $_->[1], type => 'no referenced form',
802                             level => $self->{level}->{must});
803        }
804      }
805    
806    for (@{$self->{contextmenu}}) {    for (@{$self->{contextmenu}}) {
807      if ($self->{id}->{$_->[0]} and      if ($self->{id}->{$_->[0]} and
808          $self->{id_type}->{$_->[0]} eq 'menu') {          $self->{id_type}->{$_->[0]} eq 'menu') {
# Line 794  next unless $code;## TODO: temp. Line 819  next unless $code;## TODO: temp.
819    delete $self->{id};    delete $self->{id};
820    delete $self->{id_type};    delete $self->{id_type};
821    delete $self->{form};    delete $self->{form};
822      delete $self->{form_ref};
823    delete $self->{usemap};    delete $self->{usemap};
824    delete $self->{ref};    delete $self->{ref};
825    delete $self->{template};    delete $self->{template};

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24