Condition Coverage

blib/lib/HTML/Element.pm
Criterion Covered Total %
condition 205 426 48.1


and 3 conditions

line !l l&&!r l&&r condition
33 0 24 0 $using_weaken and not defined &Scalar::Util::weaken
161 0 0 2149 defined $tag and length $tag
212 0 0 0 defined $_[0] and ref $_[0]
0 0 0 defined $_[0] and ref $_[0] and $self eq $_[0]
255 0 0 0 defined $parm and $parm ne $self
285 0 2 6 length $_ && substr($_, 0, 1) eq '_'
290 0 0 0 length $_ && substr($_, 0, 1) eq '_'
328 0 0 0 defined($x = $_[0]{'id'}) and length $x
365 988 856 386 @$content and not ref $content->[-1]
397 0 0 0 @$content and not ref $content->[0]
451 0 0 0 ref $_ && $_ eq $self
474 0 0 4 $parent_content and @$parent_content
503 0 24 4 ref $_ && $_ eq $self
534 0 0 10 $parent_content and @$parent_content
538 0 25 10 ref $_ && $_ eq $self
580 132 2 1156 $self->{'_content'} and @{$self->{'_content'};}
582 4 1286 0 $self->{'_parent'} and $self->{'_parent'}{'_content'}
603 1 0 3 $it->{'_content'} and @{$it->{'_content'};}
632 0 0 1 $c = $start->{'_content'} and ref $c
0 0 1 $c = $start->{'_content'} and ref $c and @$c
641 3 2 1 defined $c->[$i] and ref $c->[$i]
675 2 0 2 $s and $s->[1] > 1
720 150 0 1661 $sibs = $this->{'_content'} and @$sibs
747 0 0 0 ref $sibs->[1] and $HTML::Element::canTighten{$sibs->[1]{'_tag'}}
757 0 0 0 ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
777 0 0 162 ref $$sibs[$i - 1] and ref $$sibs[$i + 1]
0 0 162 ref $$sibs[$i - 1] and ref $$sibs[$i + 1] and not $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
0 0 162 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'}}
904 247 0 15 defined $indent and length $indent
919 25 0 204 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors
25 40 164 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors and $last_tag_tightenable
960 24 0 177 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors
24 88 89 $this_tag_tightenable = $HTML::Element::canTighten{$tag} and not $nonindentable_ancestors and $last_tag_tightenable
993 160 0 0 defined $entities and not length $entities
1069 1132 14 1 defined $entities and not length $entities
1084 90 171 1 $self->{'_store_declarations'} and defined $self->{'_decl'}
1109 15 0 0 $skip_dels and $tag eq 'del'
1158 576 1 11 $empty_element_map->{$tag} and not @{$nillio unless $node->{'_content'};}
1168 574 1 0 $empty_element_map->{$tag} and not @{$nillio unless $node->{'_content'};}
1329 337 149 1 $_ 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 $_
1341 486 0 1 ref $val eq 'HTML::Element' and $val->{'_tag'} eq '~literal'
1347 486 0 0 defined $entities and not length $entities
1359 1397 21 7 scalar $self->content_list == 0 and $self->_empty_element_map->{$self->tag}
1451 0 0 380 defined $callback and ref $callback
1461 0 3 0 $c_pre and not UNIVERSAL::isa($c_pre, 'CODE')
1464 3 0 0 $c_post and not UNIVERSAL::isa($c_post, 'CODE')
1497 8 0 2368 $c_post and defined $I[0]
8 376 1992 $c_post and defined $I[0] and @C > 1
376 0 1992 $c_post and defined $I[0] and @C > 1 and defined($this = $C[1][$I[1]])
376 0 1992 $c_post and defined $I[0] and @C > 1 and defined($this = $C[1][$I[1]]) and ref $this
0 0 1992 $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'};}
1524 0 1992 0 defined $rv and ref $rv eq $travsignal_package
1561 0 1525 2030 defined $this and ref $this
1596 0 0 0 ref $this and not $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''}
1636 1864 144 18 !(($content_r = $this->{'_content'}) && @$content_r) && ($this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''})
1517 18 2008 ref $this and not !(($content_r = $this->{'_content'}) && @$content_r) && ($this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''})
1666 488 0 997 defined $current and ref $current
1673 2186 0 5472 defined $current and ref $current
1684 1 0 0 $self->{'_content'} && @{$self->{'_content'};}
1694 1 2 2 ref $pc->[$i] and $pc->[$i] eq $self
1714 0 0 0 ref $j and $j eq $_[0]
1720 0 0 0 ref $pc->[$i] and $pc->[$i] eq $_[0]
1746 0 0 0 ref $j and $j eq $_[0]
1754 0 0 0 ref $pc->[$i] and $pc->[$i] eq $_[0]
1780 0 12 0 @stack and not length $stack[0]
1792 0 0 20 $here->{'_content'} and @{$here->{'_content'};} > $stack[0]
1796 12 8 0 @stack and not ref $here
1809 0 0 0 defined($here = $here->{'_parent'}) and ref $here
1818 12 0 0 defined($here = $here->{'_parent'}) and ref $here
1828 1 0 2 defined($here = $here->{'_parent'}) and ref $here
1838 0 0 0 defined($here = $here->{'_parent'}) and ref $here
1926 14 0 3 exists $_[0]{$attribute} and $_[0]{$attribute} eq $value
2092 0 0 1 defined($this = $this->{'_parent'}) and ref $this
2184 0 0 0 $wantType and not $wantType{$tag}
2258 0 0 25 defined $i and ref $i
2297 0 0 8 $keys_h[$x] eq $keys_i[$x] and $$h{$keys_h[$x]} eq $$i{$keys_h[$x]}
2380 0 0 12 defined $v and $k ne '_name'
0 0 12 defined $v and $k ne '_name' and $k ne '_content'
0 0 12 defined $v and $k ne '_name' and $k ne '_content' and $k ne '_parent'
2548 0 0 0 $_[0] < 1 and $_[0] > -1
2558 0 0 0 $_[0] < 1 and $_[0] > -1

