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}) { |
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) = @_; |
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|. |
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 |
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') { |
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}; |