X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FSelectorParser.pm;h=007b2501216d1941f70103dd638096516d0a5302;hb=7871f2ffebae6e6cf2028cdca655049e0a034d8c;hp=ed1d586ed9dbdbc30c9ab167bef4d9036c13f1e2;hpb=e32e7b9042cdaf10bded0a43791760617ab45137;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index ed1d586..007b250 100644 --- a/lib/HTML/Zoom/SelectorParser.pm +++ b/lib/HTML/Zoom/SelectorParser.pm @@ -46,6 +46,18 @@ sub _raw_parse_simple_selector { } }; + # 'el.class1' - element + class + + /\G$sel_re\.$sel_re/gc and + return do { + my $cls = $1; + my $name = $2; + sub { + $_[0]->{name} && $_[0]->{name} eq $name and + $_[0]->{attrs}{class} && $_[0]->{attrs}{class} eq $cls + } + }; + confess "Couldn't parse $_ as starting with simple selector"; } } @@ -69,7 +81,7 @@ sub parse_selector { } }; } -} - +} + 1;