Branch Coverage

blib/lib/HTML/DOM/Element.pm
Criterion Covered Total %
branch 193 224 86.1


line true false branch
94 84 1318 unless $class_for{lc $_[0]}
143 7 1401 if $tagname eq '~comment'
157 162 1239 if ($tagname =~ /^html\z/i)
159 1401 0 unless $@
233 547 2 if @_
322 3852 1166 defined $ret ? :
324 0 1166 unless ($_[0]->tag)
328 33 2 unless exists $attr_defaults{$tag} and exists $attr_defaults{$tag}{$_[1]} or $tag eq 'html' and $_[1] eq 'version' and exists $_[0]{'_HTML_DOM_version'}
331 2 196 $_[1] eq 'version' ? :
342 216 586 if (defined &blessed($attr) and $attr->isa('HTML::DOM::Attr')) { }
353 12 237 defined $old ? :
362 565 21 if $old ne $str_val
366 2 800 if ($_[0] =~ /^on(.*)/is and my $listener_maker = $self->ownerDocument->event_attr_handler)
371 2 0 if defined $eavesdropper
383 4726 439 if defined wantarray
385 748 36 defined $_[0] ? :
784 4381 if @_
395 7 40 if (defined &blessed($old) and $old->isa('HTML::DOM::Attr')) { }
408 1 39 unless defined $old
432 45 342 unless (defined $attr)
439 1 1 unless exists $attr_defaults{$tag} and exists $attr_defaults{$tag}{$name} or $tag eq 'html' and $name eq 'version' and exists $elem->{'_HTML_DOM_version'}
445 1 20 $name eq 'version' ? :
450 304 38 unless (ref $attr)
468 1 18 if defined($e = $_[1]->_element) and $e != $_[0]
476 0 18 if ($name =~ /^on(.*)/is and my $listener_maker = $_[0]->ownerDocument->event_attr_handler)
487 0 0 if defined $eavesdropper
493 10 8 if (defined $old)
494 9 1 if (defined &blessed($old) and $old->isa('HTML::DOM::Attr')) { }
506 10 8 if defined $ret
521 10 8 if defined $ret
532 9 2 defined $old_val ? :
3 8 unless defined $old_val ? ref $old_val && &refaddr($attr) == &refaddr($old_val) : exists $elem->{'_HTML_DOM_unspecified'}{$name}
556 4 6 if (wantarray) { }
557 1 3 $tagname eq '*' ? :
573 1 5 $tagname eq '*' ? :
588 18 0 if (defined $names) { }
603 14 4 if (wantarray) { }
610 2 2 $is_doc ? :
624 14 1 unless defined $self->attr($attrname) or exists $attr_defaults{$tag = $self->tag} and exists $attr_defaults{$tag}{$attrname}
646 0 35 &_html_element_adds_newline() ? :
35 9 $_->nodeType == 1 ? :
19 25 if defined wantarray
654 26 18 if (@_)
677 0 5 unless exists $mm{my $where = lc $_[0]}
692 0 5 unless exists $mm{my $where = lc $_[0]}
704 3 0 if defined wantarray
706 1 2 if (@_)
740 3 4 unless (shift())
777 1571 0 $a->ownerDocument->magic_forms ? :
814 2 4 if (@_ > 1) { }
833 24 16 unless $self->attr('rel') =~ /(?:^|\p{IsSpacePerl})stylesheet(?:\z|\p{IsSpacePerl})/i
838 4 12 if @_
839 4 12 unless $old
874 0 38 if (defined &blessed($_[0]) and $_[0]->isa('HTML::DOM::Event')) { }
0 38 elsif (not $_[0] =~ /^domattrmodified\z/i) { }
875 0 0 unless $_[0]->type =~ /^domattrmodified\z/i
878 0 0 if ($attr_name eq 'href')
885 19 19 if $args{'auto_viv'}
886 5 33 if $args{'attr_name'} eq 'href'
894 14 7 unless ($elem->attr('rel') || '') =~ /(?:^|\p{IsSpacePerl})stylesheet(?:\z|\p{IsSpacePerl})/i
897 2 5 unless my $fetcher = $doc->css_url_fetcher
899 0 5 defined $base ? :
905 1 4 unless defined $css_code
921 0 0 @ret ? :
971 1 1 unless ((shift())->look_up('_tag', 'form'))[0]
992 4 0 $first_child ? :
1010 1 3 $target ? :
1026 11 9 $_[0] ? :
20 10 @_ ? :
1133 2 2 $_[0] ? :
4 2 @_ ? :
1182 90 38 unless ($uri->scheme)
1184 84 6 unless $base
1186 0 6 unless $uri->scheme
1193 12 6 unless defined(my $uri = _get_abs_href($elem))
1195 6 0 if (defined wantarray)
1197 2 4 if defined $old
1199 2 4 if (@_)
1204 4 2 unless $old
1209 12 6 unless defined(my $uri = _get_abs_href($elem))
1210 6 0 if defined wantarray
1211 2 4 if (@_)
1221 12 6 unless defined(my $uri = _get_abs_href($elem))
1222 6 0 if defined wantarray
1223 2 4 if (@_)
1232 12 6 unless defined(my $uri = _get_abs_href($elem))
1233 6 0 if defined wantarray
1234 2 4 if (@_)
1243 12 6 unless defined(my $uri = _get_abs_href($elem))
1244 6 0 if defined wantarray
1245 2 4 if (@_)
1254 12 6 unless defined(my $uri = _get_abs_href($elem))
1255 6 0 if defined wantarray
1256 2 4 if (@_)
1267 12 8 unless defined(my $uri = _get_abs_href($elem))
1269 6 2 if (defined wantarray)
1271 2 4 defined $q ? :
1273 4 4 if (@_)
1275 4 0 $1 || length $2 ? :
1296 2 2 $_[0] ? :
4 2 @_ ? :
1316 2 2 $_[0] ? :
4 2 @_ ? :
1362 0 1 if (wantarray) { }
1384 1 2 $_[0] ? :
3 2 @_ ? :
1403 2 2 $_[0] ? :
4 2 @_ ? :
1425 2 2 $_[0] ? :
4 2 @_ ? :
1431 4 4 if @_
1432 4 4 defined $old ? :