Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-HTML-Selector-XPath for 
openSUSE:Factory checked in at 2023-08-08 17:26:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-HTML-Selector-XPath (Old)
 and      /work/SRC/openSUSE:Factory/.perl-HTML-Selector-XPath.new.22712 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-HTML-Selector-XPath"

Tue Aug  8 17:26:52 2023 rev:3 rq:1102956 version:0.280.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-HTML-Selector-XPath/perl-HTML-Selector-XPath.changes
        2022-01-04 19:38:31.446011262 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-HTML-Selector-XPath.new.22712/perl-HTML-Selector-XPath.changes
     2023-08-08 17:26:55.963546354 +0200
@@ -1,0 +2,6 @@
+Tue Aug  8 03:07:22 UTC 2023 - Tina Müller <[email protected]>
+
+- updated to 0.28
+   see /usr/share/doc/packages/perl-HTML-Selector-XPath/Changes
+
+-------------------------------------------------------------------

Old:
----
  HTML-Selector-XPath-0.26.tar.gz

New:
----
  HTML-Selector-XPath-0.28.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-HTML-Selector-XPath.spec ++++++
--- /var/tmp/diff_new_pack.UBqPdl/_old  2023-08-08 17:26:56.863551947 +0200
+++ /var/tmp/diff_new_pack.UBqPdl/_new  2023-08-08 17:26:56.867551972 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-HTML-Selector-XPath
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,17 +18,20 @@
 
 %define cpan_name HTML-Selector-XPath
 Name:           perl-HTML-Selector-XPath
-Version:        0.26
+Version:        0.280.0
 Release:        0
-Summary:        CSS Selector to XPath compiler
+%define cpan_version 0.28
 License:        Artistic-1.0 OR GPL-1.0-or-later
+Summary:        CSS Selector to XPath compiler
 URL:            https://metacpan.org/release/%{cpan_name}
-Source0:        
https://cpan.metacpan.org/authors/id/C/CO/CORION/%{cpan_name}-%{version}.tar.gz
+Source0:        
https://cpan.metacpan.org/authors/id/C/CO/CORION/%{cpan_name}-%{cpan_version}.tar.gz
 Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl-macros
 BuildRequires:  perl(Test::Base)
+Provides:       perl(HTML::Selector::XPath) = 0.280.0
+%define         __perllib_provides /bin/true
 %{perl_requires}
 
 %description
@@ -36,7 +39,7 @@
 partial CSS3 selectors to the equivalent XPath expression.
 
 %prep
-%autosetup  -n %{cpan_name}-%{version}
+%autosetup  -n %{cpan_name}-%{cpan_version}
 
 %build
 PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor

++++++ HTML-Selector-XPath-0.26.tar.gz -> HTML-Selector-XPath-0.28.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/Changes 
new/HTML-Selector-XPath-0.28/Changes
--- old/HTML-Selector-XPath-0.26/Changes        2021-12-15 18:23:43.000000000 
+0100
+++ new/HTML-Selector-XPath-0.28/Changes        2023-08-07 12:38:56.000000000 
+0200
@@ -1,6 +1,14 @@
 Revision history for Perl extension HTML::Selector::XPath
 
-0.27 NEXT
+0.29 NEXT
+
+0.28 2023-08-07
+    * Restore Perl 5.8 compatibility
+
+0.27 2023-08-06
+    * Allow for more whitespace in An+B formulae and in parentheses
+    * Support :nth-child(n-3) to select the first three elements
+    * Fix handling of :nth-of-type to actually respect the type
 
 0.26 2021-12-15
     * Fix typo in documentation for selector_to_xpath.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/META.json 
new/HTML-Selector-XPath-0.28/META.json
--- old/HTML-Selector-XPath-0.26/META.json      2021-12-15 18:23:49.000000000 
+0100
+++ new/HTML-Selector-XPath-0.28/META.json      2023-08-07 12:39:02.000000000 
+0200
@@ -57,7 +57,7 @@
          "web" : "https://github.com/Corion/HTML-Selector-XPath";
       }
    },
