Skip to content

Commit

Permalink
:checked and :not are more common
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 17, 2015
1 parent 2339a2e commit 5366665
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -159,19 +159,19 @@ sub _name {qr/(?:^|:)\Q@{[_unescape(shift)]}\E$/}
sub _pc {
my ($class, $args, $current) = @_;

# ":checked"
return exists $current->[2]{checked} || exists $current->[2]{selected}
if $class eq 'checked';

# ":not"
return !_match($args, $current, $current) if $class eq 'not';

# ":empty"
return !grep { !_empty($_) } @$current[4 .. $#$current] if $class eq 'empty';

# ":root"
return $current->[3] && $current->[3][0] eq 'root' if $class eq 'root';

# ":not"
return !_match($args, $current, $current) if $class eq 'not';

# ":checked"
return exists $current->[2]{checked} || exists $current->[2]{selected}
if $class eq 'checked';

# ":nth-*"
if (ref $args) {
my $type = $class =~ /of-type$/ ? $current->[1] : undef;
Expand Down

0 comments on commit 5366665

Please sign in to comment.