or 2 conditions

line l !l condition
236 0 0 +(shift())->{'_content'} ||= []
351 2042 1789 $self->{'_content'} ||= []
383 2 0 $self->{'_content'} ||= []
418 2 0 $self->{'_content'} ||= []
450 1 0 $parent->{'_content'} || (return $parent)
460 1 0 $_[0]{'_content'} || (return ())
537 0 10 $self->{'_content'} || []
895 5 257 $omissible_map ||= \%HTML::Element::optionalEndTag
1096 0 11 $options{'skip_dels'} || 0
1311 0 0 $self->{'text'} || ''
1382 1 0 $self->{'text'} || ''
1691 2 1 $self->{'_parent'} || (return undef)
1692 2 0 $parent->{'_content'} || (return undef)
1705 0 0 +($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1733 0 0 +($_[0]{'_parent'} || (return))->{'_content'} || die('parent is childless?')
1767 2 1 $_->pindex || '0'
2158 0 0 $map{$this_tag} ||= []
2304 18 3 $h->{'_content'} || []
2305 18 3 $i->{'_content'} || []
2567 0 0 $_[0] || (return '')
2585 0 0 $_[0] || 0
2635 0 0 $this->{'start'} || ''
2648 0 0 $c->{'value'} || ''
2684 0 0 $this->{'_content'} || (next)

or 3 conditions

line l !l&&r !l&&!r condition
158 0 2149 0 ref $class || $class
711 1 1 1811 ($ptag = +($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea'
2 0 1811 ($ptag = +($this = shift @to_do)->{'_tag'}) eq 'pre' or $ptag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$ptag}
747 0 0 0 $HTML::Element::canTighten{$ptag} or ref $sibs->[1] and $HTML::Element::canTighten{$sibs->[1]{'_tag'}}
757 346 0 0 $HTML::Element::canTighten{$ptag} or ref $$sibs[$i - 1] and $HTML::Element::canTighten{$$sibs[$i - 1]{'_tag'}}
763 162 0 0 ref $$sibs[$i - 1] or ref $$sibs[$i + 1]
820 15 0 1582 $self->_empty_element_map->{$tag} or $e->{'_empty_element'}
871 0 0 0 length $_ > 65 or /[\x00-\x1F]/
918 0 24 203 $empty_element_map->{$tag} || $omissible_map->{$tag}
940 1 1 227 $tag eq 'pre' or $tag eq 'textarea'
2 0 227 $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag}
950 1 1 201 $tag eq 'pre' or $tag eq 'textarea'
2 0 201 $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag}
993 0 0 160 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}}
0 0 160 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}} or $encoded_content
1046 11 7 1172 $empty_element_map->{$tag} || $omissible_map->{$tag}
1069 1 2 1144 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}}
3 1 1143 defined $entities and not length $entities or $HTML::Tagset::isCDATA_Parent{$_[3]{'_tag'}} or $encoded_content
1109 0 0 15 ($tag = +($this = shift @pile)->{'_tag'}) eq 'style' or $tag eq 'script'
0 0 15 ($tag = +($this = shift @pile)->{'_tag'}) eq 'style' or $tag eq 'script' or $skip_dels and $tag eq 'del'
1153 1 3678 1 $attr eq '/' or $self->_valid_name($attr)
1237 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 '/'
1326 0 7638 489 not length $_ or /^_/s
7638 2 487 not length $_ or /^_/s or $_ eq '/'
1347 0 0 486 defined $entities and not length $entities or $encoded_content
1397 0 3655 20 not length $_ or /^_/s
3655 1 19 not length $_ or /^_/s or $_ eq '/'
1467 3 0 0 $c_pre or $c_post
1493 0 2376 3555 not defined $I[0] or ++$I[0] >= @{$C[0];}
1497 0 0 1992 $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''} && !@{$this->{'_content'};}
1596 0 0 0 $this->{'_empty_element'} || $$empty_element_map{$this->{'_tag'} or ''}
1649 1866 142 0 $content_r || $NIL
1667 0 319 678 $current eq $_[0] or $current->{'_tag'} eq $_[0]
1674 0 0 5472 $elements{$current} or $elements{$current->{'_tag'}}
1993 0 40 17 !defined($c->[1]) || ($c->[2] eq 'Regexp' ? !($val =~ /$c->[1]/) : ref $val ne $c->[2] || lc $val ne lc $c->[1])
2067 0 1 1 !defined($c->[1]) || ($c->[2] eq 'Regexp' ? !($val =~ /$c->[1]/) : ref $val ne $c->[2] || lc $val ne $c->[1])
2338 7 22 0 ref $class || $class
2587 0 0 0 $i <= -4000 or $i >= 4000
2631 0 0 0 $tag eq 'ul' or $tag eq 'dir'
0 0 0 $tag eq 'ul' or $tag eq 'dir' or $tag eq 'menu'
2639 0 0 0 $HTML::Element::list_type_to_sub{$this->{'type'} or ''} || $HTML::Element::list_type_to_sub{'1'}
2724 0 0 0 $this->{'id'} ||= $this->address