-   "version" : "0.26",
-   "x_serialization_backend" : "JSON::PP version 4.04",
+   "version" : "0.28",
+   "x_serialization_backend" : "JSON::PP version 4.11",
    "x_static_install" : 1
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/META.yml 
new/HTML-Selector-XPath-0.28/META.yml
--- old/HTML-Selector-XPath-0.26/META.yml       2021-12-15 18:23:49.000000000 
+0100
+++ new/HTML-Selector-XPath-0.28/META.yml       2023-08-07 12:39:01.000000000 
+0200
@@ -28,6 +28,6 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/Corion/HTML-Selector-XPath.git
-version: '0.26'
+version: '0.28'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
 x_static_install: 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/lib/HTML/Selector/XPath.pm 
new/HTML-Selector-XPath-0.28/lib/HTML/Selector/XPath.pm
--- old/HTML-Selector-XPath-0.26/lib/HTML/Selector/XPath.pm     2021-12-15 
18:23:43.000000000 +0100
+++ new/HTML-Selector-XPath-0.28/lib/HTML/Selector/XPath.pm     2023-08-07 
12:38:56.000000000 +0200
@@ -2,7 +2,7 @@
 
 use strict;
 use 5.008_001;
-our $VERSION = '0.26';
+our $VERSION = '0.28';
 
 require Exporter;
 our @EXPORT_OK = qw(selector_to_xpath);
@@ -29,7 +29,7 @@
         (?: ($ident) | "([^"]*)" | '([^']*)') \s* \] /x,
     badattr => qr/^\[/,
     attrN   => qr/^:not\(/i, # we chop off the closing parenthesis below in 
the code
-    pseudo  => qr/^:([()a-z0-9_+-]+)/i,
+    pseudo  => qr/^:([-\w]+\(?)/i,
     # adjacency/direct descendance
     combinator => qr/^(\s*[>+~\s](?!,))/i,
     # rule separator
@@ -69,15 +69,15 @@
 }
 
 sub _generate_child {
-    my ($direction,$a,$b) = @_;
+    my ($direction,$name,$a,$b) = @_;
     if ($a == 0) { # 0n+b
         $b--;
-        "[count($direction-sibling::*) = $b and parent::*]"
+        "[count($direction-sibling::$name) = $b and parent::*]"
     } elsif ($a > 0) { # an + b
-        return "[not((count($direction-sibling::*)+1)<$b) and 
((count($direction-sibling::*) + 1) - $b) mod $a = 0 and parent::*]"
+        return "[not((count($direction-sibling::$name)+1)<$b) and 
((count($direction-sibling::$name) + 1) - $b) mod $a = 0 and parent::*]"
     } else { # -an + $b
         $a = -$a;
-        return "[not((count($direction-sibling::*)+1)>$b) and (($b - 
(count($direction-sibling::*) + 1)) mod $a) = 0 and parent::*]"
+        return "[not((count($direction-sibling::$name)+1)>$b) and (($b - 
(count($direction-sibling::$name) + 1)) mod $a) = 0 and parent::*]"
     }
 }
 
@@ -86,7 +86,7 @@
     if (@_ == 1) {
         ($a,$b) = (0,$a);
     }
-    _generate_child('preceding', $a, $b);
+    _generate_child('preceding', '*', $a, $b);
 }
 
 sub nth_last_child {
@@ -94,11 +94,38 @@
     if (@_ == 1) {
         ($a,$b) = (0,$a);
     }
-    _generate_child('following', $a, $b);
+    _generate_child('following', '*', $a, $b);
 }
 
 # A hacky recursive descent
 # Only descends for :not(...)
