<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[175848] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/175848">175848</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-10 19:49:08 -0800 (Mon, 10 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore:
Add parsing support for the extended :nth-last-child(An+B of selector-list) defined
https://bugs.webkit.org/show_bug.cgi?id=138520

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-11-10
Reviewed by Andreas Kling.

Add parsing for :nth-last-child(An+B of selector-list). The selector is defined
in CSS Selectors Level 4: http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo

Tests: fast/css/parsing-css-nth-last-child-of-1.html
       fast/css/parsing-css-nth-last-child-of-2.html
       fast/css/parsing-css-nth-last-child-of-3.html
       fast/css/parsing-css-nth-last-child-of-4.html

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):

LayoutTests:
Add parsing support for the extended :nth-last-child(An+B of selector-list)
https://bugs.webkit.org/show_bug.cgi?id=138520

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-11-10
Reviewed by Andreas Kling.

All the tests are variations of the existing tests for :nth-child(An+B of selector-list).

* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/parsing-css-nth-last-child-of-1-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-1.html: Added.
* fast/css/parsing-css-nth-last-child-of-2-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-2.html: Added.
* fast/css/parsing-css-nth-last-child-of-3-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-3.html: Added.
* fast/css/parsing-css-nth-last-child-of-4-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-4.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortexthtml">trunk/LayoutTests/fast/css/css-selector-text.html</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortexthtml">trunk/LayoutTests/fast/css/css-set-selector-text.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof1expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof1html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof2expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof2html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof3expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof3html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof4expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof4html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/ChangeLog        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-11-10  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        Add parsing support for the extended :nth-last-child(An+B of selector-list)
+        https://bugs.webkit.org/show_bug.cgi?id=138520
+
+        Reviewed by Andreas Kling.
+
+        All the tests are variations of the existing tests for :nth-child(An+B of selector-list).
+
+        * fast/css/css-selector-text-expected.txt:
+        * fast/css/css-selector-text.html:
+        * fast/css/css-set-selector-text-expected.txt:
+        * fast/css/css-set-selector-text.html:
+        * fast/css/parsing-css-nth-last-child-of-1-expected.txt: Added.
+        * fast/css/parsing-css-nth-last-child-of-1.html: Added.
+        * fast/css/parsing-css-nth-last-child-of-2-expected.txt: Added.
+        * fast/css/parsing-css-nth-last-child-of-2.html: Added.
+        * fast/css/parsing-css-nth-last-child-of-3-expected.txt: Added.
+        * fast/css/parsing-css-nth-last-child-of-3.html: Added.
+        * fast/css/parsing-css-nth-last-child-of-4-expected.txt: Added.
+        * fast/css/parsing-css-nth-last-child-of-4.html: Added.
+
</ins><span class="cx"> 2014-11-10  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SVG foreign objects do not inherit the container coordinates system if they are repainted..
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -90,6 +90,17 @@
</span><span class="cx"> PASS parseThenSerializeRule(':nth-child(5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(5n-7 of .foo, :nth-child(odd)) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':nth-child(-5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(-5n-7 of .foo, :nth-child(odd)) { }'
</span><span class="cx"> 
</span><ins>+PASS parseThenSerializeRule(':nth-last-child(odd of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(odd of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(even of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(even of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(n of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(n of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-n of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-n of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5n+7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5n+7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5n+7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5n+7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5n-7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5n-7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5n-7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5n-7 of .foo, :nth-last-child(odd)) { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule(':matches(single) { }') is ':matches(single) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':matches(a, b, p) { }') is ':matches(a, b, p) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':matches(#alice, #bob, #chris) { }') is ':matches(#alice, #bob, #chris) { }'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -135,6 +135,19 @@
</span><span class="cx"> 
</span><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+testSelectorRoundTrip(&quot;:nth-last-child(odd of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(even of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(n of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-n of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5n+7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5n+7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5n-7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5n-7 of .foo, :nth-last-child(odd))&quot;);
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip(':matches(single)');
</span><span class="cx"> testSelectorRoundTrip(':matches(a, b, p)');
</span><span class="cx"> testSelectorRoundTrip(':matches(#alice, #bob, #chris)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -100,6 +100,17 @@
</span><span class="cx"> PASS setThenReadSelectorText(':nth-child(5n-7 of .foo, :nth-child(odd))') is ':nth-child(5n-7 of .foo, :nth-child(odd))'
</span><span class="cx"> PASS setThenReadSelectorText(':nth-child(-5n-7 of .foo, :nth-child(odd))') is ':nth-child(-5n-7 of .foo, :nth-child(odd))'
</span><span class="cx"> 
</span><ins>+PASS setThenReadSelectorText(':nth-last-child(odd of .foo, :nth-last-child(odd))') is ':nth-last-child(odd of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(even of .foo, :nth-last-child(odd))') is ':nth-last-child(even of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(n of .foo, :nth-last-child(odd))') is ':nth-last-child(n of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-n of .foo, :nth-last-child(odd))') is ':nth-last-child(-n of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5 of .foo, :nth-last-child(odd))') is ':nth-last-child(5 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5n+7 of .foo, :nth-last-child(odd))') is ':nth-last-child(5n+7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5n+7 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5n+7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5n-7 of .foo, :nth-last-child(odd))') is ':nth-last-child(5n-7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5n-7 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5n-7 of .foo, :nth-last-child(odd))'
+
</ins><span class="cx"> PASS setThenReadSelectorText(':matches(single)') is ':matches(single)'
</span><span class="cx"> PASS setThenReadSelectorText(':matches(a, b, p)') is ':matches(a, b, p)'
</span><span class="cx"> PASS setThenReadSelectorText(':matches(#alice, #bob, #chris)') is ':matches(#alice, #bob, #chris)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text.html (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -148,8 +148,22 @@
</span><span class="cx"> testSelectorRoundTrip(&quot;:nth-child(-5n+7 of .foo, :nth-child(odd))&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:nth-child(5n-7 of .foo, :nth-child(odd))&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:nth-child(-5n-7 of .foo, :nth-child(odd))&quot;);
</span><ins>+
</ins><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+testSelectorRoundTrip(&quot;:nth-last-child(odd of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(even of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(n of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-n of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5n+7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5n+7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(5n-7 of .foo, :nth-last-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-last-child(-5n-7 of .foo, :nth-last-child(odd))&quot;);
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip(':matches(single)');
</span><span class="cx"> testSelectorRoundTrip(':matches(a, b, p)');
</span><span class="cx"> testSelectorRoundTrip(':matches(#alice, #bob, #chris)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,1532 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic valid cases without [of selectors]
+PASS document.querySelector(&quot;:nth-last-child(even)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5)&quot;
+Basic cases with [of selectors]
+PASS document.querySelector(&quot;:nth-last-child(even of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of *)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of *    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of foobar    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of #id)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of #id    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :first-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :first-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :last-child)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :last-child    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of foobar#id.class)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of foobar#id.class    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .class:not(.notclass))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .class:not(.notclass)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of #id:empty)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of #id:empty    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a &gt; b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a &gt; b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a + b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a + b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a + b &gt; c ~ d e + g)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a + b &gt; c ~ d e + g    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, a)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, a    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, b, c, d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a, b, c, d    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .foo, .bar, .baz)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .foo, .bar, .baz    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of a &gt; b, a b, a + b, a ~ b    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style id=&quot;style-container&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testValidSelector(selectorString, expectedSerializedSelector) {
+    shouldNotThrow('document.querySelector(&quot;:nth-last-child(' + selectorString.replace(/\\/g, '\\\\') + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;1&quot;);
+    if (!expectedSerializedSelector)
+        expectedSerializedSelector = selectorString;
+    shouldBeEqualToString(&quot;document.getElementById('style-container').sheet.cssRules[0].selectorText&quot;, ':nth-last-child(' + expectedSerializedSelector + ')');
+    styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+    &quot;even&quot;,
+    &quot;odd&quot;,
+    &quot;n&quot;,
+    &quot;-n&quot;,
+    &quot;3&quot;,
+    &quot;-3&quot;,
+    &quot;n+0&quot;,
+    &quot;n-0&quot;,
+    &quot;0n&quot;,
+    &quot;3n+5&quot;,
+    &quot;-3n+5&quot;,
+    &quot;3n-5&quot;,
+    &quot;-3n-5&quot;,
+];
+
+debug(&quot;Basic valid cases without [of selectors]&quot;);
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i)
+    testValidSelector(validNthAnPlusB[i], validNthAnPlusB[i]);
+
+var validRightSide = [
+    // Basic types.
+    &quot;*&quot;,
+    &quot;foobar&quot;,
+    &quot;#id&quot;,
+    &quot;.class&quot;,
+    &quot;:first-child&quot;,
+    &quot;:last-child&quot;,
+
+    // Compound selectors.
+    &quot;foobar#id.class&quot;,
+    &quot;.class:not(.notclass)&quot;,
+    &quot;#id:empty&quot;,
+
+    // Complex selectors.
+    &quot;a &gt; b&quot;,
+    &quot;a b&quot;,
+    &quot;a + b&quot;,
+    &quot;a ~ b&quot;,
+    &quot;a + b &gt; c ~ d e + g&quot;,
+
+    // Selector lists.
+    &quot;a, a&quot;,
+    &quot;a, b&quot;,
+    &quot;a, b, c, d&quot;,
+    &quot;.foo, .bar, .baz&quot;,
+    &quot;a &gt; b, a b, a + b, a ~ b&quot;,
+];
+
+debug(&quot;Basic cases with [of selectors]&quot;);
+for (var leftSideIndex = 0; leftSideIndex &lt; validNthAnPlusB.length; ++leftSideIndex) {
+    for (var rightSideIndex = 0; rightSideIndex &lt; validRightSide.length; ++rightSideIndex) {
+        var selectorString = validNthAnPlusB[leftSideIndex] + &quot; of &quot; + validRightSide[rightSideIndex];
+        testValidSelector(selectorString);
+        testValidSelector(selectorString + &quot;    &quot;, selectorString);
+    }
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,700 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test serizalization.
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of a,b,c,d)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-last-child(        2n+1           of             a, b          )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of a&gt;b, c    d, e~f, g+h)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of a &gt; b, c d, e ~ f, g + h)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of n-1)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of n-1)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of .n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of .n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of .-n-1)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of .-n-1)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of .n-1)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of .n-1)&quot;
+PASS document.querySelector(&quot;:nth-last-child(2n+1 of n+n)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(2n+1 of n + n)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 Of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 oF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 OF .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(even \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(odd \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-n \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n+0 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(n-0 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(0n \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n+5 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(3n-5 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\of .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\00006ff  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 o\\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\00006F \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\00004f \\000066  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\00006F \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\00004f \\000046  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\6f f .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 o\\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\6F \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\4f \\66  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\6F \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 \\4f \\46  .foobar)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:nth-last-child(-3n-5 of .foobar)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style id=&quot;style-container&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testValidSelector(selectorString, expectedSerializedSelector) {
+    shouldNotThrow('document.querySelector(&quot;:nth-last-child(' + selectorString.replace(/\\/g, '\\\\') + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;1&quot;);
+    if (!expectedSerializedSelector)
+        expectedSerializedSelector = selectorString;
+    shouldBeEqualToString(&quot;document.getElementById('style-container').sheet.cssRules[0].selectorText&quot;, ':nth-last-child(' + expectedSerializedSelector + ')');
+    styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+    &quot;even&quot;,
+    &quot;odd&quot;,
+    &quot;n&quot;,
+    &quot;-n&quot;,
+    &quot;3&quot;,
+    &quot;-3&quot;,
+    &quot;n+0&quot;,
+    &quot;n-0&quot;,
+    &quot;0n&quot;,
+    &quot;3n+5&quot;,
+    &quot;-3n+5&quot;,
+    &quot;3n-5&quot;,
+    &quot;-3n-5&quot;,
+];
+
+debug(&quot;Test serizalization.&quot;);
+testValidSelector(&quot;2n+1 of a,b,c,d&quot;, &quot;2n+1 of a, b, c, d&quot;); // Space separated complex selector.
+testValidSelector(&quot;        2n+1           of             a, b          &quot;, &quot;2n+1 of a, b&quot;); // Ignored extra spaces.
+testValidSelector(&quot;2n+1 of a&gt;b, c    d, e~f, g+h&quot;, &quot;2n+1 of a &gt; b, c d, e ~ f, g + h&quot;); // Combinators.
+
+// At the time of writing this test, the CSS Parser has a special mode for nth-*. Test it does not conflict with regular parsing.
+testValidSelector(&quot;2n+1 of n&quot;);
+testValidSelector(&quot;2n+1 of n-1&quot;); // &quot;n-1&quot; is a perfectly valid element name.
+testValidSelector(&quot;2n+1 of .n&quot;);
+testValidSelector(&quot;2n+1 of .-n-1&quot;);
+testValidSelector(&quot;2n+1 of .n-1&quot;);
+testValidSelector(&quot;2n+1 of n+n&quot;, &quot;2n+1 of n + n&quot;);
+
+// Test case sensitivity of the separator &quot;of&quot;. CSS 2.1 defines that &quot;All CSS syntax is case-insensitive within the ASCII range&quot;.
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testValidSelector(validNthAnPlusB[i] + &quot; of .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; Of .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; oF .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; OF .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+}
+
+// CSS 2.1 &quot;Characters and case&quot; (http://www.w3.org/TR/CSS21/syndata.html#characters) section defines escaping for strings and identifiers:
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    // There is no formal definition of escaping of regular characters, but there is a note saying: 'The identifier &quot;te\st&quot; is exactly the same identifier as &quot;test&quot;.'.
+    testValidSelector(validNthAnPlusB[i] + &quot; \\of .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+
+    // Full hexadecimal escape ('o' = 0x6f, 'f' = 0x66, 'O' = 0x4f, 'F' = 0x46.
+    testValidSelector(validNthAnPlusB[i] + &quot; \\00006ff  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; o\\000066  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\00006F \\000066  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\00004f \\000066  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\00006F \\000046  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\00004f \\000046  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+
+    // Short syntax ('o' = 0x6f, 'f' = 0x66, 'O' = 0x4f, 'F' = 0x46.
+    testValidSelector(validNthAnPlusB[i] + &quot; \\6f f .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; o\\66  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\6F \\66  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\4f \\66  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\6F \\46  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+    testValidSelector(validNthAnPlusB[i] + &quot; \\4f \\46  .foobar&quot;, validNthAnPlusB[i] + &quot; of .foobar&quot;);
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,634 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test invalid selectors:
+PASS document.querySelector(&quot;:nth-last-child(even of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(evenof .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(oddof .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(nof .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-nof .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0nof .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of    )&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of.class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5of .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 empty .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 from .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 to .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 webkit .class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ::first-letter)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ::after)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ::-webkit-custom)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .foo, ::before)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ::before, .foo)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of -webkit-any(::before, .foo))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :nth-last-child(2n+1 of ::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :not(::before))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of .123class)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of #123id)&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of [])&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ())&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of ))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of {})&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of })&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style id=&quot;style-container&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testInvalidSelector(selectorString) {
+    shouldThrow('document.querySelector(&quot;:nth-last-child(' + selectorString + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;0&quot;);
+    styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+    &quot;even&quot;,
+    &quot;odd&quot;,
+    &quot;n&quot;,
+    &quot;-n&quot;,
+    &quot;3&quot;,
+    &quot;-3&quot;,
+    &quot;n+0&quot;,
+    &quot;n-0&quot;,
+    &quot;0n&quot;,
+    &quot;3n+5&quot;,
+    &quot;-3n+5&quot;,
+    &quot;3n-5&quot;,
+    &quot;-3n-5&quot;,
+];
+
+debug(&quot;Test invalid selectors:&quot;);
+// Missing space characters.
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of    &quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of.class&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot;of .class&quot;);
+}
+
+// Use valid identifier but not &quot;of&quot; as a separator.
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testInvalidSelector(validNthAnPlusB[i] + &quot; empty .class&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; from .class&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; to .class&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; webkit .class&quot;);
+}
+
+// Matching pseudo elements do not make any sense.
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ::first-letter&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ::before&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ::after&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ::-webkit-custom&quot;);
+
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of .foo, ::before&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ::before, .foo&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of -webkit-any(::before, .foo)&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :nth-last-child(2n+1 of ::before)&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :not(::before)&quot;);
+}
+
+// Invalid identifiers, syntax, etc.
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of .123class&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of #123id&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of []&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of ()&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of )&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of {}&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of }&quot;);
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style on deeply nested pseudo elements.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test invalid selectors:
+PASS document.querySelector(&quot;:nth-last-child(even of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(even of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(odd of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-n of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n+0 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(n-0 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(0n of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n+5 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n+5 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(3n-5 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :matches(a, b, c::after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :matches(a, b, c:after))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :not(:matches(a, b, c::after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :not(:matches(a, b, c:after)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :nth-last-child(odd of :nth-last-child(even of j::before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(&quot;:nth-last-child(-3n-5 of :nth-last-child(odd of :nth-last-child(even of j:before)))&quot;) threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style id=&quot;style-container&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the parsing of :nth-last-child(of) for querySelector and style on deeply nested pseudo elements.');
+
+function testInvalidSelector(selectorString) {
+    shouldThrow('document.querySelector(&quot;:nth-last-child(' + selectorString + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;0&quot;);
+    styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+    &quot;even&quot;,
+    &quot;odd&quot;,
+    &quot;n&quot;,
+    &quot;-n&quot;,
+    &quot;3&quot;,
+    &quot;-3&quot;,
+    &quot;n+0&quot;,
+    &quot;n-0&quot;,
+    &quot;0n&quot;,
+    &quot;3n+5&quot;,
+    &quot;-3n+5&quot;,
+    &quot;3n-5&quot;,
+    &quot;-3n-5&quot;,
+];
+
+debug(&quot;Test invalid selectors:&quot;);
+for (var i = 0; i &lt; validNthAnPlusB.length; ++i) {
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :matches(a, b, c::after)&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :matches(a, b, c:after)&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :nth-last-child(2n+1 of d, e, :matches(f, g, :before))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :not(:matches(a, b, c::after))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :not(:matches(a, b, c:after))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after))))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :nth-last-child(odd of :nth-last-child(even of j::before))&quot;);
+    testInvalidSelector(validNthAnPlusB[i] + &quot; of :nth-last-child(odd of :nth-last-child(even of j:before))&quot;);
+
+}
+
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/ChangeLog        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-11-10  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        Add parsing support for the extended :nth-last-child(An+B of selector-list) defined
+        https://bugs.webkit.org/show_bug.cgi?id=138520
+
+        Reviewed by Andreas Kling.
+
+        Add parsing for :nth-last-child(An+B of selector-list). The selector is defined
+        in CSS Selectors Level 4: http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo
+
+        Tests: fast/css/parsing-css-nth-last-child-of-1.html
+               fast/css/parsing-css-nth-last-child-of-2.html
+               fast/css/parsing-css-nth-last-child-of-3.html
+               fast/css/parsing-css-nth-last-child-of-4.html
+
+        * css/CSSGrammar.y.in:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::detectFunctionTypeToken):
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText):
+
</ins><span class="cx"> 2014-11-10  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SVG foreign objects do not inherit the container coordinates system if they are repainted.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     case CALCFUNCTION:
</span><span class="cx">     case MINFUNCTION:
</span><span class="cx">     case MAXFUNCTION:
</span><del>-    case NTHCHILDFUNCTION:
</del><ins>+    case NTHCHILDFUNCTIONS:
</ins><span class="cx">     case NTHCHILDSELECTORSEPARATOR:
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx">     case LANGFUNCTION:
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> %token &lt;string&gt; CALCFUNCTION
</span><span class="cx"> %token &lt;string&gt; MINFUNCTION
</span><span class="cx"> %token &lt;string&gt; MAXFUNCTION
</span><del>-%token &lt;string&gt; NTHCHILDFUNCTION
</del><ins>+%token &lt;string&gt; NTHCHILDFUNCTIONS
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> %token &lt;string&gt; LANGFUNCTION
</span><span class="lines">@@ -1389,7 +1389,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Definition of :nth-child().
</span><del>-    | ':' NTHCHILDFUNCTION maybe_space NTH nth_selector_ending {
</del><ins>+    | ':' NTHCHILDFUNCTIONS maybe_space NTH nth_selector_ending {
</ins><span class="cx">         $$ = nullptr;
</span><span class="cx">         if (selectorListDoesNotMatchAnyPseudoElement($5)) {
</span><span class="cx">             auto selector = std::make_unique&lt;CSSParserSelector&gt;();
</span><span class="lines">@@ -1398,11 +1398,13 @@
</span><span class="cx">             selector-&gt;setPseudoClassValue($2);
</span><span class="cx">             if ($5)
</span><span class="cx">                 selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($5));
</span><del>-            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+
+            CSSSelector::PseudoClassType pseudoClassType = selector-&gt;pseudoClassType();
+            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx">                 $$ = selector.release();
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    | ':' NTHCHILDFUNCTION maybe_space maybe_unary_operator INTEGER nth_selector_ending {
</del><ins>+    | ':' NTHCHILDFUNCTIONS maybe_space maybe_unary_operator INTEGER nth_selector_ending {
</ins><span class="cx">         $$ = nullptr;
</span><span class="cx">         if (selectorListDoesNotMatchAnyPseudoElement($6)) {
</span><span class="cx">             auto selector = std::make_unique&lt;CSSParserSelector&gt;();
</span><span class="lines">@@ -1411,11 +1413,12 @@
</span><span class="cx">             selector-&gt;setPseudoClassValue($2);
</span><span class="cx">             if ($6)
</span><span class="cx">                 selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($6));
</span><del>-            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+            CSSSelector::PseudoClassType pseudoClassType = selector-&gt;pseudoClassType();
+            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx">                 $$ = selector.release();
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    | ':' NTHCHILDFUNCTION maybe_space IDENT nth_selector_ending {
</del><ins>+    | ':' NTHCHILDFUNCTIONS maybe_space IDENT nth_selector_ending {
</ins><span class="cx">         $$ = nullptr;
</span><span class="cx">         if (isValidNthToken($4) &amp;&amp; selectorListDoesNotMatchAnyPseudoElement($5)) {
</span><span class="cx">             auto selector = std::make_unique&lt;CSSParserSelector&gt;();
</span><span class="lines">@@ -1424,7 +1427,8 @@
</span><span class="cx">             selector-&gt;setPseudoClassValue($2);
</span><span class="cx">             if ($5)
</span><span class="cx">                selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($5));
</span><del>-            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+            CSSSelector::PseudoClassType pseudoClassType = selector-&gt;pseudoClassType();
+            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx">                 $$ = selector.release();
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -10692,7 +10692,7 @@
</span><span class="cx"> 
</span><span class="cx">     case 9:
</span><span class="cx">         if (isEqualToCSSIdentifier(name, &quot;nth-child&quot;)) {
</span><del>-            m_token = NTHCHILDFUNCTION;
</del><ins>+            m_token = NTHCHILDFUNCTIONS;
</ins><span class="cx">             m_parsingMode = NthChildMode;
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="lines">@@ -10707,6 +10707,7 @@
</span><span class="cx"> 
</span><span class="cx">     case 14:
</span><span class="cx">         if (isEqualToCSSIdentifier(name, &quot;nth-last-child&quot;)) {
</span><ins>+            m_token = NTHCHILDFUNCTIONS;
</ins><span class="cx">             m_parsingMode = NthChildMode;
</span><span class="cx">             return true;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -466,7 +466,16 @@
</span><span class="cx">                 break;
</span><span class="cx">             case CSSSelector::PseudoClassNthLastChild:
</span><span class="cx">                 str.appendLiteral(&quot;:nth-last-child(&quot;);
</span><del>-                appendPseudoClassFunctionTail(str, cs);
</del><ins>+                str.append(cs-&gt;argument());
+#if ENABLE(CSS_SELECTORS_LEVEL4)
+                if (const CSSSelectorList* selectorList = cs-&gt;selectorList()) {
+                    str.appendLiteral(&quot; of &quot;);
+                    appendSelectorList(str, selectorList);
+                }
+#else
+                ASSERT(!cs-&gt;selectorList());
+#endif
+                str.append(')');
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSSelector::PseudoClassNthLastOfType:
</span><span class="cx">                 str.appendLiteral(&quot;:nth-last-of-type(&quot;);
</span></span></pre>
</div>
</div>

</body>
</html>