Branch Coverage

blib/lib/HTML/DOM.pm
Criterion Covered Total %
branch 172 188 91.4


line true false branch
36 20281 3 if $self->isa(scalar caller) or (caller)->isa('HTML::DOM::_TreeBuilder')
193 2144 535 /^[a-z_]*\z/ ? :
219 7 800 if $tag =~ /^~/
221 16 784 if ($tag eq 'link')
233 40 760 if ($tag eq 'form')
235 0 40 unless $doc_elem->{'_HTML_DOM_cf'}
238 13 27 unless delete $doc_elem->{'_HTML_DOM_etif'}
243 9 83 if (not $doc_elem->{'_HTML_DOM_no_mg'} and $tag =~ /^(?: button|(?: fieldse|inpu|(?:obj|sel)ec )t|label|textarea )\z/x and $doc_elem->{'_HTML_DOM_mg_f'} and not $doc_elem->{'_HTML_DOM_cf'} && @{$doc_elem->{'_HTML_DOM_cf'};})
261 796 4 unless my $event_offsets = delete $elem->{'_HTML_DOM_tb_event_offsets'}
299 5 589 if @_ < 6
307 5 530 if $attr_names->[$_] =~ /^on(.*)/is
313 40 549 if $_[0] eq 'form'
316 584 5 unless %event_offsets
318 4 1 if (not $HTML::Tagset::emptyElement{$_[0]}) { }
334 2 3 unless defined(my $event_attr_handler = $doc_elem->ownerDocument->event_attr_handler)
345 3 0 if defined $l
359 554 306 ref $tag ? :
12 848 if ((ref $tag ? $tag->tag : $tag) eq 'tr' and $self->pos->tag eq 'table')
372 27 574 if $_[0] eq 'form'
376 4 597 if $_[0] =~ /^t[hd]\z/
385 84 477 if ($self->{'_pos'} || (return @ret))->{'_tag'} eq '~doc'
392 1 8 unless $tagname eq 'doctype' and my $parent = $self->parent
396 8 0 unless defined $parent->{'_HTML_DOM_doctype'}
397 1 7 unless @$tokens > 3
399 7 0 if s/^['"]//
416 9 83 if ($opts{'response'})
418 7 2 unless (defined $self->{'_HTML_DOM_url'})
423 7 2 unless (defined $self->{'_HTML_DOM_referrer'})
428 1 8 if ($opts{'weaken_response'})
484 124 9 if @_ < 3
500 7 0 if ($level and $level -= 1, 1 and $self->{'_HTML_DOM_p'} and $self->{'_HTML_DOM_p'}[$level])
508 1 6 $level ? :
511 1 8 if (my $p = $self->{'_HTML_DOM_parser'})
541 3 8 if @_
542 4 7 unless $old
616 0 5 if (ref $file or ref \$file eq 'GLOB')
618 0 0 unless (my $a = (shift())->{'_HTML_DOM_parser'})->parse_file($file)
624 3 2 if (my $charset = $_[0]{'_HTML_DOM_cs'})
625 0 3 unless CORE::open my $fh, $file
634 1 1 unless CORE::open my $fh, $file
653 5 33 if @_
659 7 103 if ($self->{'_HTML_DOM_buffered'}) { }
736 3 94 unless $a
762 102 14 unless $self->{'_HTML_DOM_elem_handlers'}
895 4 13 if (wantarray) { }
896 1 3 $tagname eq '*' ? :
905 1 12 $tagname eq '*' ? :
913 2 10 if $node->nodeType == 9
918 8 2 if ($clown->can('descendants'))
1016 8 4 if (my $title_elem = $doc->find('title')) { }
1020 1 3 unless @_
1035 5 0 defined $referrer ? :
1041 1 1 ref $doc->{'_HTML_DOM_url'} ? :
1046 40 111 defined $url ? :
1053 24 54 unless ($body and $body->tag =~ /^(?:body|frameset)\z/)
1056 2 76 if (@_ > 1) { }
1071 1 1 if (wantarray) { }
1086 1 1 if (wantarray) { }
1103 1 3 if (wantarray) { }
1106 37 1 unless $tag eq 'area'
1115 89 1 unless $tag eq 'area'
1126 17 22 if (wantarray) { }
1141 1 1 if (wantarray) { }
1159 2 6 unless defined(my $jar = $self->{'_HTML_DOM_jar'})
1161 6 0 if (defined wantarray)
1172 0 6 if (not $reqclone->can('header_field_names') and $reqclone->isa('HTTP::Headers'))
1175 2 0 if /cookie/i
1195 3 3 if (@_)
1196 0 3 unless defined $self->{'_HTML_DOM_response'}
1203 1 5 if lc $_ eq 'version'
1210 1 5 unless $return
1233 162 2339 if $this->id eq $id
1241 2 1 if (wantarray) { }
1301 4 1882 if (@_)
1304 20 1866 defined $old ? :
1327 1 24 wantarray ? :
1341 0 11 &HTML::DOM::Element::_html_element_adds_newline() ? :
13 12 if defined wantarray
1350 13 12 if (@_)
1376 1 2 if @_
1379 1 2 unless $self->{'_HTML_DOM_loc'}
1414 1 2 unless my $time = ($_[0]{'_HTML_DOM_response'} || (return ''))->last_modified
1447 10 147 if (my $base_elem = $doc->look_down('_tag', 'base', 'href', qr/(?:)/)) { }
1454 146 1 unless $doc->{'_HTML_DOM_response'}
1467 1580 0 if @_
1635 6 15 if @_ > 1
1640 11 1875 if @_ > 1
1645 12 210 if @_ > 2
1650 4 1891 if @_ > 1
1656 2 675 if @_
1662 1 1890 if @_
1663 1 1890 defined $old ? :
1674 189 87 defined $_ ? :
1676 48 328 if ($list_is_stale)