Branch Coverage

blib/lib/Mojo/DOM/HTML.pm
Criterion Covered Total %
branch 84 86 97.6


line true false branch
111 7 8471 if defined $runaway
112 2311 6167 if defined $text
115 2886 5592 if (defined $tag) { }
13 5579 elsif (defined $doctype) { }
12 5567 elsif (defined $comment) { }
7 5560 elsif (defined $cdata) { }
17 5543 elsif (defined $pi) { }
118 79 1186 $xml ? :
1265 1621 if ($tag =~ m[^/\s*(\S+)]) { }
1621 0 elsif ($tag =~ m[^([^\s/]+)([\s\S]*)]) { }
122 99 1522 $xml ? :
127 45 33590 $xml ? :
130 44 33591 if $key eq '/'
132 33563 28 defined $value ? :
136 1 1620 if not $xml and $start eq 'image'
141 134 1487 if not $xml and $EMPTY{$start} or $xml || !$BLOCK{$start} and $closing
144 1577 44 if $xml or not $RAW{$start} || $RCDATA{$start}
145 1 43 unless $html =~ m[\G(.*?)<\s*/\s*\Q$start\E\s*>]cgis
146 25 18 $RCDATA{$start} ? :
162 10 7 if not exists $self->{'xml'} and $pi =~ /xml/i
184 372 3278 if $next->[0] eq 'root'
187 1487 1791 if $next->[1] eq $end
190 5 1768 if not $xml and $PHRASING{$end} and not $PHRASING{$next->[1]}
206 1400 1220 if ($type eq 'tag')
215 2 35 $xml ? :
37 1564 unless defined $value
221 308 19 $EMPTY{$tag} ? :
5 327 $xml ? :
332 1068 unless $tree->[4]
233 725 495 if $type eq 'text'
236 358 137 if $type eq 'raw'
239 123 14 if $type eq 'root'
243 4 10 if $type eq 'doctype'
246 4 6 if $type eq 'comment'
249 3 3 if $type eq 'cdata'
252 3 0 if $type eq 'pi'
262 1253 368 if (not $xml and $$current->[0] ne 'root')
263 377 876 if (my $end = $END{$start}) { }
507 369 elsif (my $close = $CLOSE{$start}) { }
271 45 320 if $$allowed{$parent->[1]}
287 354 326 ref $_[-1] eq 'CODE' ? :
680 299 if @_ % 2
292 974 5 unless exists $attrs->{'data'} and ref $attrs->{'data'} eq 'HASH'