<!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>[173698] 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/173698">173698</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-09-17 13:03:14 -0700 (Wed, 17 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add parsing for :nth-child(An+B of selector)
https://bugs.webkit.org/show_bug.cgi?id=136845

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-09-17
Reviewed by Antti Koivisto.

Source/WebCore:

Add support for parsing :nth-child(of). The implementation of selector matching
will be in a follow up, there are enough edge cases here already.

Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo

Test: fast/css/parsing-css-nth-child-of.html

* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
(WebCore::CSSParser::realLex):
The parser generate two new kinds of tokens:
-NTHCHILDFUNCTION, matching the &quot;nth-child&quot; identifier.
-NTHCHILDSELECTORSEPARATOR, matching the &quot;of&quot; keyword separating An+B from the selector list.

NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the &quot;nth&quot; functions
(e.g. :nth-of-type()).

NTHCHILDSELECTORSEPARATOR exists for two reasons:
-We must clear the &quot;parsingMode&quot; before parsing selectorList. If we failed to do that, the complex selectors
 would be parsed in NthChildMode, which has all kind of bad side effects.
-The second reason is differentiacting &quot;of&quot; for all the other identifiers. Arguably, this could have been done
 in the grammar, but it is clearer this way since we already need the branches for the parsingMode.

* css/CSSGrammar.y.in:
Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax.

* css/CSSParserValues.cpp:
(WebCore::selectorListMatchesPseudoElement):
(WebCore::CSSParserSelector::matchesPseudoElement):
Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)).
Add helper function to fail parsing of those cases.

* css/CSSParserValues.h:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::selectorList):
Updated serialization code for CSS OM.

LayoutTests:

* fast/css/parsing-css-nth-child-of-expected.txt: Added.
* fast/css/parsing-css-nth-child-of.html: Added.
Two new tests to cover the new syntax.

