X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FSelectorParser.pm;h=ef61d93e349449a692fefebaa395c870cd7817f6;hp=be081756f17d1bf1da1190e6940ca99af7924917;hb=24725e7b32b680b376c06b1f9d641ec11fc1d067;hpb=8c9ef555e2320515b20ac191100c9b13fc0863ee diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index be08175..ef61d93 100644 --- a/lib/HTML/Zoom/SelectorParser.pm +++ b/lib/HTML/Zoom/SelectorParser.pm @@ -103,6 +103,17 @@ sub _raw_parse_simple_selector { } }; + # '[attr!=bar]' - attributes doesn't match + /\G\[$sel_re!=$match_value_re\]/gc and + return do { + my $attribute = $1; + my $value = $2; + sub { + ! ($_[0]->{attrs}{$attribute} + && $_[0]->{attrs}{$attribute} eq $value); + } + }; + # '[attr]' - match attribute being present: /\G\[$sel_re\]/gc and return do {