Branch Coverage

blib/lib/Mojo/DOM/CSS.pm
Criterion Covered Total %
branch 180 180 100.0


line true false branch
25 1 43 $tree->[0] ne 'tag' ? :
31 47 3 _is_scoped($_) ? :
37 1232 393 if _combinator($selectors, $current, $tree, $scope, $pos)
38 124 269 if $current eq $scope
39 157 112 if $one
51 687 766 if not $name =~ /$name_re/u or not defined $value and defined $value_re
52 476 290 if not defined $value && defined $value_re or $value =~ /$value_re/u
62 5 9140 unless my $c = $selectors->[$pos]
63 9137 3 if (ref $c)
64 5636 3501 unless _selector($c, $current, $tree, $scope)
65 1843 1658 unless $c = $$selectors[++$pos]
69 1024 637 if $c eq ">"
72 65 572 if $c eq "~"
75 67 505 if $c eq "+"
86 2062 2448 unless @$selectors and ref $selectors->[-1]
90 14 4496 if ($css =~ /\G\s*,\s*/cgu) { }
742 3754 elsif ($css =~ /\G\s*([ >+~])\s*/cgu) { }
188 3566 elsif ($css =~ /\G([.#])((?:$ESCAPE_RE\s|\\.|[^,.#:[ >~+])+)/cgou) { }
285 3281 elsif ($css =~ /\G$ATTR_RE/cgou) { }
302 2979 elsif ($css =~ /\G:([\w\-]+)(?:\(((?:\([^)]+\)|[^)])+)\))?/cgsu) { }
1674 1305 elsif ($css =~ /\G((?:$ESCAPE_RE\s|\\.|[^,.#:[ >~+])+)/cgou) { }
94 11 731 unless @$last
100 76 112 $1 eq '.' ? :
112 6 15 $args =~ m[^/(.+)/$]u ? :
21 281 if $name eq "text"
115 49 247 if $name eq "has" or $name eq "is" or $name eq "not"
118 117 185 if $name =~ /^nth-/u
121 24 278 if $name =~ /^(?:first-(.+)|(last-.+))$/u
128 69 1605 (my $name = $1) =~ s/^([^|]*)\|//u && $1 ne '*' ? :
129 65 1609 length $alias ? :
130 23 1650 $name eq '*' ? :
133 2 1303 pos $css < length $css ? :
141 2 115 unless my $equation = shift()
144 9 106 if $equation =~ /^\s*even\s*$/iu
147 12 94 if $equation =~ /^\s*odd\s*$/iu
150 42 52 if $equation =~ /^\s*((?:\+|-)?\d+)\s*$/u
153 1 51 unless $equation =~ /^\s*((?:\+|-)?(?:\d+)?)?n\s*((?:\+|-)\s*\d+)?\s*$/iu
154 6 27 !length($1) ? :
18 33 $1 eq '-' ? :
160 2167 805 ref $_ ? :
163 94 277 if $pc->[1] eq "scope"
166 10 267 if $pc->[1] eq 'has' || $pc->[1] eq 'is' || $pc->[1] eq 'not' and grep {_is_scoped($_);} @{$$pc[2];}
183 4 73 $current->[1] =~ /^([^:]+):/u ? :
185 4 117 if $current->[0] eq "root"
186 73 44 if exists $current->[2]{$attr}
199 122 1671 if $class eq "scope"
200 5 1666 if $current->[0] eq "root"
203 204 1462 if $class eq "checked"
206 179 1283 if $class eq "not"
209 13 1270 if $class eq "is"
212 29 1241 if $class eq "has"
215 28 1213 if $class eq "empty"
218 54 1159 if $class eq "root"
221 156 76 if $_->[0] eq "text" or $_->[0] eq "raw"
80 1079 if $class eq "text"
225 26 1040 if ($class eq "any-link" or $class eq "link" or $class eq "visited")
226 18 21 unless $current->[0] eq "tag" and exists $current->[2]{'href'}
231 40 1000 if ($class eq "only-child" or $class eq "only-of-type")
232 20 20 $class eq 'only-of-type' ? :
238 992 8 if (ref $args)
239 73 919 $class eq 'nth-of-type' || $class eq 'nth-last-of-type' ? :
243 992 2656 if $siblings[$i] eq $current
245 343 649 if $class eq "nth-last-child" or $class eq "nth-last-of-type"
249 192 800 if $delta == 0
268 47 1188 if grep {_is_scoped($_);} @$group
271 1186 49 $tree->[0] eq 'root' ? :
273 10397 7017 unless $current->[0] eq "tag"
276 5258 1759 unless _match($group, $current, $tree, $scope)
277 705 1054 $one ? :
280 87 443 $one ? :
292 7009 3372 if ($is_tag and $type eq 'tag') { }
1464 1908 elsif ($is_tag and $type eq 'attr') { }
1793 115 elsif ($type eq 'pc') { }
293 3458 3551 if defined $s->[1] and not $current->[1] =~ /$s->[1]/u
294 18 3533 if defined $s->[2] and not _namespace($s->[2], $current)
298 988 476 unless _attr(@$s[1, 2], $current)
301 1057 736 unless _pc(@$s[1, 2], $current, $tree, $scope)
315 102 224 if $sibling eq $current
318 125 99 if ($immediate) { }
321 30 69 if _combinator($selectors, $sibling, $tree, $scope, $pos)
331 208 956 $parent->[0] eq 'root' ? :
332 93 1071 if defined $type
338 1605 2616 unless defined(my $value = shift())
354 48 425 unless defined $value
355 10 415 $insensitive ? :
358 99 326 if $op eq "~"
361 10 316 if $op eq "|"
364 12 304 if $op eq "*"
367 32 272 if $op eq "^"
370 31 241 if $op eq "\$"