Condition Coverage

blib/lib/HTML/Element.pm
Criterion Covered Total %
condition 210 426 49.3


and 3 conditions

line !l l&&!r l&&r condition
39 0 32 0 $using_weaken and not defined &Scalar::Util::weaken
168 0 0 2491 defined $tag and length $tag
220 0 0 0 defined $_[0] and ref $_[0]
0 0 0 defined $_[0] and ref $_[0] and $self eq $_[0]
274 0 0 0 defined $parm and $parm ne $self
302 0 2 6 length $_ && substr($_, 0, 1) eq '_'
309 0 0 0 length $_ && substr($_, 0, 1) eq '_'
348 0 0 0 defined($x = $_[0]{'id'}) and length $x
385 1143 995 464 @$content and not ref $$content[-1]
417 0 0 0 @$content and not ref $$content[0]
471 0 0 0 ref $_ && $_ eq $self
494 0 0 4 $parent_content and @$parent_content
523 0 24 4 ref $_ && $_ eq $self
554 0 0 18 $parent_content and @$parent_content
558 2 39 18 ref $_ && $_ eq $self
600 132 2 1156 $$self{'_content'} and @{$$self{'_content'};}
602 4 1286 0 $$self{'_parent'} and $$self{'_parent'}{'_content'}
623 1 0 3 $$it{'_content'} and @{$$it{'_content'};}
652 0 0 1 $c = $$start{'_content'} and ref $c
0 0 1 $c = $$start{'_content'} and ref $c and @$c
661 3 2 1 defined $$c[$i] and ref $$c[$i]
695 2 0 2 $s and $$s[1] > 1
740 183 0 1871 $sibs = $$this{'_content'} and @$sibs
764 0 2 0 ref $$sibs[1] and $HTML::Element::canTighten{$$sibs[1]{'_tag'}}
774 0 2 0 ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
792 0 0 165 ref $$sibs[$i - 1] and ref $$sibs[$i + 1]
0 0 165 ref $$sibs[$i - 1] and ref $$sibs[$i + 1] and not $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
0 0 165 ref $$sibs[$i - 1] and ref $$sibs[$i + 1] and not $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}} and not $HTML::Element::canTighten{$$sibs[$i + 1]{'_tag'}}
963 257 0 20 defined $indent and length $indent
978 31 0 258 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors
31 51 207 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors and $last_tag_tightenable
1019 30 0 225 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors
30 113 112 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors and $last_tag_tightenable
1045 203 0 0 defined $entities and not length $entities
1121 1152 14 1 defined $entities and not length $entities
1143 102 174 1 $$self{'_store_declarations'} and defined $$self{'_decl'}
1190 67 0 0 $skip_dels and $tag eq 'del'
1240 611 1 13 $$empty_element_map{$tag} and not @{$nillio unless $$node{'_content'};}
1250 609 1 0 $$empty_element_map{$tag} and not @{$nillio unless $$node{'_content'};}
1385 20 0 32 $_ ne '_tag' and $_ ne '_name'
20 16 16 $_ ne '_tag' and $_ ne '_name' and $_ ne '_content'
1450 357 149 1 $_ eq $val and exists $HTML::Element::boolean_attr{$name}
506 1 0 $_ eq $val and exists $HTML::Element::boolean_attr{$name} and ref $HTML::Element::boolean_attr{$name} ? $HTML::Element::boolean_attr{$name}{$_} : $HTML::Element::boolean_attr{$name} eq $_
1462 506 0 1 ref $val eq 'HTML::Element' and $$val{'_tag'} eq '~literal'
1468 506 0 0 defined $entities and not length $entities
1480 1505 26 12 scalar $self->content_list == 0 and $self->_empty_element_map->{$self->tag}
1570 0 0 409 defined $callback and ref $callback
1580 0 3 0 $c_pre and not UNIVERSAL::isa($c_pre, 'CODE')
1583 3 0 0 $c_post and not UNIVERSAL::isa($c_post, 'CODE')
1616 8 0 2510 $c_post and defined $I[0]
8 405 2105 $c_post and defined $I[0] and @C > 1
405 0 2105 $c_post and defined $I[0] and @C > 1 and defined($this = $C[1][$I[1]])
405 0 2105 $c_post and defined $I[0] and @C > 1 and defined($this = $C[1][$I[1]]) and ref $this
0 0 2105 $c_post and defined $I[0] and @C > 1 and defined($this = $C[1][$I[1]]) and ref $this and not $$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''} && !@{$$this{'_content'};}
1643 0 2105 0 defined $rv and ref $rv eq $travsignal_package
1680 0 1614 2145 defined $this and ref $this
1715 0 0 0 ref $this and not $$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''}
1755 1970 171 0 !(($content_r = $$this{'_content'}) && @$content_r) && ($$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''})
1606 20 2121 ref $this and not !(($content_r = $$this{'_content'}) && @$content_r) && ($$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''})
1784 3186 0 7752 defined $current and ref $current
1801 6 0 15 $$self{'_content'} && @{$$self{'_content'};}
1811 1 57 82 ref $$pc[$i] and $$pc[$i] eq $self
1831 0 0 0 ref $j and $j eq $_[0]
1837 0 0 0 ref $$pc[$i] and $$pc[$i] eq $_[0]
1863 0 0 0 ref $j and $j eq $_[0]
1871 0 0 0 ref $$pc[$i] and $$pc[$i] eq $_[0]
1897 0 12 0 @stack and not length $stack[0]
1909 0 0 20 $$here{'_content'} and @{$$here{'_content'};} > $stack[0]
1913 12 8 0 @stack and not ref $here
1926 0 0 0 defined($here = $$here{'_parent'}) and ref $here
1935 12 0 0 defined($here = $$here{'_parent'}) and ref $here
1945 47 0 82 defined($here = $$here{'_parent'}) and ref $here
1955 0 0 0 defined($here = $$here{'_parent'}) and ref $here
2043 14 0 3 exists $_[0]{$attribute} and $_[0]{$attribute} eq $value
2209 0 0 1 defined($this = $$this{'_parent'}) and ref $this
2300 0 0 0 $wantType and not $wantType{$tag}
2375 0 0 25 defined $i and ref $i
2412 0 0 8 $keys_h[$x] eq $keys_i[$x] and $$h{$keys_h[$x]} eq $$i{$keys_h[$x]}
2497 0 0 18 defined $v and $k ne '_name'
0 0 18 defined $v and $k ne '_name' and $k ne '_content'
0 0 18 defined $v and $k ne '_name' and $k ne '_content' and $k ne '_parent'
2665 0 0 0 $_[0] < 1 and $_[0] > -1
2675 0 0 0 $_[0] < 1 and $_[0] > -1

