Condition Coverage

blib/lib/HTML/Element.pm
Criterion Covered Total %
condition 212 435 48.7


and 3 conditions

line !l l&&!r l&&r condition
39 1 32 0 $using_weaken and not defined &Scalar::Util::weaken
168 0 0 2867 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
304 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 1191 995 488 @$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
601 188 2 1268 $self->{'_content'} and @{$self->{'_content'};}
603 28 1430 0 $self->{'_parent'} and $self->{'_parent'}{'_content'}
624 1 0 3 $it->{'_content'} and @{$it->{'_content'};}
653 0 0 9 $c = $start->{'_content'} and ref $c
0 0 9 $c = $start->{'_content'} and ref $c and @$c
662 27 18 9 defined $c->[$i] and ref $c->[$i]
696 18 0 18 $s and $s->[1] > 1
741 271 0 2015 $sibs = $this->{'_content'} and @$sibs
768 0 2 0 ref $sibs->[1] and $HTML::Element::canTighten{$sibs->[1]{'_tag'}}
778 0 2 0 ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
798 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'}}
964 257 0 20 defined $indent and length $indent
979 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
1020 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
1053 203 0 0 defined $entities and not length $entities
1129 1152 14 1 defined $entities and not length $entities
1144 102 174 1 $self->{'_store_declarations'} and defined $self->{'_decl'}
1192 67 0 0 $skip_dels and $tag eq 'del'
1241 611 1 13 $empty_element_map->{$tag} and not @{$nillio unless $node->{'_content'};}
1251 609 1 0 $empty_element_map->{$tag} and not @{$nillio unless $node->{'_content'};}
1401 20 0 32 $_ ne '_tag' and $_ ne '_name'
20 16 16 $_ ne '_tag' and $_ ne '_name' and $_ ne '_content'
1465 357 150 0 $_ eq $val and exists $HTML::Element::boolean_attr{$name}
149 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 $_
1477 506 0 1 ref $val eq 'HTML::Element' and $val->{'_tag'} eq '~literal'
1483 506 0 0 defined $entities and not length $entities
1495 1505 26 12 scalar $self->content_list == 0 and $self->_empty_element_map->{$self->tag}
1585 0 0 425 defined $callback and ref $callback
1595 0 19 0 $c_pre and not UNIVERSAL::isa($c_pre, 'CODE')
1598 19 0 0 $c_post and not UNIVERSAL::isa($c_post, 'CODE')
1631 64 0 2510 $c_post and defined $I[0]
64 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'};}
1658 0 2105 0 defined $rv and ref $rv eq $travsignal_package
1695 0 1670 2249 defined $this and ref $this
1730 0 0 0 ref $this and not $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''}
1770 2058 171 0 !(($content_r = $this->{'_content'}) && @$content_r) && ($this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''})
1606 20 2209 ref $this and not !(($content_r = $this->{'_content'}) && @$content_r) && ($this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''})
1800 580 0 1221 defined $current and ref $current
1807 2718 0 6683 defined $current and ref $current
1818 6 0 15 $self->{'_content'} && @{$self->{'_content'};}
1828 1 57 82 ref $pc->[$i] and $pc->[$i] eq $self
1848 0 0 0 ref $j and $j eq $_[0]
1854 0 0 0 ref $pc->[$i] and $pc->[$i] eq $_[0]
1880 0 0 0 ref $j and $j eq $_[0]
1888 0 0 0 ref $pc->[$i] and $pc->[$i] eq $_[0]
1914 0 20 0 @stack and not length $stack[0]
1926 0 0 36 $here->{'_content'} and @{$here->{'_content'};} > $stack[0]
1930 20 16 0 @stack and not ref $here
1943 0 0 0 defined($here = $here->{'_parent'}) and ref $here
1952 20 0 0 defined($here = $here->{'_parent'}) and ref $here
1962 47 0 82 defined($here = $here->{'_parent'}) and ref $here
1972 0 0 0 defined($here = $here->{'_parent'}) and ref $here
2060 102 0 19 exists $_[0]{$attribute} and $_[0]{$attribute} eq $value
2226 0 0 9 defined($this = $this->{'_parent'}) and ref $this
2318 0 0 0 $wantType and not $wantType{$tag}
2392 0 0 25 defined $i and ref $i
2431 0 0 8 $keys_h[$x] eq $keys_i[$x] and $$h{$keys_h[$x]} eq $$i{$keys_h[$x]}
2514 0 0 82 defined $v and $k ne '_name'
0 0 82 defined $v and $k ne '_name' and $k ne '_content'
0 0 82 defined $v and $k ne '_name' and $k ne '_content' and $k ne '_parent'
2682 0 0 0 $_[0] < 1 and $_[0] > -1
2692 0 0 0 $_[0] < 1 and $_[0] > -1

