Branch Coverage

blib/lib/Mojo/DOM58/_CSS.pm
Criterion Covered Total %
branch 191 194 98.4


line true false branch
30 1118 0 @_ > 1 ? :
1118 0 @_ ? :
35 1118 0 unless @_
42 1 43 $tree->[0] ne 'tag' ? :
48 47 3 _is_scoped($_) ? :
54 1194 393 if _combinator($selectors, $current, $tree, $scope, $pos)
55 124 269 if $current eq $scope
56 157 112 if $one
68 356 669 if not $name =~ /$name_re/ or not defined $value and defined $value_re
69 410 259 if not defined $value && defined $value_re or $value =~ /$value_re/
79 5 8603 unless my $c = $selectors->[$pos]
80 8600 3 if (ref $c)
81 5272 3328 unless _selector($c, $current, $tree, $scope)
82 1709 1619 unless $c = $$selectors[++$pos]
86 986 636 if $c eq ">"
89 65 571 if $c eq "~"
92 66 505 if $c eq "+"
105 1894 2232 unless @$selectors and ref $selectors->[-1]
109 14 4112 if ($css =~ /\G\s*,\s*/cg) { }
708 3404 elsif ($css =~ /\G\s*([ >+~])\s*/cg) { }
149 3255 elsif ($css =~ /\G([.#])((?:$ESCAPE_RE\s|\\.|[^,.#:[ >~+])+)/cog) { }
254 3001 elsif ($css =~ /\G$ATTR_RE/cog) { }
298 2703 elsif ($css =~ /\G:([\w\-]+)(?:\(((?:\([^)]+\)|[^)])+)\))?/cgs) { }
1532 1171 elsif ($css =~ /\G((?:$ESCAPE_RE\s|\\.|[^,.#:[ >~+])+)/cog) { }
113 11 697 unless @$last
119 46 103 $1 eq '.' ? :
125 108 146 defined $2 ? :
2 141 defined $4 ? :
111 143 defined $3 ? :
140 6 15 $args =~ m[^/(.+)/$] ? :
21 277 if $name eq "text"
143 49 243 if $name eq "has" or $name eq "is" or $name eq "not"
146 117 181 if $name =~ /^nth-/
149 24 274 if $name =~ /^(?:first-(.+)|(last-.+))$/
156 69 1463 (my $name = $1) =~ s/^([^|]*)\|// && $1 ne '*' ? :
157 1 68 if defined $alias and length $alias and not defined $ns{$alias}
158 64 1467 defined $alias && length $alias ? :
159 23 1508 $name eq '*' ? :
162 2 1169 pos $css < length $css ? :
172 2 115 unless my $equation = shift()
175 9 106 if $equation =~ /^\s*even\s*$/i
178 12 94 if $equation =~ /^\s*odd\s*$/i
181 42 52 if $equation =~ /^\s*((?:\+|-)?\d+)\s*$/
184 1 51 unless $equation =~ /^\s*((?:\+|-)?(?:\d+)?)?n\s*((?:\+|-)\s*\d+)?\s*$/i
186 6 27 !length($1) ? :
18 33 $1 eq '-' ? :
192 1999 771 ref $_ ? :
195 94 273 if $pc->[1] eq "scope"
198 10 263 if $pc->[1] eq 'has' || $pc->[1] eq 'is' || $pc->[1] eq 'not' and grep {_is_scoped($_);} @{$$pc[2];}
215 4 73 $current->[1] =~ /^([^:]+):/ ? :
217 4 117 if $current->[0] eq "root"
218 73 44 if exists $current->[2]{$attr}
231 122 1669 if $class eq "scope"
232 5 1664 if $current->[0] eq "root"
236 204 1460 if $class eq "checked"
239 179 1281 if $class eq "not"
242 13 1268 if $class eq "is"
245 29 1239 if $class eq "has"
248 28 1211 if $class eq "empty"
251 52 1159 if $class eq "root"
254 156 76 if $_->[0] eq "text" or $_->[0] eq "raw"
80 1079 if $class eq "text"
258 26 1040 if ($class eq "any-link" or $class eq "link" or $class eq "visited")
259 18 21 unless $current->[0] eq "tag" and exists $current->[2]{'href'}
264 40 1000 if ($class eq "only-child" or $class eq "only-of-type")
265 20 20 $class eq 'only-of-type' ? :
271 992 8 if (ref $args)
272 73 919 $class eq 'nth-of-type' || $class eq 'nth-last-of-type' ? :
277 992 2656 if $siblings[$i] eq $current
279 343 649 if $class eq "nth-last-child" or $class eq "nth-last-of-type"
283 192 800 if $delta == 0
302 47 1054 if grep {_is_scoped($_);} @$group
305 1052 49 $tree->[0] eq 'root' ? :
307 9869 6519 unless $current->[0] eq "tag"
310 4894 1625 unless _match($group, $current, $tree, $scope)
311 602 1023 $one ? :
314 72 427 $one ? :
326 6640 3140 if ($is_tag and $type eq 'tag') { }
1234 1906 elsif ($is_tag and $type eq 'attr') { }
1791 115 elsif ($type eq 'pc') { }
327 3258 3382 if defined $s->[1] and not $current->[1] =~ /$s->[1]/
328 18 3364 if defined $s->[2] and not _namespace($s->[2], $current)
332 824 410 unless _attr(@$s[1, 2], $current)
335 1057 734 unless _pc(@$s[1, 2], $current, $tree, $scope)
349 101 223 if $sibling eq $current
352 124 99 if ($immediate) { }
355 30 69 if _combinator($selectors, $sibling, $tree, $scope, $pos)
365 208 955 $parent->[0] eq 'root' ? :
367 93 1070 if defined $type
373 1463 2334 unless defined(my $value = shift())
389 48 355 unless defined $value
390 10 345 $insensitive ? :
393 69 286 if $op eq "~"
396 10 276 if $op eq "|"
399 12 264 if $op eq "*"
402 32 232 if $op eq "^"
405 31 201 if $op eq "\$"