* 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:
The usual tests for CSS OM.</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="#trunkSourceWebCorecssCSSParserValuescpp">trunk/Source/WebCore/css/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuesh">trunk/Source/WebCore/css/CSSParserValues.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorh">trunk/Source/WebCore/css/CSSSelector.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthchildofexpectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-child-of-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthchildofhtml">trunk/LayoutTests/fast/css/parsing-css-nth-child-of.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/LayoutTests/ChangeLog        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2014-09-17  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Add parsing for :nth-child(An+B of selector)
+        https://bugs.webkit.org/show_bug.cgi?id=136845
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css/parsing-css-nth-child-of-expected.txt: Added.
+        * fast/css/parsing-css-nth-child-of.html: Added.
+        Two new tests to cover the new syntax.
+
+        * 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:
+        The usual tests for CSS OM.
+
+2014-09-17  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
</ins><span class="cx">         CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=136807
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -60,6 +60,28 @@
</span><span class="cx"> PASS parseThenSerializeRule(':-webkit-autofill { }') is ':-webkit-autofill { }'
</span><span class="cx"> PASS parseThenSerializeRule(':-webkit-drag { }') is ':-webkit-drag { }'
</span><span class="cx"> 
</span><ins>+PASS parseThenSerializeRule(':nth-child(odd) { }') is ':nth-child(odd) { }'
+PASS parseThenSerializeRule(':nth-child(even) { }') is ':nth-child(even) { }'
+PASS parseThenSerializeRule(':nth-child(n) { }') is ':nth-child(n) { }'
+PASS parseThenSerializeRule(':nth-child(-n) { }') is ':nth-child(-n) { }'
+PASS parseThenSerializeRule(':nth-child(5) { }') is ':nth-child(5) { }'
+PASS parseThenSerializeRule(':nth-child(-5) { }') is ':nth-child(-5) { }'
+PASS parseThenSerializeRule(':nth-child(5n+7) { }') is ':nth-child(5n+7) { }'
+PASS parseThenSerializeRule(':nth-child(-5n+7) { }') is ':nth-child(-5n+7) { }'
+PASS parseThenSerializeRule(':nth-child(5n-7) { }') is ':nth-child(5n-7) { }'
+PASS parseThenSerializeRule(':nth-child(-5n-7) { }') is ':nth-child(-5n-7) { }'
+
+PASS parseThenSerializeRule(':nth-child(odd of .foo, :nth-child(odd)) { }') is ':nth-child(odd of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(even of .foo, :nth-child(odd)) { }') is ':nth-child(even of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(n of .foo, :nth-child(odd)) { }') is ':nth-child(n of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(-n of .foo, :nth-child(odd)) { }') is ':nth-child(-n of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(5 of .foo, :nth-child(odd)) { }') is ':nth-child(5 of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(-5 of .foo, :nth-child(odd)) { }') is ':nth-child(-5 of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(5n+7 of .foo, :nth-child(odd)) { }') is ':nth-child(5n+7 of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(-5n+7 of .foo, :nth-child(odd)) { }') is ':nth-child(-5n+7 of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(5n-7 of .foo, :nth-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-child(-5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(-5n-7 of .foo, :nth-child(odd)) { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule('::-webkit-file-upload-button { }') is '*::-webkit-file-upload-button { }'
</span><span class="cx"> PASS parseThenSerializeRule('::-webkit-search-cancel-button { }') is '*::-webkit-search-cancel-button { }'
</span><span class="cx"> PASS parseThenSerializeRule('::-webkit-search-decoration { }') is '*::-webkit-search-decoration { }'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -99,6 +99,32 @@
</span><span class="cx"> 
</span><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+testSelectorRoundTrip(&quot;:nth-child(odd)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(even)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(n)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-n)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n+7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n+7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n-7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n-7)&quot;);
+
+debug('');
+
+testSelectorRoundTrip(&quot;:nth-child(odd of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(even of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(n of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-n of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n+7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n+7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n-7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n-7 of .foo, :nth-child(odd))&quot;);
+
+debug('');
+
</ins><span class="cx"> shouldBe(&quot;parseThenSerializeRule('::-webkit-file-upload-button { }')&quot;, &quot;'*::-webkit-file-upload-button { }'&quot;);
</span><span class="cx"> shouldBe(&quot;parseThenSerializeRule('::-webkit-search-cancel-button { }')&quot;, &quot;'*::-webkit-search-cancel-button { }'&quot;);
</span><span class="cx"> shouldBe(&quot;parseThenSerializeRule('::-webkit-search-decoration { }')&quot;, &quot;'*::-webkit-search-decoration { }'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -70,6 +70,28 @@
</span><span class="cx"> PASS setThenReadSelectorText(':-webkit-autofill') is ':-webkit-autofill'
</span><span class="cx"> PASS setThenReadSelectorText(':-webkit-drag') is ':-webkit-drag'
</span><span class="cx"> 
</span><ins>+PASS setThenReadSelectorText(':nth-child(odd)') is ':nth-child(odd)'
+PASS setThenReadSelectorText(':nth-child(even)') is ':nth-child(even)'
+PASS setThenReadSelectorText(':nth-child(n)') is ':nth-child(n)'
+PASS setThenReadSelectorText(':nth-child(-n)') is ':nth-child(-n)'
+PASS setThenReadSelectorText(':nth-child(5)') is ':nth-child(5)'
+PASS setThenReadSelectorText(':nth-child(-5)') is ':nth-child(-5)'
+PASS setThenReadSelectorText(':nth-child(5n+7)') is ':nth-child(5n+7)'
+PASS setThenReadSelectorText(':nth-child(-5n+7)') is ':nth-child(-5n+7)'
+PASS setThenReadSelectorText(':nth-child(5n-7)') is ':nth-child(5n-7)'
+PASS setThenReadSelectorText(':nth-child(-5n-7)') is ':nth-child(-5n-7)'
+
+PASS setThenReadSelectorText(':nth-child(odd of .foo, :nth-child(odd))') is ':nth-child(odd of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(even of .foo, :nth-child(odd))') is ':nth-child(even of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(n of .foo, :nth-child(odd))') is ':nth-child(n of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(-n of .foo, :nth-child(odd))') is ':nth-child(-n of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(5 of .foo, :nth-child(odd))') is ':nth-child(5 of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(-5 of .foo, :nth-child(odd))') is ':nth-child(-5 of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(5n+7 of .foo, :nth-child(odd))') is ':nth-child(5n+7 of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(-5n+7 of .foo, :nth-child(odd))') is ':nth-child(-5n+7 of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(5n-7 of .foo, :nth-child(odd))') is ':nth-child(5n-7 of .foo, :nth-child(odd))'
+PASS setThenReadSelectorText(':nth-child(-5n-7 of .foo, :nth-child(odd))') is ':nth-child(-5n-7 of .foo, :nth-child(odd))'
+
</ins><span class="cx"> PASS setThenReadSelectorText('::-webkit-file-upload-button') is '*::-webkit-file-upload-button'
</span><span class="cx"> PASS setThenReadSelectorText('::-webkit-search-cancel-button') is '*::-webkit-search-cancel-button'
</span><span class="cx"> PASS setThenReadSelectorText('::-webkit-search-decoration') is '*::-webkit-search-decoration'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text.html (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -116,6 +116,31 @@
</span><span class="cx"> 
</span><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+testSelectorRoundTrip(&quot;:nth-child(odd)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(even)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(n)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-n)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n+7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n+7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n-7)&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n-7)&quot;);
+
+debug('');
+
+testSelectorRoundTrip(&quot;:nth-child(odd of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(even of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(n of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-n of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n+7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n+7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(5n-7 of .foo, :nth-child(odd))&quot;);
+testSelectorRoundTrip(&quot;:nth-child(-5n-7 of .foo, :nth-child(odd))&quot;);
+debug('');
+
</ins><span class="cx"> shouldBe(&quot;setThenReadSelectorText('::-webkit-file-upload-button')&quot;, &quot;'*::-webkit-file-upload-button'&quot;);
</span><span class="cx"> shouldBe(&quot;setThenReadSelectorText('::-webkit-search-cancel-button')&quot;, &quot;'*::-webkit-search-cancel-button'&quot;);
</span><span class="cx"> shouldBe(&quot;setThenReadSelectorText('::-webkit-search-decoration')&quot;, &quot;'*::-webkit-search-decoration'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthchildofexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-child-of-expected.txt (0 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-child-of-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-child-of-expected.txt        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -0,0 +1,2849 @@
</span><ins>+Test the parsing of :nth-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-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-child(even)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5)&quot;
+Basic cases with [of selectors]
+PASS document.querySelector(&quot;:nth-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-child(even of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of *)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of #id)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of :first-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of :last-child)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of foobar#id.class)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .class:not(.notclass))&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of #id:empty)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a &gt; b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a + b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a + b &gt; c ~ d e + g)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, a)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foo, .bar, .baz)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of a &gt; b, a b, a + b, a ~ b)&quot;
+Test serizalization.
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of a, b, c, d)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of a, b)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of a &gt; b, c d, e ~ f, g + h)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of n-1)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of .n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of .-n-1)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of .n-1)&quot;
+PASS document.querySelector(&quot;:nth-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-child(2n+1 of n + n)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(even of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(odd of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n+0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(n-0 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(0n of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n+5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+PASS document.querySelector(&quot;:nth-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-child(-3n-5 of .foobar)&quot;
+
+Test invalid selectors:
+PASS document.querySelector(&quot;:nth-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-child(even of :nth-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-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-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-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-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-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-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-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-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-child(odd of :nth-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-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-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-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-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-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-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-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-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-child(n of :nth-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-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-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-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-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-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-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-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-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-child(-n of :nth-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-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-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-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-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-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-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-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-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-child(3 of :nth-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-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-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-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-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-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-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-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-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-child(-3 of :nth-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-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-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-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-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-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-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-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-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-child(n+0 of :nth-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-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-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-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-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-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-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-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-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-child(n-0 of :nth-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-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-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-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-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-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-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-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-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-child(0n of :nth-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-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-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-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-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-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-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-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-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-child(3n+5 of :nth-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-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-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-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-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-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-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-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-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-child(-3n+5 of :nth-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-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-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-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-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-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-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-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-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-child(3n-5 of :nth-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-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-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-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-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-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-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-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-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-child(-3n-5 of :nth-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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="trunkLayoutTestsfastcssparsingcssnthchildofhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-child-of.html (0 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-child-of.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-child-of.html        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -0,0 +1,182 @@
</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-child(of) for querySelector and style.');
+
+function testInvalidSelector(selectorString) {
+    shouldThrow('document.querySelector(&quot;:nth-child(' + selectorString + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-child(' + selectorString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;0&quot;);
+    styleContainer.innerHTML = '';
+}
+
+function testValidSelector(selectorString, expectedSerializedSelector) {
+    shouldNotThrow('document.querySelector(&quot;:nth-child(' + selectorString.replace(/\\/g, '\\\\') + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':nth-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-child(' + expectedSerializedSelector + ')');
+    styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-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);
+    }
+}
+
+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;);
+}
+
+
+debug(&quot;&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-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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/ChangeLog        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,5 +1,51 @@
</span><span class="cx"> 2014-09-17  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Add parsing for :nth-child(An+B of selector)
+        https://bugs.webkit.org/show_bug.cgi?id=136845
+
+        Reviewed by Antti Koivisto.
+
+        Add support for parsing :nth-child(of). The implementation of selector matching
+        will be in a follow up, there are enough edge cases here already.
+
+        Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo
+
+        Test: fast/css/parsing-css-nth-child-of.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::detectFunctionTypeToken):
+        (WebCore::CSSParser::realLex):
+        The parser generate two new kinds of tokens:
+        -NTHCHILDFUNCTION, matching the &quot;nth-child&quot; identifier.
+        -NTHCHILDSELECTORSEPARATOR, matching the &quot;of&quot; keyword separating An+B from the selector list.
+
+        NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the &quot;nth&quot; functions
+        (e.g. :nth-of-type()).
+
+        NTHCHILDSELECTORSEPARATOR exists for two reasons:
+        -We must clear the &quot;parsingMode&quot; before parsing selectorList. If we failed to do that, the complex selectors
+         would be parsed in NthChildMode, which has all kind of bad side effects.
+        -The second reason is differentiacting &quot;of&quot; for all the other identifiers. Arguably, this could have been done
+         in the grammar, but it is clearer this way since we already need the branches for the parsingMode.
+
+        * css/CSSGrammar.y.in:
+        Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax.
+
+        * css/CSSParserValues.cpp:
+        (WebCore::selectorListMatchesPseudoElement):
+        (WebCore::CSSParserSelector::matchesPseudoElement):
+        Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)).
+        Add helper function to fail parsing of those cases.
+
+        * css/CSSParserValues.h:
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText):
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::selectorList):
+        Updated serialization code for CSS OM.
+
+2014-09-17  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
</ins><span class="cx">         CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=136807
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
</span><del>- *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *  Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *  Copyright (C) 2008 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="cx">  *  Copyright (C) 2012 Intel Corporation. All rights reserved.
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx">     case CALCFUNCTION:
</span><span class="cx">     case MINFUNCTION:
</span><span class="cx">     case MAXFUNCTION:
</span><ins>+    case NTHCHILDFUNCTION:
+    case NTHCHILDSELECTORSEPARATOR:
</ins><span class="cx">     case UNICODERANGE:
</span><span class="cx">         return true;
</span><span class="cx">     default:
</span><span class="lines">@@ -77,19 +79,38 @@
</span><span class="cx">     return v;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+auto invalidSelectorVector = reinterpret_cast&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;*&gt;(-1);
+
+static bool isValidNthSelectorList(const Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;* selectorVector)
+{
+    if (!selectorVector)
+        return true;
+
+    if (selectorVector == invalidSelectorVector)
+        return false;
+
+    for (unsigned i = 0; i &lt; selectorVector-&gt;size(); ++i) {
+        for (const CSSParserSelector* selector = selectorVector-&gt;at(i).get(); selector; selector = selector-&gt;tagHistory()) {
+            if (selector-&gt;matchesPseudoElement())
+                return false;
+        }
+    }
+    return true;
+}
+
</ins><span class="cx"> %}
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE_CSS_GRID_LAYOUT
</span><span class="cx"> #if ENABLE_PICTURE_SIZES
</span><del>-%expect 34
</del><ins>+%expect 36
</ins><span class="cx"> #else
</span><del>-%expect 30
</del><ins>+%expect 32
</ins><span class="cx"> #endif
</span><span class="cx"> #else
</span><span class="cx"> #if ENABLE_PICTURE_SIZES
</span><del>-%expect 33
</del><ins>+%expect 35
</ins><span class="cx"> #else
</span><del>-%expect 29
</del><ins>+%expect 31
</ins><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -109,6 +130,7 @@
</span><span class="cx"> %token &lt;string&gt; STRING
</span><span class="cx"> %right &lt;string&gt; IDENT
</span><span class="cx"> %token &lt;string&gt; NTH
</span><ins>+%token &lt;string&gt; NTHCHILDSELECTORSEPARATOR
</ins><span class="cx"> 
</span><span class="cx"> %nonassoc &lt;string&gt; HEX
</span><span class="cx"> %nonassoc &lt;string&gt; IDSEL
</span><span class="lines">@@ -201,6 +223,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><ins>+%token &lt;string&gt; NTHCHILDFUNCTION
</ins><span class="cx"> 
</span><span class="cx"> %token &lt;string&gt; UNICODERANGE
</span><span class="cx"> 
</span><span class="lines">@@ -279,8 +302,8 @@
</span><span class="cx"> %destructor { delete $$; } attrib class page_selector pseudo pseudo_page complex_selector complex_selector_with_trailing_whitespace compound_selector specifier specifier_list
</span><span class="cx"> 
</span><span class="cx"> %union { Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;* selectorList; }
</span><del>-%type &lt;selectorList&gt; selector_list simple_selector_list
-%destructor { delete $$; } selector_list simple_selector_list
</del><ins>+%type &lt;selectorList&gt; selector_list simple_selector_list nth_selector_ending
+%destructor { delete $$; } selector_list simple_selector_list nth_selector_ending
</ins><span class="cx"> 
</span><span class="cx"> %union { bool boolean; }
</span><span class="cx"> %type &lt;boolean&gt; declaration declaration_list decl_list priority
</span><span class="lines">@@ -1263,6 +1286,21 @@
</span><span class="cx">         $$ = CSSParserSelector::parsePagePseudoSelector($2);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+nth_selector_ending:
+    ')' {
+        $$ = nullptr;
+    }
+    | space ')' {
+        $$ = nullptr;
+    }
+    | space NTHCHILDSELECTORSEPARATOR space selector_list maybe_space ')' {
+        if ($4)
+            $$ = $4;
+        else
+            $$ = invalidSelectorVector;
+    }
+    ;
+
</ins><span class="cx"> pseudo:
</span><span class="cx">     ':' IDENT {
</span><span class="cx">         $$ = CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector($2);
</span><span class="lines">@@ -1292,6 +1330,48 @@
</span><span class="cx">                 $$ = selector.release();
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    // Definition of :nth-child().
+    | ':' NTHCHILDFUNCTION maybe_space NTH nth_selector_ending {
+        $$ = nullptr;
+        if (isValidNthSelectorList($5)) {
+            auto selector = std::make_unique&lt;CSSParserSelector&gt;();
+            selector-&gt;setMatch(CSSSelector::PseudoClass);
+            selector-&gt;setArgument($4);
+            selector-&gt;setPseudoClassValue($2);
+            if ($5)
+                selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($5));
+            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
+                $$ = selector.release();
+        }
+    }
+    | ':' NTHCHILDFUNCTION maybe_space maybe_unary_operator INTEGER nth_selector_ending {
+        $$ = nullptr;
+        if (isValidNthSelectorList($6)) {
+            auto selector = std::make_unique&lt;CSSParserSelector&gt;();
+            selector-&gt;setMatch(CSSSelector::PseudoClass);
+            selector-&gt;setArgument(AtomicString::number($4 * $5));
+            selector-&gt;setPseudoClassValue($2);
+            if ($6)
+                selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($6));
+            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
+                $$ = selector.release();
+        }
+    }
+    | ':' NTHCHILDFUNCTION maybe_space IDENT nth_selector_ending {
+        $$ = nullptr;
+        if (isValidNthToken($4) &amp;&amp; isValidNthSelectorList($5)) {
+            auto selector = std::make_unique&lt;CSSParserSelector&gt;();
+            selector-&gt;setMatch(CSSSelector::PseudoClass);
+            selector-&gt;setArgument($4);
+            selector-&gt;setPseudoClassValue($2);
+            if ($5)
+               selector-&gt;adoptSelectorVector(*std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;CSSParserSelector&gt;&gt;&gt;($5));
+            if (selector-&gt;pseudoClassType() == CSSSelector::PseudoClassNthChild)
+                $$ = selector.release();
+        }
+    }
+
</ins><span class="cx">     // used by :nth-*(ax+b)
</span><span class="cx">     | ':' FUNCTION maybe_space NTH maybe_space ')' {
</span><span class="cx">         $$ = nullptr;
</span><span class="lines">@@ -1330,6 +1410,7 @@
</span><span class="cx">         }
</span><span class="cx">         $$ = selector.release();
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx">     // used by :not
</span><span class="cx">     | ':' NOTFUNCTION maybe_space compound_selector maybe_space ')' {
</span><span class="cx">         std::unique_ptr&lt;CSSParserSelector&gt; selector($4);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
</span><span class="cx">  * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2007 Nicholas Shanks &lt;webkit@nickshanks.com&gt;
</span><span class="cx">  * Copyright (C) 2008 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="lines">@@ -10671,6 +10671,7 @@
</span><span class="cx"> 
</span><span class="cx">     case 9:
</span><span class="cx">         if (isEqualToCSSIdentifier(name, &quot;nth-child&quot;)) {
</span><ins>+            m_token = NTHCHILDFUNCTION;
</ins><span class="cx">             m_parsingMode = NthChildMode;
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="lines">@@ -11204,6 +11205,10 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span><ins>+        if (m_parsingMode == NthChildMode &amp;&amp; m_token == IDENT &amp;&amp; yylval-&gt;string.length() == 2 &amp;&amp; yylval-&gt;string.equalIgnoringCase(&quot;of&quot;)) {
+            m_parsingMode = NormalMode;
+            m_token = NTHCHILDSELECTORSEPARATOR;
+        }
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case CharacterDot:
</span><span class="lines">@@ -11478,6 +11483,10 @@
</span><span class="cx">             parseIdentifier(result, yylval-&gt;string, hasEscape);
</span><span class="cx">             m_token = IDENT;
</span><span class="cx">         }
</span><ins>+        if (m_parsingMode == NthChildMode &amp;&amp; m_token == IDENT &amp;&amp; yylval-&gt;string.length() == 2 &amp;&amp; yylval-&gt;string.equalIgnoringCase(&quot;of&quot;)) {
+            m_parsingMode = NormalMode;
+            m_token = NTHCHILDSELECTORSEPARATOR;
+        }
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case CharacterXor:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.cpp        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -286,6 +286,25 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool selectorListMatchesPseudoElement(const CSSSelectorList* selectorList)
+{
+    if (!selectorList)
+        return false;
+
+    for (const CSSSelector* subSelector = selectorList-&gt;first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+        for (const CSSSelector* selector = subSelector; selector; selector = selector-&gt;tagHistory()) {
+            if (selector-&gt;matchesPseudoElement())
+                return true;
+        }
+    }
+    return false;
+}
+
+bool CSSParserSelector::matchesPseudoElement() const
+{
+    return m_selector-&gt;matchesPseudoElement() || selectorListMatchesPseudoElement(m_selector-&gt;selectorList());
+}
+
</ins><span class="cx"> void CSSParserSelector::insertTagHistory(CSSSelector::Relation before, std::unique_ptr&lt;CSSParserSelector&gt; selector, CSSSelector::Relation after)
</span><span class="cx"> {
</span><span class="cx">     if (m_tagHistory)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.h (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.h        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSParserValues.h        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -217,6 +217,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isSimple() const;
</span><span class="cx">     bool hasShadowDescendant() const;
</span><ins>+    bool matchesPseudoElement() const;
</ins><span class="cx"> 
</span><span class="cx">     CSSParserSelector* tagHistory() const { return m_tagHistory.get(); }
</span><span class="cx">     void setTagHistory(std::unique_ptr&lt;CSSParserSelector&gt; selector) { m_tagHistory = WTF::move(selector); }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *               1999 Waldo Bastian (bastian@kde.org)
</span><span class="cx">  *               2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
</span><span class="cx">  *               2001-2003 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 David Smith (catfish.man@gmail.com)
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -395,7 +395,21 @@
</span><span class="cx">                 break;
</span><span class="cx">             case CSSSelector::PseudoClassNthChild:
</span><span class="cx">                 str.appendLiteral(&quot;:nth-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;);
+                    const CSSSelector* firstSubSelector = selectorList-&gt;first();
+                    for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+                        if (subSelector != firstSubSelector)
+                            str.appendLiteral(&quot;, &quot;);
+                        str.append(subSelector-&gt;selectorText());
+                    }
+                }
+#else
+                ASSERT(!cs-&gt;selectorList());
+#endif
+                str.append(')');
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSSelector::PseudoClassNthLastChild:
</span><span class="cx">                 str.appendLiteral(&quot;:nth-last-child(&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (173697 => 173698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2014-09-17 20:01:09 UTC (rev 173697)
+++ trunk/Source/WebCore/css/CSSSelector.h        2014-09-17 20:03:14 UTC (rev 173698)
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">         const QualifiedName&amp; attribute() const;
</span><span class="cx">         const AtomicString&amp; attributeCanonicalLocalName() const;
</span><span class="cx">         const AtomicString&amp; argument() const { return m_hasRareData ? m_data.m_rareData-&gt;m_argument : nullAtom; }
</span><del>-        const CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData-&gt;m_selectorList.get() : 0; }
</del><ins>+        const CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData-&gt;m_selectorList.get() : nullptr; }
</ins><span class="cx"> 
</span><span class="cx">         void setValue(const AtomicString&amp;);
</span><span class="cx">         void setAttribute(const QualifiedName&amp;, bool isCaseInsensitive);
</span><span class="lines">@@ -273,8 +273,6 @@
</span><span class="cx">         bool isLastInTagHistory() const { return m_isLastInTagHistory; }
</span><span class="cx">         void setNotLastInTagHistory() { m_isLastInTagHistory = false; }
</span><span class="cx"> 
</span><del>-        bool isSimple() const;
-
</del><span class="cx">         bool isForPage() const { return m_isForPage; }
</span><span class="cx">         void setForPage() { m_isForPage = true; }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>