+sub consume_An_plus_B {
+    my( $rrule ) = @_;
+
+    my( $A, $B );
+
+    if( $$rrule =~ s/^odd\s*\)// ) {
+        ($A,$B) = (2, 1)
+    } elsif( $$rrule =~ s/^even\s*\)// ) {
+        ($A,$B) = (2, 0)
+    } elsif( $$rrule =~ s/^\s*(-?\d+)\s*\)// ) {
+        ($A,$B) = (0, $1)
+    } elsif( $$rrule =~ s/^\s*(-?\d*)\s*n\s*(?:\+\s*(\d+))?\s*\)// ) {
+        ($A,$B) = ($1, $2 || 0);
+        if( ! defined $A ) {
+            $A = '0';
+        } elsif( $A eq '-') {
+            $A = '-1';
+        } elsif( $A eq '' ) {
+            $A = '1';
+        }
+    } else {
+        croak "Can't parse formula from '$$rrule'";
+    }
+
+    return ($A, $B);
+}
+
 sub consume {
     my ($self, $rule, %parms) = @_;
     my $root = $parms{root} || '/';
@@ -206,26 +233,30 @@
                 push @parts, nth_last_child(1);
             } elsif ( $1 eq 'only-child') {
                 push @parts, nth_child(1), nth_last_child(1);
-            } elsif ($1 =~ /^lang\(([\w\-]+)\)$/) {
+            } elsif ($1 =~ /^lang\($/) {
+                $rule =~ s/\s*([\w\-]+)\s*\)//
+                    or Carp::croak "Can't parse language part from $rule";
                 push @parts, "[\@xml:lang='$1' or starts-with(\@xml:lang, 
'$1-')]";
-            } elsif ($1 =~ /^nth-child\(odd\)$/) {
-                push @parts, nth_child(2, 1);
-            } elsif ($1 =~ /^nth-child\(even\)$/) {
-                push @parts, nth_child(2, 0);
-            } elsif ($1 =~ /^nth-child\((\d+)\)$/) {
-                push @parts, nth_child($1);
-            } elsif ($1 =~ /^nth-child\((\d+)n(?:\+(\d+))?\)$/) {
-                push @parts, nth_child($1, $2||0);
-            } elsif ($1 =~ /^nth-last-child\((\d+)\)$/) {
-                push @parts, nth_last_child($1);
-            } elsif ($1 =~ /^nth-last-child\((\d+)n(?:\+(\d+))?\)$/) {
-                push @parts, nth_last_child($1, $2||0);
-            } elsif ($1 =~ /^first-of-type$/) {
-                push @parts, "[1]";
-            } elsif ($1 =~ /^nth-of-type\((\d+)\)$/) {
-                push @parts, "[$1]";
+            } elsif ($1 =~ /^nth-child\(\s*$/) {
+                my( $A, $B ) = consume_An_plus_B(\$rule);
+                push @parts, nth_child($A, $B);
+            } elsif ($1 =~ /^nth-last-child\(\s*$/) {
+                my( $A, $B ) = consume_An_plus_B(\$rule);
+                push @parts, nth_last_child($A, $B);
+            } elsif ($1 =~ /^first-of-type\s*$/) {
+                my $type = $parts[-1];
+                push @parts, _generate_child('preceding', $type, 0, 1);
+
+            } elsif ($1 =~ /^nth-of-type\(\s*$/) {
+                my( $A, $B ) = consume_An_plus_B(\$rule);
+                my $type = $parts[-1];
+                push @parts, _generate_child('preceding', $type, $A, $B);
+
             } elsif ($1 =~ /^last-of-type$/) {
                 push @parts, "[last()]";
+
+            # Err?! This one does not really exist in the CSS spec...
+            # Why did I add this?
             } elsif ($1 =~ /^contains\($/) {
                 if( $rule =~ s/^\s*"([^"]*)"\s*\)// ) {
                     push @parts, qq{[text()[contains(string(.),"$1")]]};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/t/01_xpath.t 
new/HTML-Selector-XPath-0.28/t/01_xpath.t
--- old/HTML-Selector-XPath-0.26/t/01_xpath.t   2021-12-15 18:23:43.000000000 
+0100
+++ new/HTML-Selector-XPath-0.28/t/01_xpath.t   2023-08-07 12:38:56.000000000 
+0200
@@ -261,7 +261,7 @@
 --- selector
 F > E:nth-of-type(3)
 --- xpath
-//F/E[3]
+//F/E[count(preceding-sibling::E) = 2 and parent::*]
 
 ===
 --- selector
@@ -490,7 +490,7 @@
 --- xpath
 //*[contains(concat(' ', normalize-space(@class), ' '), ' warning ')]
 
- 
+
 ===
 --- selector
 :nth-child(1)
@@ -520,6 +520,7 @@
 E:nth-child(even)
 --- xpath
 //E[not((count(preceding-sibling::*)+1)<0) and ((count(preceding-sibling::*) + 
1) - 0) mod 2 = 0 and parent::*]
+
 ===
 --- selector
 E:nth-child(odd)
@@ -531,6 +532,7 @@
 E:nth-child(2n)
 --- xpath
 //E[not((count(preceding-sibling::*)+1)<0) and ((count(preceding-sibling::*) + 
1) - 0) mod 2 = 0 and parent::*]
+
 ===
 --- selector
 E:nth-child(2n+1)