or 2 conditions

line l !l condition
250 0 0 (shift())->{'_content'} ||= []
371 2523 2142 $self->{'_content'} ||= []
403 2 0 $self->{'_content'} ||= []
438 2 0 $self->{'_content'} ||= []
470 1 0 $parent->{'_content'} || (return $parent)
480 9 0 $_[0]{'_content'} || (return ())
557 0 18 $self->{'_content'} || []
955 9 268 $omissible_map ||= \%HTML::Element::optionalEndTag
1179 0 53 $options{'skip_dels'} || 0
1447 0 0 $self->{'text'} || ''
1518 1 0 $self->{'text'} || ''
1825 82 47 $self->{'_parent'} || (return undef)
1826 82 0 $parent->{'_content'} || (return undef)
1839 0 0 ($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1867 0 0 ($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1901 43 86 $_->pindex || '0'
2292 0 0 $map{$this_tag} ||= []
2438 18 3 $h->{'_content'} || []
2439 18 3 $i->{'_content'} || []
2701 0 0 $_[0] || (return '')
2719 0 0 $_[0] || 0
2769 0 0 $this->{'start'} || ''
2782 0 0 $c->{'value'} || ''
2818 0 0 $this->{'_content'} || (next)

or 3 conditions

line l !l&&r !l&&!r condition
165 0 2867 0 ref $class || $class
732 1 1 2287 ($ptag = ($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea'
2 0 2287 ($ptag = ($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$ptag}
768 0 0 2 $HTML::Element::canTighten{$ptag} or ref $sibs->[1] and $HTML::Element::canTighten{$sibs->[1]{'_tag'}}
778 411 0 2 $HTML::Element::canTighten{$ptag} or ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
784 165 0 0 ref $$sibs[$i - 1] or ref $$sibs[$i + 1]
841 43 0 1936 $self->_empty_element_map->{$tag} or $e->{'_empty_element'}
892 0 0 17 length $_ > 65 or /[\x00-\x1F]/
941 4 0 0 print $filehandle "\x{feff}" or Carp::croak("Error printing BOM to filehandle: $!")
978 0 0 287 $empty_element_map->{$tag} || $omissible_map->{$tag}
1000 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}
1010 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}
1053 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
1106 11 0 1197 $empty_element_map->{$tag} || $omissible_map->{$tag}
1129 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
1192 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'
1236 5 4061 1 $attr eq '/' or $self->_valid_name($attr)
1334 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 '/'
1462 0 8521 512 not length $_ or /^_/s
8521 5 507 not length $_ or /^_/s or $_ eq '/'
1483 0 0 506 defined $entities and not length $entities or $encoded_content
1533 0 4018 37 not length $_ or /^_/s
4018 5 32 not length $_ or /^_/s or $_ eq '/'
1601 19 0 0 $c_pre or $c_post
1627 0 2574 3919 not defined $I[0] or ++$I[0] >= @{$C[0];}
1631 0 0 2105 $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''} && !@{$this->{'_content'};}
1730 0 0 0 $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''}
1783 2060 149 0 $content_r || $nillio
1801 0 383 838 $current eq $_[0] or $current->{'_tag'} eq $_[0]
1808 0 0 6683 $elements{$current} or $elements{$current->{'_tag'}}
2127 0 0 296 !defined($c->[1]) || ($c->[2] eq 'Regexp' ? !($val =~ /$c->[1]/) : ref $val ne $c->[2] || lc $val ne lc $c->[1])
2201 0 0 18 !defined($c->[1]) || ($c->[2] eq 'Regexp' ? !($val =~ /$c->[1]/) : ref $val ne $c->[2] || lc $val ne $c->[1])
2472 9 63 0 ref $class || $class
2721 0 0 0 $i <= -4000 or $i >= 4000
2765 0 0 0 $tag eq 'ul' or $tag eq 'dir'
0 0 0 $tag eq 'ul' or $tag eq 'dir' or $tag eq 'menu'
2773 0 0 0 $list_type_to_sub{$this->{'type'} or ''} || $list_type_to_sub{'1'}
2858 0 0 0 $this->{'id'} ||= $this->address