<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[175848] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/175848">175848</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-10 19:49:08 -0800 (Mon, 10 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore:
Add parsing support for the extended :nth-last-child(An+B of selector-list) defined
https://bugs.webkit.org/show_bug.cgi?id=138520
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-10
Reviewed by Andreas Kling.
Add parsing for :nth-last-child(An+B of selector-list). The selector is defined
in CSS Selectors Level 4: http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo
Tests: fast/css/parsing-css-nth-last-child-of-1.html
fast/css/parsing-css-nth-last-child-of-2.html
fast/css/parsing-css-nth-last-child-of-3.html
fast/css/parsing-css-nth-last-child-of-4.html
* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
LayoutTests:
Add parsing support for the extended :nth-last-child(An+B of selector-list)
https://bugs.webkit.org/show_bug.cgi?id=138520
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-10
Reviewed by Andreas Kling.
All the tests are variations of the existing tests for :nth-child(An+B of selector-list).
* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/parsing-css-nth-last-child-of-1-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-1.html: Added.
* fast/css/parsing-css-nth-last-child-of-2-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-2.html: Added.
* fast/css/parsing-css-nth-last-child-of-3-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-3.html: Added.
* fast/css/parsing-css-nth-last-child-of-4-expected.txt: Added.
* fast/css/parsing-css-nth-last-child-of-4.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortexthtml">trunk/LayoutTests/fast/css/css-selector-text.html</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortexthtml">trunk/LayoutTests/fast/css/css-set-selector-text.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof1expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof1html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof2expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof2html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof3expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof3html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof4expectedtxt">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcssnthlastchildof4html">trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/ChangeLog        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-11-10 Benjamin Poulain <bpoulain@apple.com>
+
+ Add parsing support for the extended :nth-last-child(An+B of selector-list)
+ https://bugs.webkit.org/show_bug.cgi?id=138520
+
+ Reviewed by Andreas Kling.
+
+ All the tests are variations of the existing tests for :nth-child(An+B of selector-list).
+
+ * fast/css/css-selector-text-expected.txt:
+ * fast/css/css-selector-text.html:
+ * fast/css/css-set-selector-text-expected.txt:
+ * fast/css/css-set-selector-text.html:
+ * fast/css/parsing-css-nth-last-child-of-1-expected.txt: Added.
+ * fast/css/parsing-css-nth-last-child-of-1.html: Added.
+ * fast/css/parsing-css-nth-last-child-of-2-expected.txt: Added.
+ * fast/css/parsing-css-nth-last-child-of-2.html: Added.
+ * fast/css/parsing-css-nth-last-child-of-3-expected.txt: Added.
+ * fast/css/parsing-css-nth-last-child-of-3.html: Added.
+ * fast/css/parsing-css-nth-last-child-of-4-expected.txt: Added.
+ * fast/css/parsing-css-nth-last-child-of-4.html: Added.
+
</ins><span class="cx"> 2014-11-10 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> SVG foreign objects do not inherit the container coordinates system if they are repainted..
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -90,6 +90,17 @@
</span><span class="cx"> PASS parseThenSerializeRule(':nth-child(5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(5n-7 of .foo, :nth-child(odd)) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':nth-child(-5n-7 of .foo, :nth-child(odd)) { }') is ':nth-child(-5n-7 of .foo, :nth-child(odd)) { }'
</span><span class="cx">
</span><ins>+PASS parseThenSerializeRule(':nth-last-child(odd of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(odd of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(even of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(even of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(n of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(n of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-n of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-n of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5n+7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5n+7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5n+7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5n+7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(5n-7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(5n-7 of .foo, :nth-last-child(odd)) { }'
+PASS parseThenSerializeRule(':nth-last-child(-5n-7 of .foo, :nth-last-child(odd)) { }') is ':nth-last-child(-5n-7 of .foo, :nth-last-child(odd)) { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule(':matches(single) { }') is ':matches(single) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':matches(a, b, p) { }') is ':matches(a, b, p) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':matches(#alice, #bob, #chris) { }') is ':matches(#alice, #bob, #chris) { }'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -135,6 +135,19 @@
</span><span class="cx">
</span><span class="cx"> debug('');
</span><span class="cx">
</span><ins>+testSelectorRoundTrip(":nth-last-child(odd of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(even of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(n of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-n of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5n+7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5n+7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5n-7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5n-7 of .foo, :nth-last-child(odd))");
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip(':matches(single)');
</span><span class="cx"> testSelectorRoundTrip(':matches(a, b, p)');
</span><span class="cx"> testSelectorRoundTrip(':matches(#alice, #bob, #chris)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -100,6 +100,17 @@
</span><span class="cx"> PASS setThenReadSelectorText(':nth-child(5n-7 of .foo, :nth-child(odd))') is ':nth-child(5n-7 of .foo, :nth-child(odd))'
</span><span class="cx"> PASS setThenReadSelectorText(':nth-child(-5n-7 of .foo, :nth-child(odd))') is ':nth-child(-5n-7 of .foo, :nth-child(odd))'
</span><span class="cx">
</span><ins>+PASS setThenReadSelectorText(':nth-last-child(odd of .foo, :nth-last-child(odd))') is ':nth-last-child(odd of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(even of .foo, :nth-last-child(odd))') is ':nth-last-child(even of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(n of .foo, :nth-last-child(odd))') is ':nth-last-child(n of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-n of .foo, :nth-last-child(odd))') is ':nth-last-child(-n of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5 of .foo, :nth-last-child(odd))') is ':nth-last-child(5 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5n+7 of .foo, :nth-last-child(odd))') is ':nth-last-child(5n+7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5n+7 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5n+7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(5n-7 of .foo, :nth-last-child(odd))') is ':nth-last-child(5n-7 of .foo, :nth-last-child(odd))'
+PASS setThenReadSelectorText(':nth-last-child(-5n-7 of .foo, :nth-last-child(odd))') is ':nth-last-child(-5n-7 of .foo, :nth-last-child(odd))'
+
</ins><span class="cx"> PASS setThenReadSelectorText(':matches(single)') is ':matches(single)'
</span><span class="cx"> PASS setThenReadSelectorText(':matches(a, b, p)') is ':matches(a, b, p)'
</span><span class="cx"> PASS setThenReadSelectorText(':matches(#alice, #bob, #chris)') is ':matches(#alice, #bob, #chris)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text.html (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -148,8 +148,22 @@
</span><span class="cx"> testSelectorRoundTrip(":nth-child(-5n+7 of .foo, :nth-child(odd))");
</span><span class="cx"> testSelectorRoundTrip(":nth-child(5n-7 of .foo, :nth-child(odd))");
</span><span class="cx"> testSelectorRoundTrip(":nth-child(-5n-7 of .foo, :nth-child(odd))");
</span><ins>+
</ins><span class="cx"> debug('');
</span><span class="cx">
</span><ins>+testSelectorRoundTrip(":nth-last-child(odd of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(even of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(n of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-n of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5n+7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5n+7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(5n-7 of .foo, :nth-last-child(odd))");
+testSelectorRoundTrip(":nth-last-child(-5n-7 of .foo, :nth-last-child(odd))");
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip(':matches(single)');
</span><span class="cx"> testSelectorRoundTrip(':matches(a, b, p)');
</span><span class="cx"> testSelectorRoundTrip(':matches(#alice, #bob, #chris)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,1532 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Basic valid cases without [of selectors]
+PASS document.querySelector(":nth-last-child(even)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even)"
+PASS document.querySelector(":nth-last-child(odd)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd)"
+PASS document.querySelector(":nth-last-child(n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n)"
+PASS document.querySelector(":nth-last-child(-n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n)"
+PASS document.querySelector(":nth-last-child(3)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3)"
+PASS document.querySelector(":nth-last-child(-3)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3)"
+PASS document.querySelector(":nth-last-child(n+0)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0)"
+PASS document.querySelector(":nth-last-child(n-0)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0)"
+PASS document.querySelector(":nth-last-child(0n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n)"
+PASS document.querySelector(":nth-last-child(3n+5)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5)"
+PASS document.querySelector(":nth-last-child(-3n+5)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5)"
+PASS document.querySelector(":nth-last-child(3n-5)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5)"
+PASS document.querySelector(":nth-last-child(-3n-5)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5)"
+Basic cases with [of selectors]
+PASS document.querySelector(":nth-last-child(even of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of *)"
+PASS document.querySelector(":nth-last-child(even of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of *)"
+PASS document.querySelector(":nth-last-child(even of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of foobar)"
+PASS document.querySelector(":nth-last-child(even of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of foobar)"
+PASS document.querySelector(":nth-last-child(even of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of #id)"
+PASS document.querySelector(":nth-last-child(even of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of #id)"
+PASS document.querySelector(":nth-last-child(even of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .class)"
+PASS document.querySelector(":nth-last-child(even of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .class)"
+PASS document.querySelector(":nth-last-child(even of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of :first-child)"
+PASS document.querySelector(":nth-last-child(even of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of :first-child)"
+PASS document.querySelector(":nth-last-child(even of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of :last-child)"
+PASS document.querySelector(":nth-last-child(even of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of :last-child)"
+PASS document.querySelector(":nth-last-child(even of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(even of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(even of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(even of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(even of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of #id:empty)"
+PASS document.querySelector(":nth-last-child(even of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of #id:empty)"
+PASS document.querySelector(":nth-last-child(even of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a > b)"
+PASS document.querySelector(":nth-last-child(even of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a > b)"
+PASS document.querySelector(":nth-last-child(even of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a b)"
+PASS document.querySelector(":nth-last-child(even of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a b)"
+PASS document.querySelector(":nth-last-child(even of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a + b)"
+PASS document.querySelector(":nth-last-child(even of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a + b)"
+PASS document.querySelector(":nth-last-child(even of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a ~ b)"
+PASS document.querySelector(":nth-last-child(even of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a ~ b)"
+PASS document.querySelector(":nth-last-child(even of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(even of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(even of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, a)"
+PASS document.querySelector(":nth-last-child(even of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, a)"
+PASS document.querySelector(":nth-last-child(even of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, b)"
+PASS document.querySelector(":nth-last-child(even of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, b)"
+PASS document.querySelector(":nth-last-child(even of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(even of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(even of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(even of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(even of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(even of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(odd of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of *)"
+PASS document.querySelector(":nth-last-child(odd of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of *)"
+PASS document.querySelector(":nth-last-child(odd of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of foobar)"
+PASS document.querySelector(":nth-last-child(odd of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of foobar)"
+PASS document.querySelector(":nth-last-child(odd of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of #id)"
+PASS document.querySelector(":nth-last-child(odd of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of #id)"
+PASS document.querySelector(":nth-last-child(odd of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .class)"
+PASS document.querySelector(":nth-last-child(odd of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .class)"
+PASS document.querySelector(":nth-last-child(odd of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of :first-child)"
+PASS document.querySelector(":nth-last-child(odd of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of :first-child)"
+PASS document.querySelector(":nth-last-child(odd of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of :last-child)"
+PASS document.querySelector(":nth-last-child(odd of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of :last-child)"
+PASS document.querySelector(":nth-last-child(odd of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(odd of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(odd of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(odd of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(odd of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of #id:empty)"
+PASS document.querySelector(":nth-last-child(odd of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of #id:empty)"
+PASS document.querySelector(":nth-last-child(odd of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a > b)"
+PASS document.querySelector(":nth-last-child(odd of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a > b)"
+PASS document.querySelector(":nth-last-child(odd of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a b)"
+PASS document.querySelector(":nth-last-child(odd of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a b)"
+PASS document.querySelector(":nth-last-child(odd of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a + b)"
+PASS document.querySelector(":nth-last-child(odd of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a + b)"
+PASS document.querySelector(":nth-last-child(odd of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a ~ b)"
+PASS document.querySelector(":nth-last-child(odd of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a ~ b)"
+PASS document.querySelector(":nth-last-child(odd of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(odd of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(odd of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, a)"
+PASS document.querySelector(":nth-last-child(odd of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, a)"
+PASS document.querySelector(":nth-last-child(odd of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, b)"
+PASS document.querySelector(":nth-last-child(odd of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, b)"
+PASS document.querySelector(":nth-last-child(odd of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(odd of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(odd of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(odd of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(odd of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(odd of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of *)"
+PASS document.querySelector(":nth-last-child(n of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of *)"
+PASS document.querySelector(":nth-last-child(n of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of foobar)"
+PASS document.querySelector(":nth-last-child(n of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of foobar)"
+PASS document.querySelector(":nth-last-child(n of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of #id)"
+PASS document.querySelector(":nth-last-child(n of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of #id)"
+PASS document.querySelector(":nth-last-child(n of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .class)"
+PASS document.querySelector(":nth-last-child(n of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .class)"
+PASS document.querySelector(":nth-last-child(n of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of :first-child)"
+PASS document.querySelector(":nth-last-child(n of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of :first-child)"
+PASS document.querySelector(":nth-last-child(n of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of :last-child)"
+PASS document.querySelector(":nth-last-child(n of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of :last-child)"
+PASS document.querySelector(":nth-last-child(n of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of #id:empty)"
+PASS document.querySelector(":nth-last-child(n of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of #id:empty)"
+PASS document.querySelector(":nth-last-child(n of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a > b)"
+PASS document.querySelector(":nth-last-child(n of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a > b)"
+PASS document.querySelector(":nth-last-child(n of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a b)"
+PASS document.querySelector(":nth-last-child(n of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a b)"
+PASS document.querySelector(":nth-last-child(n of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a + b)"
+PASS document.querySelector(":nth-last-child(n of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a + b)"
+PASS document.querySelector(":nth-last-child(n of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a ~ b)"
+PASS document.querySelector(":nth-last-child(n of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a ~ b)"
+PASS document.querySelector(":nth-last-child(n of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, a)"
+PASS document.querySelector(":nth-last-child(n of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, a)"
+PASS document.querySelector(":nth-last-child(n of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, b)"
+PASS document.querySelector(":nth-last-child(n of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, b)"
+PASS document.querySelector(":nth-last-child(n of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-n of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of *)"
+PASS document.querySelector(":nth-last-child(-n of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of *)"
+PASS document.querySelector(":nth-last-child(-n of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of foobar)"
+PASS document.querySelector(":nth-last-child(-n of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of foobar)"
+PASS document.querySelector(":nth-last-child(-n of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of #id)"
+PASS document.querySelector(":nth-last-child(-n of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of #id)"
+PASS document.querySelector(":nth-last-child(-n of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .class)"
+PASS document.querySelector(":nth-last-child(-n of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .class)"
+PASS document.querySelector(":nth-last-child(-n of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of :first-child)"
+PASS document.querySelector(":nth-last-child(-n of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of :first-child)"
+PASS document.querySelector(":nth-last-child(-n of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of :last-child)"
+PASS document.querySelector(":nth-last-child(-n of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of :last-child)"
+PASS document.querySelector(":nth-last-child(-n of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-n of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-n of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-n of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-n of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of #id:empty)"
+PASS document.querySelector(":nth-last-child(-n of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of #id:empty)"
+PASS document.querySelector(":nth-last-child(-n of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a > b)"
+PASS document.querySelector(":nth-last-child(-n of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a > b)"
+PASS document.querySelector(":nth-last-child(-n of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a b)"
+PASS document.querySelector(":nth-last-child(-n of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a b)"
+PASS document.querySelector(":nth-last-child(-n of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a + b)"
+PASS document.querySelector(":nth-last-child(-n of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a + b)"
+PASS document.querySelector(":nth-last-child(-n of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a ~ b)"
+PASS document.querySelector(":nth-last-child(-n of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a ~ b)"
+PASS document.querySelector(":nth-last-child(-n of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-n of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-n of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, a)"
+PASS document.querySelector(":nth-last-child(-n of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, a)"
+PASS document.querySelector(":nth-last-child(-n of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, b)"
+PASS document.querySelector(":nth-last-child(-n of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, b)"
+PASS document.querySelector(":nth-last-child(-n of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-n of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-n of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-n of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-n of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-n of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of *)"
+PASS document.querySelector(":nth-last-child(3 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of *)"
+PASS document.querySelector(":nth-last-child(3 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of foobar)"
+PASS document.querySelector(":nth-last-child(3 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of foobar)"
+PASS document.querySelector(":nth-last-child(3 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of #id)"
+PASS document.querySelector(":nth-last-child(3 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of #id)"
+PASS document.querySelector(":nth-last-child(3 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .class)"
+PASS document.querySelector(":nth-last-child(3 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .class)"
+PASS document.querySelector(":nth-last-child(3 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of :first-child)"
+PASS document.querySelector(":nth-last-child(3 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of :first-child)"
+PASS document.querySelector(":nth-last-child(3 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of :last-child)"
+PASS document.querySelector(":nth-last-child(3 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of :last-child)"
+PASS document.querySelector(":nth-last-child(3 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a > b)"
+PASS document.querySelector(":nth-last-child(3 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a > b)"
+PASS document.querySelector(":nth-last-child(3 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a b)"
+PASS document.querySelector(":nth-last-child(3 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a b)"
+PASS document.querySelector(":nth-last-child(3 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a + b)"
+PASS document.querySelector(":nth-last-child(3 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a + b)"
+PASS document.querySelector(":nth-last-child(3 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, a)"
+PASS document.querySelector(":nth-last-child(3 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, a)"
+PASS document.querySelector(":nth-last-child(3 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, b)"
+PASS document.querySelector(":nth-last-child(3 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, b)"
+PASS document.querySelector(":nth-last-child(3 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of *)"
+PASS document.querySelector(":nth-last-child(-3 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of *)"
+PASS document.querySelector(":nth-last-child(-3 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of foobar)"
+PASS document.querySelector(":nth-last-child(-3 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of foobar)"
+PASS document.querySelector(":nth-last-child(-3 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of #id)"
+PASS document.querySelector(":nth-last-child(-3 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of #id)"
+PASS document.querySelector(":nth-last-child(-3 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .class)"
+PASS document.querySelector(":nth-last-child(-3 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .class)"
+PASS document.querySelector(":nth-last-child(-3 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a > b)"
+PASS document.querySelector(":nth-last-child(-3 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a > b)"
+PASS document.querySelector(":nth-last-child(-3 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a b)"
+PASS document.querySelector(":nth-last-child(-3 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a b)"
+PASS document.querySelector(":nth-last-child(-3 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a + b)"
+PASS document.querySelector(":nth-last-child(-3 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a + b)"
+PASS document.querySelector(":nth-last-child(-3 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, a)"
+PASS document.querySelector(":nth-last-child(-3 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, a)"
+PASS document.querySelector(":nth-last-child(-3 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, b)"
+PASS document.querySelector(":nth-last-child(-3 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, b)"
+PASS document.querySelector(":nth-last-child(-3 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n+0 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of *)"
+PASS document.querySelector(":nth-last-child(n+0 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of *)"
+PASS document.querySelector(":nth-last-child(n+0 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of foobar)"
+PASS document.querySelector(":nth-last-child(n+0 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of foobar)"
+PASS document.querySelector(":nth-last-child(n+0 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of #id)"
+PASS document.querySelector(":nth-last-child(n+0 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of #id)"
+PASS document.querySelector(":nth-last-child(n+0 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .class)"
+PASS document.querySelector(":nth-last-child(n+0 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .class)"
+PASS document.querySelector(":nth-last-child(n+0 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of :first-child)"
+PASS document.querySelector(":nth-last-child(n+0 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of :first-child)"
+PASS document.querySelector(":nth-last-child(n+0 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of :last-child)"
+PASS document.querySelector(":nth-last-child(n+0 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of :last-child)"
+PASS document.querySelector(":nth-last-child(n+0 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n+0 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n+0 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n+0 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n+0 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of #id:empty)"
+PASS document.querySelector(":nth-last-child(n+0 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of #id:empty)"
+PASS document.querySelector(":nth-last-child(n+0 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a > b)"
+PASS document.querySelector(":nth-last-child(n+0 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a > b)"
+PASS document.querySelector(":nth-last-child(n+0 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a b)"
+PASS document.querySelector(":nth-last-child(n+0 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a b)"
+PASS document.querySelector(":nth-last-child(n+0 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a + b)"
+PASS document.querySelector(":nth-last-child(n+0 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a + b)"
+PASS document.querySelector(":nth-last-child(n+0 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a ~ b)"
+PASS document.querySelector(":nth-last-child(n+0 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a ~ b)"
+PASS document.querySelector(":nth-last-child(n+0 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n+0 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n+0 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, a)"
+PASS document.querySelector(":nth-last-child(n+0 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, a)"
+PASS document.querySelector(":nth-last-child(n+0 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, b)"
+PASS document.querySelector(":nth-last-child(n+0 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, b)"
+PASS document.querySelector(":nth-last-child(n+0 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n+0 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n+0 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n+0 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n+0 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n+0 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n-0 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of *)"
+PASS document.querySelector(":nth-last-child(n-0 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of *)"
+PASS document.querySelector(":nth-last-child(n-0 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of foobar)"
+PASS document.querySelector(":nth-last-child(n-0 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of foobar)"
+PASS document.querySelector(":nth-last-child(n-0 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of #id)"
+PASS document.querySelector(":nth-last-child(n-0 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of #id)"
+PASS document.querySelector(":nth-last-child(n-0 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .class)"
+PASS document.querySelector(":nth-last-child(n-0 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .class)"
+PASS document.querySelector(":nth-last-child(n-0 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of :first-child)"
+PASS document.querySelector(":nth-last-child(n-0 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of :first-child)"
+PASS document.querySelector(":nth-last-child(n-0 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of :last-child)"
+PASS document.querySelector(":nth-last-child(n-0 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of :last-child)"
+PASS document.querySelector(":nth-last-child(n-0 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n-0 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(n-0 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n-0 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(n-0 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of #id:empty)"
+PASS document.querySelector(":nth-last-child(n-0 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of #id:empty)"
+PASS document.querySelector(":nth-last-child(n-0 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a > b)"
+PASS document.querySelector(":nth-last-child(n-0 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a > b)"
+PASS document.querySelector(":nth-last-child(n-0 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a b)"
+PASS document.querySelector(":nth-last-child(n-0 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a b)"
+PASS document.querySelector(":nth-last-child(n-0 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a + b)"
+PASS document.querySelector(":nth-last-child(n-0 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a + b)"
+PASS document.querySelector(":nth-last-child(n-0 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a ~ b)"
+PASS document.querySelector(":nth-last-child(n-0 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a ~ b)"
+PASS document.querySelector(":nth-last-child(n-0 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n-0 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(n-0 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, a)"
+PASS document.querySelector(":nth-last-child(n-0 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, a)"
+PASS document.querySelector(":nth-last-child(n-0 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, b)"
+PASS document.querySelector(":nth-last-child(n-0 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, b)"
+PASS document.querySelector(":nth-last-child(n-0 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n-0 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(n-0 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n-0 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(n-0 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(n-0 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(0n of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of *)"
+PASS document.querySelector(":nth-last-child(0n of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of *)"
+PASS document.querySelector(":nth-last-child(0n of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of foobar)"
+PASS document.querySelector(":nth-last-child(0n of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of foobar)"
+PASS document.querySelector(":nth-last-child(0n of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of #id)"
+PASS document.querySelector(":nth-last-child(0n of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of #id)"
+PASS document.querySelector(":nth-last-child(0n of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .class)"
+PASS document.querySelector(":nth-last-child(0n of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .class)"
+PASS document.querySelector(":nth-last-child(0n of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of :first-child)"
+PASS document.querySelector(":nth-last-child(0n of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of :first-child)"
+PASS document.querySelector(":nth-last-child(0n of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of :last-child)"
+PASS document.querySelector(":nth-last-child(0n of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of :last-child)"
+PASS document.querySelector(":nth-last-child(0n of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(0n of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(0n of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(0n of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(0n of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of #id:empty)"
+PASS document.querySelector(":nth-last-child(0n of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of #id:empty)"
+PASS document.querySelector(":nth-last-child(0n of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a > b)"
+PASS document.querySelector(":nth-last-child(0n of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a > b)"
+PASS document.querySelector(":nth-last-child(0n of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a b)"
+PASS document.querySelector(":nth-last-child(0n of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a b)"
+PASS document.querySelector(":nth-last-child(0n of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a + b)"
+PASS document.querySelector(":nth-last-child(0n of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a + b)"
+PASS document.querySelector(":nth-last-child(0n of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a ~ b)"
+PASS document.querySelector(":nth-last-child(0n of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a ~ b)"
+PASS document.querySelector(":nth-last-child(0n of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(0n of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(0n of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, a)"
+PASS document.querySelector(":nth-last-child(0n of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, a)"
+PASS document.querySelector(":nth-last-child(0n of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, b)"
+PASS document.querySelector(":nth-last-child(0n of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, b)"
+PASS document.querySelector(":nth-last-child(0n of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(0n of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(0n of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(0n of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(0n of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(0n of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3n+5 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of *)"
+PASS document.querySelector(":nth-last-child(3n+5 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of *)"
+PASS document.querySelector(":nth-last-child(3n+5 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of #id)"
+PASS document.querySelector(":nth-last-child(3n+5 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of #id)"
+PASS document.querySelector(":nth-last-child(3n+5 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .class)"
+PASS document.querySelector(":nth-last-child(3n+5 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .class)"
+PASS document.querySelector(":nth-last-child(3n+5 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of :first-child)"
+PASS document.querySelector(":nth-last-child(3n+5 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of :first-child)"
+PASS document.querySelector(":nth-last-child(3n+5 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of :last-child)"
+PASS document.querySelector(":nth-last-child(3n+5 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of :last-child)"
+PASS document.querySelector(":nth-last-child(3n+5 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3n+5 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3n+5 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3n+5 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3n+5 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3n+5 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3n+5 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a > b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a > b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a + b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a + b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3n+5 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, a)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, a)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3n+5 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3n+5 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3n+5 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3n+5 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3n+5 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of *)"
+PASS document.querySelector(":nth-last-child(-3n+5 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of *)"
+PASS document.querySelector(":nth-last-child(-3n+5 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of #id)"
+PASS document.querySelector(":nth-last-child(-3n+5 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of #id)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .class)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .class)"
+PASS document.querySelector(":nth-last-child(-3n+5 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3n+5 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3n+5 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3n+5 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3n+5 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3n+5 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3n+5 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3n+5 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3n+5 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a > b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a > b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a + b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a + b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, a)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, a)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n+5 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3n-5 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of *)"
+PASS document.querySelector(":nth-last-child(3n-5 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of *)"
+PASS document.querySelector(":nth-last-child(3n-5 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of #id)"
+PASS document.querySelector(":nth-last-child(3n-5 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of #id)"
+PASS document.querySelector(":nth-last-child(3n-5 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .class)"
+PASS document.querySelector(":nth-last-child(3n-5 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .class)"
+PASS document.querySelector(":nth-last-child(3n-5 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of :first-child)"
+PASS document.querySelector(":nth-last-child(3n-5 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of :first-child)"
+PASS document.querySelector(":nth-last-child(3n-5 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of :last-child)"
+PASS document.querySelector(":nth-last-child(3n-5 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of :last-child)"
+PASS document.querySelector(":nth-last-child(3n-5 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3n-5 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(3n-5 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3n-5 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(3n-5 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3n-5 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(3n-5 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a > b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a > b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a + b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a + b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3n-5 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, a)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, a)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3n-5 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(3n-5 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3n-5 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(3n-5 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(3n-5 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of *)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of *)"
+PASS document.querySelector(":nth-last-child(-3n-5 of * )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of *)"
+PASS document.querySelector(":nth-last-child(-3n-5 of foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 of foobar )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 of #id)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of #id)"
+PASS document.querySelector(":nth-last-child(-3n-5 of #id )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of #id)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .class)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .class)"
+PASS document.querySelector(":nth-last-child(-3n-5 of :first-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3n-5 of :first-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of :first-child)"
+PASS document.querySelector(":nth-last-child(-3n-5 of :last-child)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3n-5 of :last-child )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of :last-child)"
+PASS document.querySelector(":nth-last-child(-3n-5 of foobar#id.class)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3n-5 of foobar#id.class )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of foobar#id.class)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .class:not(.notclass))") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3n-5 of .class:not(.notclass) )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .class:not(.notclass))"
+PASS document.querySelector(":nth-last-child(-3n-5 of #id:empty)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3n-5 of #id:empty )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of #id:empty)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a > b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a > b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a > b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a > b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a + b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a + b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a + b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a + b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a + b > c ~ d e + g)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a + b > c ~ d e + g )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a + b > c ~ d e + g)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, a)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, a)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, a )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, a)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, b, c, d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a, b, c, d )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .foo, .bar, .baz)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .foo, .bar, .baz )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foo, .bar, .baz)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a > b, a b, a + b, a ~ b)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a > b, a b, a + b, a ~ b)"
+PASS document.querySelector(":nth-last-child(-3n-5 of a > b, a b, a + b, a ~ b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of a > b, a b, a + b, a ~ b)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-1.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style-container">
+</style>
+</head>
+<body>
+</body>
+<script>
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testValidSelector(selectorString, expectedSerializedSelector) {
+ shouldNotThrow('document.querySelector(":nth-last-child(' + selectorString.replace(/\\/g, '\\\\') + ')")', '"Error: SyntaxError: DOM Exception 12"');
+
+ var styleContainer = document.getElementById('style-container');
+ styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+ shouldBe("document.getElementById('style-container').sheet.cssRules.length", "1");
+ if (!expectedSerializedSelector)
+ expectedSerializedSelector = selectorString;
+ shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[0].selectorText", ':nth-last-child(' + expectedSerializedSelector + ')');
+ styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+ "even",
+ "odd",
+ "n",
+ "-n",
+ "3",
+ "-3",
+ "n+0",
+ "n-0",
+ "0n",
+ "3n+5",
+ "-3n+5",
+ "3n-5",
+ "-3n-5",
+];
+
+debug("Basic valid cases without [of selectors]");
+for (var i = 0; i < validNthAnPlusB.length; ++i)
+ testValidSelector(validNthAnPlusB[i], validNthAnPlusB[i]);
+
+var validRightSide = [
+ // Basic types.
+ "*",
+ "foobar",
+ "#id",
+ ".class",
+ ":first-child",
+ ":last-child",
+
+ // Compound selectors.
+ "foobar#id.class",
+ ".class:not(.notclass)",
+ "#id:empty",
+
+ // Complex selectors.
+ "a > b",
+ "a b",
+ "a + b",
+ "a ~ b",
+ "a + b > c ~ d e + g",
+
+ // Selector lists.
+ "a, a",
+ "a, b",
+ "a, b, c, d",
+ ".foo, .bar, .baz",
+ "a > b, a b, a + b, a ~ b",
+];
+
+debug("Basic cases with [of selectors]");
+for (var leftSideIndex = 0; leftSideIndex < validNthAnPlusB.length; ++leftSideIndex) {
+ for (var rightSideIndex = 0; rightSideIndex < validRightSide.length; ++rightSideIndex) {
+ var selectorString = validNthAnPlusB[leftSideIndex] + " of " + validRightSide[rightSideIndex];
+ testValidSelector(selectorString);
+ testValidSelector(selectorString + " ", selectorString);
+ }
+}
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,700 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test serizalization.
+PASS document.querySelector(":nth-last-child(2n+1 of a,b,c,d)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of a, b, c, d)"
+PASS document.querySelector(":nth-last-child( 2n+1 of a, b )") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of a, b)"
+PASS document.querySelector(":nth-last-child(2n+1 of a>b, c d, e~f, g+h)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of a > b, c d, e ~ f, g + h)"
+PASS document.querySelector(":nth-last-child(2n+1 of n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of n)"
+PASS document.querySelector(":nth-last-child(2n+1 of n-1)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of n-1)"
+PASS document.querySelector(":nth-last-child(2n+1 of .n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of .n)"
+PASS document.querySelector(":nth-last-child(2n+1 of .-n-1)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of .-n-1)"
+PASS document.querySelector(":nth-last-child(2n+1 of .n-1)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of .n-1)"
+PASS document.querySelector(":nth-last-child(2n+1 of n+n)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(2n+1 of n + n)"
+PASS document.querySelector(":nth-last-child(even of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(odd of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(n of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(3 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(0n of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 Of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 oF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 OF .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(even \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(even of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(odd \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(odd of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(n \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(-n \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-n of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(3 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n+0 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n+0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(n-0 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(n-0 of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(0n \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(0n of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n+5 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n+5 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n+5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(3n-5 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\of .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\00006ff .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 o\\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\00006F \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\00004f \\000066 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\00006F \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\00004f \\000046 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\6f f .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 o\\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\6F \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\4f \\66 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\6F \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS document.querySelector(":nth-last-child(-3n-5 \\4f \\46 .foobar)") did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is ":nth-last-child(-3n-5 of .foobar)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-2.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style-container">
+</style>
+</head>
+<body>
+</body>
+<script>
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testValidSelector(selectorString, expectedSerializedSelector) {
+ shouldNotThrow('document.querySelector(":nth-last-child(' + selectorString.replace(/\\/g, '\\\\') + ')")', '"Error: SyntaxError: DOM Exception 12"');
+
+ var styleContainer = document.getElementById('style-container');
+ styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+ shouldBe("document.getElementById('style-container').sheet.cssRules.length", "1");
+ if (!expectedSerializedSelector)
+ expectedSerializedSelector = selectorString;
+ shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[0].selectorText", ':nth-last-child(' + expectedSerializedSelector + ')');
+ styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+ "even",
+ "odd",
+ "n",
+ "-n",
+ "3",
+ "-3",
+ "n+0",
+ "n-0",
+ "0n",
+ "3n+5",
+ "-3n+5",
+ "3n-5",
+ "-3n-5",
+];
+
+debug("Test serizalization.");
+testValidSelector("2n+1 of a,b,c,d", "2n+1 of a, b, c, d"); // Space separated complex selector.
+testValidSelector(" 2n+1 of a, b ", "2n+1 of a, b"); // Ignored extra spaces.
+testValidSelector("2n+1 of a>b, c d, e~f, g+h", "2n+1 of a > b, c d, e ~ f, g + h"); // 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("2n+1 of n");
+testValidSelector("2n+1 of n-1"); // "n-1" is a perfectly valid element name.
+testValidSelector("2n+1 of .n");
+testValidSelector("2n+1 of .-n-1");
+testValidSelector("2n+1 of .n-1");
+testValidSelector("2n+1 of n+n", "2n+1 of n + n");
+
+// Test case sensitivity of the separator "of". CSS 2.1 defines that "All CSS syntax is case-insensitive within the ASCII range".
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testValidSelector(validNthAnPlusB[i] + " of .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " Of .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " oF .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " OF .foobar", validNthAnPlusB[i] + " of .foobar");
+}
+
+// CSS 2.1 "Characters and case" (http://www.w3.org/TR/CSS21/syndata.html#characters) section defines escaping for strings and identifiers:
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ // There is no formal definition of escaping of regular characters, but there is a note saying: 'The identifier "te\st" is exactly the same identifier as "test".'.
+ testValidSelector(validNthAnPlusB[i] + " \\of .foobar", validNthAnPlusB[i] + " of .foobar");
+
+ // Full hexadecimal escape ('o' = 0x6f, 'f' = 0x66, 'O' = 0x4f, 'F' = 0x46.
+ testValidSelector(validNthAnPlusB[i] + " \\00006ff .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " o\\000066 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\00006F \\000066 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\00004f \\000066 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\00006F \\000046 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\00004f \\000046 .foobar", validNthAnPlusB[i] + " of .foobar");
+
+ // Short syntax ('o' = 0x6f, 'f' = 0x66, 'O' = 0x4f, 'F' = 0x46.
+ testValidSelector(validNthAnPlusB[i] + " \\6f f .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " o\\66 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\6F \\66 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\4f \\66 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\6F \\46 .foobar", validNthAnPlusB[i] + " of .foobar");
+ testValidSelector(validNthAnPlusB[i] + " \\4f \\46 .foobar", validNthAnPlusB[i] + " of .foobar");
+}
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,634 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test invalid selectors:
+PASS document.querySelector(":nth-last-child(even of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(evenof .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(oddof .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(nof .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-nof .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0nof .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of )") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of.class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5of .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 empty .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 from .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 to .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 webkit .class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ::first-letter)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ::after)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ::-webkit-custom)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of .foo, ::before)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ::before, .foo)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of -webkit-any(::before, .foo))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :nth-last-child(2n+1 of ::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :not(::before))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of .123class)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of #123id)") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of [])") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ())") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of ))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of {})") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of })") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style-container">
+</style>
+</head>
+<body>
+</body>
+<script>
+description('Test the parsing of :nth-last-child(of) for querySelector and style.');
+
+function testInvalidSelector(selectorString) {
+ shouldThrow('document.querySelector(":nth-last-child(' + selectorString + ')")', '"Error: SyntaxError: DOM Exception 12"');
+
+ var styleContainer = document.getElementById('style-container');
+ styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+ shouldBe("document.getElementById('style-container').sheet.cssRules.length", "0");
+ styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+ "even",
+ "odd",
+ "n",
+ "-n",
+ "3",
+ "-3",
+ "n+0",
+ "n-0",
+ "0n",
+ "3n+5",
+ "-3n+5",
+ "3n-5",
+ "-3n-5",
+];
+
+debug("Test invalid selectors:");
+// Missing space characters.
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testInvalidSelector(validNthAnPlusB[i] + " of");
+ testInvalidSelector(validNthAnPlusB[i] + " of ");
+ testInvalidSelector(validNthAnPlusB[i] + " of.class");
+ testInvalidSelector(validNthAnPlusB[i] + "of .class");
+}
+
+// Use valid identifier but not "of" as a separator.
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testInvalidSelector(validNthAnPlusB[i] + " empty .class");
+ testInvalidSelector(validNthAnPlusB[i] + " from .class");
+ testInvalidSelector(validNthAnPlusB[i] + " to .class");
+ testInvalidSelector(validNthAnPlusB[i] + " webkit .class");
+}
+
+// Matching pseudo elements do not make any sense.
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testInvalidSelector(validNthAnPlusB[i] + " of ::first-letter");
+ testInvalidSelector(validNthAnPlusB[i] + " of ::before");
+ testInvalidSelector(validNthAnPlusB[i] + " of ::after");
+ testInvalidSelector(validNthAnPlusB[i] + " of ::-webkit-custom");
+
+ testInvalidSelector(validNthAnPlusB[i] + " of .foo, ::before");
+ testInvalidSelector(validNthAnPlusB[i] + " of ::before, .foo");
+ testInvalidSelector(validNthAnPlusB[i] + " of -webkit-any(::before, .foo)");
+ testInvalidSelector(validNthAnPlusB[i] + " of :nth-last-child(2n+1 of ::before)");
+ testInvalidSelector(validNthAnPlusB[i] + " of :not(::before)");
+}
+
+// Invalid identifiers, syntax, etc.
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testInvalidSelector(validNthAnPlusB[i] + " of .123class");
+ testInvalidSelector(validNthAnPlusB[i] + " of #123id");
+ testInvalidSelector(validNthAnPlusB[i] + " of []");
+ testInvalidSelector(validNthAnPlusB[i] + " of ()");
+ testInvalidSelector(validNthAnPlusB[i] + " of )");
+ testInvalidSelector(validNthAnPlusB[i] + " of {}");
+ testInvalidSelector(validNthAnPlusB[i] + " of }");
+}
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4-expected.txt        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+Test the parsing of :nth-last-child(of) for querySelector and style on deeply nested pseudo elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test invalid selectors:
+PASS document.querySelector(":nth-last-child(even of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(even of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(odd of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-n of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n+0 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(n-0 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(0n of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n+5 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n+5 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(3n-5 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :matches(a, b, c::after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :matches(a, b, c:after))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :nth-last-child(2n+1 of d, e, :matches(f, g, :before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :not(:matches(a, b, c::after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :not(:matches(a, b, c:after)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after)))))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :nth-last-child(odd of :nth-last-child(even of j::before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS document.querySelector(":nth-last-child(-3n-5 of :nth-last-child(odd of :nth-last-child(even of j:before)))") threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.getElementById('style-container').sheet.cssRules.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcssnthlastchildof4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html (0 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html         (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-nth-last-child-of-4.html        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style-container">
+</style>
+</head>
+<body>
+</body>
+<script>
+description('Test the parsing of :nth-last-child(of) for querySelector and style on deeply nested pseudo elements.');
+
+function testInvalidSelector(selectorString) {
+ shouldThrow('document.querySelector(":nth-last-child(' + selectorString + ')")', '"Error: SyntaxError: DOM Exception 12"');
+
+ var styleContainer = document.getElementById('style-container');
+ styleContainer.innerHTML = ':nth-last-child(' + selectorString + ') { }';
+ shouldBe("document.getElementById('style-container').sheet.cssRules.length", "0");
+ styleContainer.innerHTML = '';
+}
+
+// There are multiple ways of parsing :nth-last-child() based on the An+B part, we should test everything.
+var validNthAnPlusB = [
+ "even",
+ "odd",
+ "n",
+ "-n",
+ "3",
+ "-3",
+ "n+0",
+ "n-0",
+ "0n",
+ "3n+5",
+ "-3n+5",
+ "3n-5",
+ "-3n-5",
+];
+
+debug("Test invalid selectors:");
+for (var i = 0; i < validNthAnPlusB.length; ++i) {
+ testInvalidSelector(validNthAnPlusB[i] + " of :matches(a, b, c::after)");
+ testInvalidSelector(validNthAnPlusB[i] + " of :matches(a, b, c:after)");
+ testInvalidSelector(validNthAnPlusB[i] + " of :nth-last-child(2n+1 of d, e, :matches(f, g, ::before))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :nth-last-child(2n+1 of d, e, :matches(f, g, :before))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :not(:matches(a, b, c::after))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :not(:matches(a, b, c:after))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :matches(a, b, :matches(c, d, :matches(e, f, :matches(g, h, i::after))))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :nth-last-child(odd of :nth-last-child(even of j::before))");
+ testInvalidSelector(validNthAnPlusB[i] + " of :nth-last-child(odd of :nth-last-child(even of j:before))");
+
+}
+
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/ChangeLog        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-11-10 Benjamin Poulain <bpoulain@apple.com>
+
+ Add parsing support for the extended :nth-last-child(An+B of selector-list) defined
+ https://bugs.webkit.org/show_bug.cgi?id=138520
+
+ Reviewed by Andreas Kling.
+
+ Add parsing for :nth-last-child(An+B of selector-list). The selector is defined
+ in CSS Selectors Level 4: http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo
+
+ Tests: fast/css/parsing-css-nth-last-child-of-1.html
+ fast/css/parsing-css-nth-last-child-of-2.html
+ fast/css/parsing-css-nth-last-child-of-3.html
+ fast/css/parsing-css-nth-last-child-of-4.html
+
+ * css/CSSGrammar.y.in:
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::detectFunctionTypeToken):
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::selectorText):
+
</ins><span class="cx"> 2014-11-10 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> SVG foreign objects do not inherit the container coordinates system if they are repainted.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> case CALCFUNCTION:
</span><span class="cx"> case MINFUNCTION:
</span><span class="cx"> case MAXFUNCTION:
</span><del>- case NTHCHILDFUNCTION:
</del><ins>+ case NTHCHILDFUNCTIONS:
</ins><span class="cx"> case NTHCHILDSELECTORSEPARATOR:
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> case LANGFUNCTION:
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> %token <string> CALCFUNCTION
</span><span class="cx"> %token <string> MINFUNCTION
</span><span class="cx"> %token <string> MAXFUNCTION
</span><del>-%token <string> NTHCHILDFUNCTION
</del><ins>+%token <string> NTHCHILDFUNCTIONS
</ins><span class="cx">
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> %token <string> LANGFUNCTION
</span><span class="lines">@@ -1389,7 +1389,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // Definition of :nth-child().
</span><del>- | ':' NTHCHILDFUNCTION maybe_space NTH nth_selector_ending {
</del><ins>+ | ':' NTHCHILDFUNCTIONS maybe_space NTH nth_selector_ending {
</ins><span class="cx"> $$ = nullptr;
</span><span class="cx"> if (selectorListDoesNotMatchAnyPseudoElement($5)) {
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="lines">@@ -1398,11 +1398,13 @@
</span><span class="cx"> selector->setPseudoClassValue($2);
</span><span class="cx"> if ($5)
</span><span class="cx"> selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($5));
</span><del>- if (selector->pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+
+ CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
+ if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- | ':' NTHCHILDFUNCTION maybe_space maybe_unary_operator INTEGER nth_selector_ending {
</del><ins>+ | ':' NTHCHILDFUNCTIONS maybe_space maybe_unary_operator INTEGER nth_selector_ending {
</ins><span class="cx"> $$ = nullptr;
</span><span class="cx"> if (selectorListDoesNotMatchAnyPseudoElement($6)) {
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="lines">@@ -1411,11 +1413,12 @@
</span><span class="cx"> selector->setPseudoClassValue($2);
</span><span class="cx"> if ($6)
</span><span class="cx"> selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($6));
</span><del>- if (selector->pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+ CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
+ if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- | ':' NTHCHILDFUNCTION maybe_space IDENT nth_selector_ending {
</del><ins>+ | ':' NTHCHILDFUNCTIONS maybe_space IDENT nth_selector_ending {
</ins><span class="cx"> $$ = nullptr;
</span><span class="cx"> if (isValidNthToken($4) && selectorListDoesNotMatchAnyPseudoElement($5)) {
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="lines">@@ -1424,7 +1427,8 @@
</span><span class="cx"> selector->setPseudoClassValue($2);
</span><span class="cx"> if ($5)
</span><span class="cx"> selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($5));
</span><del>- if (selector->pseudoClassType() == CSSSelector::PseudoClassNthChild)
</del><ins>+ CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
+ if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
</ins><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -10692,7 +10692,7 @@
</span><span class="cx">
</span><span class="cx"> case 9:
</span><span class="cx"> if (isEqualToCSSIdentifier(name, "nth-child")) {
</span><del>- m_token = NTHCHILDFUNCTION;
</del><ins>+ m_token = NTHCHILDFUNCTIONS;
</ins><span class="cx"> m_parsingMode = NthChildMode;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -10707,6 +10707,7 @@
</span><span class="cx">
</span><span class="cx"> case 14:
</span><span class="cx"> if (isEqualToCSSIdentifier(name, "nth-last-child")) {
</span><ins>+ m_token = NTHCHILDFUNCTIONS;
</ins><span class="cx"> m_parsingMode = NthChildMode;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (175847 => 175848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-11 03:25:36 UTC (rev 175847)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-11 03:49:08 UTC (rev 175848)
</span><span class="lines">@@ -466,7 +466,16 @@
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassNthLastChild:
</span><span class="cx"> str.appendLiteral(":nth-last-child(");
</span><del>- appendPseudoClassFunctionTail(str, cs);
</del><ins>+ str.append(cs->argument());
+#if ENABLE(CSS_SELECTORS_LEVEL4)
+ if (const CSSSelectorList* selectorList = cs->selectorList()) {
+ str.appendLiteral(" of ");
+ appendSelectorList(str, selectorList);
+ }
+#else
+ ASSERT(!cs->selectorList());
+#endif
+ str.append(')');
</ins><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassNthLastOfType:
</span><span class="cx"> str.appendLiteral(":nth-last-of-type(");
</span></span></pre>
</div>
</div>
</body>
</html>