@@ -539,6 +541,18 @@
 
 ===
 --- selector
+E:nth-child(-n+3)
+--- xpath
+//E[not((count(preceding-sibling::*)+1)>3) and ((3 - 
(count(preceding-sibling::*) + 1)) mod 1) = 0 and parent::*]
+
+===
+--- selector
+E:nth-child(2n + 1)
+--- xpath
+//E[not((count(preceding-sibling::*)+1)<1) and ((count(preceding-sibling::*) + 
1) - 1) mod 2 = 0 and parent::*]
+
+===
+--- selector
 :root
 --- xpath
 /*
@@ -626,7 +640,7 @@
 ===
 --- selector
 tr[class!="wantedClass"]
-  
+
 --- xpath
 //tr[@class!='wantedClass']
 ===
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTML-Selector-XPath-0.26/t/02_html.t 
new/HTML-Selector-XPath-0.28/t/02_html.t
--- old/HTML-Selector-XPath-0.26/t/02_html.t    2021-12-15 18:23:43.000000000 
+0100
+++ new/HTML-Selector-XPath-0.28/t/02_html.t    2023-08-07 12:38:56.000000000 
+0200
@@ -2,38 +2,109 @@
 use Test::Base;
 use HTML::Selector::XPath;
 use Encode qw(decode);
+use Data::Dumper;
 
-if( ! eval { require HTML::TreeBuilder::XPath; 1 }) {
-    plan skip_all => "HTML::TreeBuilder::XPath is not installed.";
+
+my $have_treebuilder = eval {
+    require HTML::TreeBuilder::XPath;
+    diag "Using HTML::TreeBuilder::XPath $HTML::TreeBuilder::XPath::VERSION";
+    1
+};
+
+my $have_libxml = eval {
+    require XML::LibXML;
+    diag "Using XML::LibXML $XML::LibXML::VERSION";
+    1
 };
 
 filters { selector => 'chomp', expected => [ 'lines', 'array' ] };
-plan tests => 1 * blocks;
+plan tests => 4 * blocks;
 
 binmode STDOUT, ':encoding(UTF-8)'; # because our test names contain UTF-8
 binmode STDERR, ':encoding(UTF-8)'; # because our test names contain UTF-8
 # But it seems that Test::More or Test::Base or whoever mess with STDOUT/STDERR
 # on their own.
 
+sub normalize_node {
+    my( $node ) = @_;
+    $node =~ s!\s+$!!;
+
+    # LibXML gives us minimal nodes but TreeBuilder wants expanded nodes
+    $node =~ s!^<(\w+)(.*?)/>!<$1$2></$1>!;
+
+    return $node
+}
+
 run {
     my $block = shift;
-    my $tree = HTML::TreeBuilder::XPath->new;
-    my $input= decode( 'UTF-8', $block->input);
-    $tree->parse($input);
-    $tree->eof;
+    my $input= $block->input;
 
     my $sel= decode( 'UTF-8', scalar $block->selector );
     my $expr;
     if ($block->selector =~ m!^/!) {
         $expr = $sel;
     } else {
-        $expr = HTML::Selector::XPath->new($sel)->to_xpath
+        $expr = HTML::Selector::XPath->new($sel)->to_xpath;
+        $expr =  $expr;
     };
-    my @nodes = $tree->findnodes( $expr );
-    my $expected= [ map { decode( 'UTF-8', $_ )} @{ $block->expected } ];
-    my $got= [ map $_->as_XML, @nodes ];
-    is_deeply $got, $expected,
-        $sel . " -> $expr";
+
+    my $expected= [ map { my $s = decode( 'UTF-8', $_ ); $s =~ s!\s+$!!s; $s } 
@{ $block->expected } ];
+
+    # Check with XML::LibXML, if we have it
+    if( $have_libxml ) {
+        my $parser = XML::LibXML->new();
+        my $dom = $parser->parse_html_string( $input, { recover => 2, encoding 
=> 'UTF-8' });
+
+        my @nodes;
+        my $ok = eval { @nodes = $dom->findnodes( $expr ); 1 };
+        my $err = $@;
+        SKIP: {
+            if( ! ok $ok, "LibXML can parse '$expr'" ) {
+                diag "Error: '$err'";
+                skip "XPath parse error", 1;
+            }
+
+            my $got= [ map { normalize_node($_->toString) } @nodes ];
+
+            is_deeply $got, $expected,
+                $sel . " -> $expr (LibXML)"
+                or diag Dumper [
+                    'Document', $dom->toString,
+                    'expected',$expected,
+                    'got', $got,
+                ];
+        }
+    } else {
+        SKIP: {
+            skip "XML::LibXML not loaded", 2;
+        }
+    }
+
+    # Check with HTML::TreeBuilder::XPath, if we have it
+    if( $have_treebuilder ) {
+        my $tree = HTML::TreeBuilder::XPath->new;
+        $tree->parse(decode('UTF-8', $input));
+        $tree->eof;
+
+        my @nodes = ();
+        my $ok = eval { @nodes = $tree->findnodes( $expr ); 1 };
+        my $err = $@;
+        SKIP: {
+            if( ! ok $ok, "TreeBuilder can parse '$expr'" ) {
+                diag "Error: '$err'";
+                skip "XPath parse error", 1;
+            }
+
+            my $got= [ map { normalize_node($_->toString) } @nodes ];
+            is_deeply $got, $expected,
+                $sel . " -> $expr (TreeBuilder)"
+                or diag Dumper $got;
+        }
+    } else {
+        SKIP: {
+            skip "HTML::TreeBuilder not loaded", 2;
+        }
+    }
 }
 
 __END__
@@ -212,7 +283,8 @@
 
 ===
 --- input
-<p>
+<span>
+<p>First stuff that is not a link</p>
 <a href="no">No</a>
 <div>Some description</div>
 <a href="foobar">Foobar</a>
@@ -220,11 +292,79 @@
 <a href="barred">Barred</a>
 <div>Some description</div>
 <a href="bar">bar</a>
-</p>
+</span>
+--- selector
+span > a:first-of-type
+--- expected
+<a href="no">No</a>
+
+===
+--- input
+<span>
+<p>First stuff that is not a link</p>
+<a href="no">No</a>
+<div>Some description</div>
+<a href="foobar">Foobar</a>
+<div>Some description</div>
+<a href="barred">Barred</a>
+<div>Some description</div>
+<a href="bar">bar</a>
+<b>More stuff that is not a link</b>
+</span>
+--- selector
+span > a:last-of-type
+--- expected
+<a href="bar">bar</a>
+
+===
+--- input
+<span>
+<a href="no">No</a>
+<div>Some description</div>
+<a href="foobar">Foobar</a>
+<div>Some description</div>
+<a href="barred">Barred</a>
+<div>Some description</div>
+<a href="bar">bar</a>
+</span>
+--- selector
+span > a:nth-of-type(3)
+--- expected
+<a href="barred">Barred</a>
+
+===
+--- input
+<span>
+<a href="no">No</a>
+<div>Some description</div>
+<a href="foobar">Foobar</a>
+<div>Some description</div>
+<a href="barred">Barred</a>
+<div>Some description</div>
+<a href="bar">bar</a>
+</span>
 --- selector
-p > a:nth-of-type(3)
+span > a:nth-of-type(n+3)
 --- expected
 <a href="barred">Barred</a>
+<a href="bar">bar</a>
+
+===
+--- input
+<span>
+<a href="no">No</a>
+<div>Some description</div>
+<a href="foobar">Foobar</a>
+<div>Some description</div>
+<a href="barred">Barred</a>
+<div>Some description</div>
+<a href="bar">bar</a>
+</span>
+--- selector
+span > a:nth-of-type(2n)
+--- expected
+<a href="foobar">Foobar</a>
+<a href="bar">bar</a>
 
 ===
 --- input
@@ -267,20 +407,21 @@
 <a class="foo" href="Yes">Yes</a>
 <div>Some description</div>
 <p>
-<div>Another <b>two level deep description</b></div>
+<span>Another <b>two level deep description</b></span>
 </p>
 <a href="foobar">Foobar</a>
 <a href="barred">Barred</a>
 <p>
 <a class="foo" href="No">No (child, not sibling)</a>
-<div>But some description</p>
+<span>But some description</span>
+</p>
 </p>
 <div>Some description that is not output</div>
 --- selector
 p *:contains("description")
 --- expected
 <b>two level deep description</b>
-<div>But some description</div>
+<span>But some description</span>
 
 ===
 --- input
@@ -292,14 +433,14 @@
 <a href="foobar">Foobar</a>
 <a href="barred">Barred</a>
 <p>
-<div>Some more description</div>
+<span>Some more description</span>
 <a class="foo" href="No">No (child, not sibling)</a>
 </p>
 <div>Some description that is not output</div>
 --- selector
 p > *:contains("description")
 --- expected
-<div>Some more description</div>
+<span>Some more description</span>
 ===
 --- input
 <a href="No">No (no preceding sibling)</a>
@@ -321,10 +462,13 @@
 <div>Some more description</div>
 ===
 --- input
+<head></head>
+<body>
 <div>Some description</div>
 <div id="empty"></div>
 <div>Another <b>two level deep description</b></div>
 <div>Some more description</div>
+</body>
 --- selector
 :empty
 --- expected
@@ -403,6 +547,38 @@
     <em>everywhere</em>
     <em>elsewhere</em>
     <em>nowhere</em>
+</div>
+</body></html>
+--- selector
+div em:nth-child(-n+2)
+--- expected
+<em>here</em>
+<em>there</em>
+===
+--- input
+<html><head></head><body>
+<div>
+    <em>here</em>
+    <em>there</em>
+    <em>everywhere</em>
+    <em>elsewhere</em>
+    <em>nowhere</em>
+</div>
+</body></html>
+--- selector
+div em:nth-child(-2n + 3)
+--- expected
+<em>here</em>
+<em>everywhere</em>
+===
+--- input
+<html><head></head><body>
+<div>
+    <em>here</em>
+    <em>there</em>
+    <em>everywhere</em>
+    <em>elsewhere</em>
+    <em>nowhere</em>
     <em>anywhere</em>
 </div>
 </body></html>
@@ -430,6 +606,39 @@
 <em>everywhere</em>
 <em>nowhere</em>
 ===
+--- input
+<html><head></head><body>
+<div>
+    <em>here</em>
+    <em>there</em>
+    <em>everywhere</em>
+    <em>elsewhere</em>
+    <em>nowhere</em>
+</div>
+</body></html>
+--- selector
+div em:nth-last-child(-n + 3)
+--- expected
+<em>everywhere</em>
+<em>elsewhere</em>
+<em>nowhere</em>
+===
+--- input
+<html><head></head><body>
+<div>
+    <em>here</em>
+    <em>there</em>
+    <em>everywhere</em>
+    <em>elsewhere</em>
+    <em>nowhere</em>
+</div>
+</body></html>
+--- selector
+div em:nth-last-child(-2n + 3)
+--- expected
+<em>everywhere</em>
+<em>nowhere</em>
+===
 --- input
 <body>
 <div class="小飼弾">小飼弾</div>

Reply via email to