or 2 conditions

line l !l condition
250 0 0 (shift())->{'_content'} ||= []
371 2427 1998 $$self{'_content'} ||= []
403 2 0 $$self{'_content'} ||= []
438 2 0 $$self{'_content'} ||= []
470 1 0 $$parent{'_content'} || (return $parent)
480 1 0 $_[0]{'_content'} || (return ())
557 0 18 $$self{'_content'} || []
954 9 268 $omissible_map ||= \%HTML::Element::optionalEndTag
1178 0 53 $options{'skip_dels'} || 0
1432 0 0 $$self{'text'} || ''
1503 1 0 $$self{'text'} || ''
1808 82 47 $$self{'_parent'} || (return undef)
1809 82 0 $$parent{'_content'} || (return undef)
1822 0 0 ($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1850 0 0 ($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1884 43 86 $_->pindex || '0'
2275 0 0 $map{$this_tag} ||= []
2421 18 3 $$h{'_content'} || []
2422 18 3 $$i{'_content'} || []
2684 0 0 $_[0] || (return '')
2702 0 0 $_[0] || 0
2751 0 0 $$this{'start'} || ''
2763 0 0 $$c{'value'} || ''
2801 0 0 $$this{'_content'} || (next)

or 3 conditions

line l !l&&r !l&&!r condition
165 0 2491 0 ref $class || $class
731 1 1 2055 ($ptag = ($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea'
2 1 2054 ($ptag = ($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$ptag}
764 0 0 2 $HTML::Element::canTighten{$ptag} or ref $$sibs[1] and $HTML::Element::canTighten{$$sibs[1]{'_tag'}}
774 411 0 2 $HTML::Element::canTighten{$ptag} or ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
783 165 0 0 ref $$sibs[$i - 1] or ref $$sibs[$i + 1]
839 35 0 1776 $self->_empty_element_map->{$tag} or $$e{'_empty_element'}
891 0 0 17 length $_ > 65 or /[\x00-\x1F]/
940 4 0 0 print $filehandle '' or Carp::croak("Error printing BOM to filehandle: $!")
977 0 30 257 $$empty_element_map{$tag} || $$omissible_map{$tag}
997 1 1 287 $tag eq 'pre' or $tag eq 'textarea'
2 0 287 $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag}
1009 1 1 255 $tag eq 'pre' or $tag eq 'textarea'
2 0 255 $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag}
1045 0 0 203 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}}
0 0 203 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}} or $encoded_content
1105 11 11 1186 $$empty_element_map{$tag} || $$omissible_map{$tag}
1121 1 2 1164 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}}
3 0 1164 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}} or $encoded_content
1190 0 0 67 ($tag = ($this = shift @pile)->{'_tag'}) eq 'style' or $tag eq 'script'
0 0 67 ($tag = ($this = shift @pile)->{'_tag'}) eq 'style' or $tag eq 'script' or $skip_dels and $tag eq 'del'
1235 5 4059 1 $attr eq '/' or $self->_valid_name($attr)
1319 1 1 2 $_ eq '_content' or $_ eq '_tag'
2 1 1 $_ eq '_content' or $_ eq '_tag' or $_ eq '_parent'
2 0 1 $_ eq '_content' or $_ eq '_tag' or $_ eq '_parent' or $_ eq '/'
1447 0 8521 512 not length $_ or /^_/s
8521 5 507 not length $_ or /^_/s or $_ eq '/'
1468 0 0 506 defined $entities and not length $entities or $encoded_content
1518 0 4018 37 not length $_ or /^_/s
4018 5 32 not length $_ or /^_/s or $_ eq '/'
1586 3 0 0 $c_pre or $c_post
1612 0 2518 3759 not defined $I[0] or ++$I[0] >= @{$C[0];}
1616 0 0 2105 $$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''} && !@{$$this{'_content'};}
1715 0 0 0 $$this{'_empty_element'} || $$empty_element_map{$$this{'_tag'} or ''}
1768 1972 149 0 $content_r || $nillio
2110 0 0 296 !defined($$c[1]) || ($$c[2] eq 'Regexp' ? !($val =~ /$$c[1]/) : ref $val ne $$c[2] || lc $val ne lc $$c[1])
2184 0 0 2 !defined($$c[1]) || ($$c[2] eq 'Regexp' ? !($val =~ /$$c[1]/) : ref $val ne $$c[2] || lc $val ne $$c[1])
2455 9 39 0 ref $class || $class
2704 0 0 0 $i <= -4000 or $i >= 4000
2748 0 0 0 $tag eq 'ul' or $tag eq 'dir'
0 0 0 $tag eq 'ul' or $tag eq 'dir' or $tag eq 'menu'
2755 0 0 0 $list_type_to_sub{$$this{'type'} or ''} || $list_type_to_sub{'1'}
2841 0 0 0 $$this{'id'} ||= $this->address