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 709 761 if not $name =~ /$name_re/u or not defined $value and defined $value_re
52 474 287 if not defined $value && defined $value_re or $value =~ /$value_re/u
62 5 9119 unless my $c = $selectors->[$pos]
63 9116 3 if (ref $c)
64 5617 3499 unless _selector($c, $current, $tree, $scope)
65 1841 1658 unless $c = $$selectors[++$pos]
69 1024 637 if $c eq ">"
72 65 572 if $c eq "~"
75 67 505 if $c eq "+"
86 2060 2444 unless @$selectors and ref $selectors->[-1]
90 14 4490 if ($css =~ /\G\s*,\s*/cgu) { }
742 3748 elsif ($css =~ /\G\s*([ >+~])\s*/cgu) { }
188 3560 elsif ($css =~ /\G([.#])((?:$ESCAPE_RE\s|\\.|[^,.#:[ >~+])+)/cgou) { }
283 3277 elsif ($css =~ /\G$ATTR_RE/cgou) { }
302 2975 elsif ($css =~ /\G:([\w\-]+)(?:\(((?:\([^)]+\)|[^)])+)\))?/cgsu) { }
1672 1303 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 1603 (my $name = $1) =~ s/^([^|]*)\|//u && $1 ne '*' ? :
129 65 1607 length $alias ? :
130 23 1648 $name eq '*' ? :
133 2 1301 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 2165 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 1186 if grep {_is_scoped($_);} @$group
271 1184 49 $tree->[0] eq 'root' ? :
273 10362 6996 unless $current->[0] eq "tag"
276 5239 1757 unless _match($group, $current, $tree, $scope)
277 703 1054 $one ? :
280 87 443 $one ? :
292 6989 3366 if ($is_tag and $type eq 'tag') { }
1458 1908 elsif ($is_tag and $type eq 'attr') { }
1793 115 elsif ($type eq 'pc') { }
293 3443 3546 if defined $s->[1] and not $current->[1] =~ /$s->[1]/u
294 18 3528 if defined $s->[2] and not _namespace($s->[2], $current)
298 984 474 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 1603 2610 unless defined(my $value = shift())
354 48 423 unless defined $value
355 10 413 $insensitive ? :
358 99 324 if $op eq "~"
361 10 314 if $op eq "|"
364 12 302 if $op eq "*"
367 32 270 if $op eq "^"
370 31 239 if $op eq "\$"