<!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>[174613] 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/174613">174613</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-10 14:23:37 -0700 (Fri, 10 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update :nth-child(An+B of selector-list) to the latest specification
https://bugs.webkit.org/show_bug.cgi?id=137593

Reviewed by Andreas Kling.

Source/WebCore:

Following my implementation feedback on :nth-child(An+B of selector-list),
the CSS WG decided to change the definition such that the current element on which
the selector is matched must also match the selector list in :nth-child().

This patch updates the implementation accordingly.

Test: fast/selectors/nth-child-of-chained-3.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
(WebCore::SelectorChecker::matchSelectorList):
* css/SelectorChecker.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):

LayoutTests:

* fast/selectors/nth-child-of-chained-3-expected.txt: Added.
* fast/selectors/nth-child-of-chained-3.html: Added.
This is an interesting new case with the new definition. Since the initial
element must also match the selector, it is now possible to fail even
if the combination An+B can match anything.

* fast/css/nth-child-of-classname-expected.html:
* fast/css/nth-child-of-classname.html:
* fast/css/nth-child-of-compound-selector-expected.html:
* fast/css/nth-child-of-compound-selector.html:
* fast/css/nth-child-of-tagname-expected.html:
* fast/css/nth-child-of-tagname.html:
* fast/selectors/nth-child-of-backtracking-adjacent-2.html:
* fast/selectors/nth-child-of-backtracking-adjacent.html:
* fast/selectors/nth-child-of-basics-2-expected.txt:
* fast/selectors/nth-child-of-basics-2.html:
* fast/selectors/nth-child-of-basics-expected.txt:
* fast/selectors/nth-child-of-basics.html:
* fast/selectors/nth-child-of-chained-2-expected.txt:
* fast/selectors/nth-child-of-chained-2.html:
* fast/selectors/nth-child-of-complex-selectors-expected.txt:
* fast/selectors/nth-child-of-complex-selectors.html:
* fast/selectors/nth-child-of-never-matching-selector-expected.txt:
* fast/selectors/nth-child-of-never-matching-selector.html:
* fast/selectors/nth-child-of-selector-list-expected.txt:
* fast/selectors/nth-child-of-selector-list.html:
Updating the test and tests result for the new definition.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildofclassnameexpectedhtml">trunk/LayoutTests/fast/css/nth-child-of-classname-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildofclassnamehtml">trunk/LayoutTests/fast/css/nth-child-of-classname.html</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildofcompoundselectorexpectedhtml">trunk/LayoutTests/fast/css/nth-child-of-compound-selector-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildofcompoundselectorhtml">trunk/LayoutTests/fast/css/nth-child-of-compound-selector.html</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildoftagnameexpectedhtml">trunk/LayoutTests/fast/css/nth-child-of-tagname-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssnthchildoftagnamehtml">trunk/LayoutTests/fast/css/nth-child-of-tagname.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbacktrackingadjacent2html">trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbacktrackingadjacenthtml">trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbasics2expectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-basics-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbasics2html">trunk/LayoutTests/fast/selectors/nth-child-of-basics-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbasicsexpectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofbasicshtml">trunk/LayoutTests/fast/selectors/nth-child-of-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofchained2expectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-chained-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofchained2html">trunk/LayoutTests/fast/selectors/nth-child-of-chained-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofcomplexselectorsexpectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofcomplexselectorshtml">trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofnevermatchingselectorexpectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofnevermatchingselectorhtml">trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofselectorlistexpectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-selector-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofselectorlisthtml">trunk/LayoutTests/fast/selectors/nth-child-of-selector-list.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerh">trunk/Source/WebCore/css/SelectorChecker.h</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofchained3expectedtxt">trunk/LayoutTests/fast/selectors/nth-child-of-chained-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsnthchildofchained3html">trunk/LayoutTests/fast/selectors/nth-child-of-chained-3.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/ChangeLog        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-10-10  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Update :nth-child(An+B of selector-list) to the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=137593
+
+        Reviewed by Andreas Kling.
+
+        * fast/selectors/nth-child-of-chained-3-expected.txt: Added.
+        * fast/selectors/nth-child-of-chained-3.html: Added.
+        This is an interesting new case with the new definition. Since the initial
+        element must also match the selector, it is now possible to fail even
+        if the combination An+B can match anything.
+
+        * fast/css/nth-child-of-classname-expected.html:
+        * fast/css/nth-child-of-classname.html:
+        * fast/css/nth-child-of-compound-selector-expected.html:
+        * fast/css/nth-child-of-compound-selector.html:
+        * fast/css/nth-child-of-tagname-expected.html:
+        * fast/css/nth-child-of-tagname.html:
+        * fast/selectors/nth-child-of-backtracking-adjacent-2.html:
+        * fast/selectors/nth-child-of-backtracking-adjacent.html:
+        * fast/selectors/nth-child-of-basics-2-expected.txt:
+        * fast/selectors/nth-child-of-basics-2.html:
+        * fast/selectors/nth-child-of-basics-expected.txt:
+        * fast/selectors/nth-child-of-basics.html:
+        * fast/selectors/nth-child-of-chained-2-expected.txt:
+        * fast/selectors/nth-child-of-chained-2.html:
+        * fast/selectors/nth-child-of-complex-selectors-expected.txt:
+        * fast/selectors/nth-child-of-complex-selectors.html:
+        * fast/selectors/nth-child-of-never-matching-selector-expected.txt:
+        * fast/selectors/nth-child-of-never-matching-selector.html:
+        * fast/selectors/nth-child-of-selector-list-expected.txt:
+        * fast/selectors/nth-child-of-selector-list.html:
+        Updating the test and tests result for the new definition.
+
</ins><span class="cx"> 2014-10-10  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Update a Mavericks-specific baseline.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildofclassnameexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-classname-expected.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-classname-expected.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-classname-expected.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -3,14 +3,14 @@
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">     &lt;p&gt;This test the styling of paragraphs with :nth-child(An+B of selector). If the test succeed, paragraphs that say &quot;green&quot; should have a green background.&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;webkit&quot;&gt;White&lt;/p&gt;
</span><ins>+    &lt;p&gt;White&lt;/p&gt;
+    &lt;p&gt;White&lt;/p&gt;
</ins><span class="cx">     &lt;p style=&quot;background-color: lime&quot;&gt;Green!&lt;/p&gt;
</span><del>-    &lt;p style=&quot;background-color: lime&quot;&gt;Green!&lt;/p&gt;
-    &lt;p style=&quot;background-color: lime&quot;&gt;Green!&lt;/p&gt;
</del><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><ins>+    &lt;p&gt;White&lt;/p&gt;
</ins><span class="cx">     &lt;p style=&quot;background-color: lime&quot;&gt;Green!&lt;/p&gt;
</span><del>-    &lt;p style=&quot;background-color: lime&quot;&gt;Green!&lt;/p&gt;
</del><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildofclassnamehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-classname.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-classname.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-classname.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -10,13 +10,13 @@
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">     &lt;p&gt;This test the styling of paragraphs with :nth-child(An+B of selector). If the test succeed, paragraphs that say &quot;green&quot; should have a green background.&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;webkit&quot;&gt;White&lt;/p&gt;
</span><del>-    &lt;p&gt;Green!&lt;/p&gt;
-    &lt;p&gt;Green!&lt;/p&gt;
</del><ins>+    &lt;p&gt;White&lt;/p&gt;
+    &lt;p&gt;White&lt;/p&gt;
</ins><span class="cx">     &lt;p class=&quot;fast&quot;&gt;Green!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;webkit&quot;&gt;White&lt;/p&gt;
</span><del>-    &lt;p&gt;Green!&lt;/p&gt;
</del><ins>+    &lt;p&gt;White&lt;/p&gt;
</ins><span class="cx">     &lt;p class=&quot;webkit&quot;&gt;Green!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White&lt;/p&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildofcompoundselectorexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-compound-selector-expected.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-compound-selector-expected.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-compound-selector-expected.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -7,12 +7,12 @@
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><ins>+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx">     &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
</span><del>-    &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
</del><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><del>-    &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
</del><ins>+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildofcompoundselectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-compound-selector.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-compound-selector.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-compound-selector.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -15,12 +15,12 @@
</span><span class="cx">     &lt;p class=&quot;foobar foo&quot;&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;foo foobar&quot;&gt;White!&lt;/p&gt;
</span><del>-    &lt;p&gt;Green&lt;/p&gt;
</del><ins>+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx">     &lt;p class=&quot;foobar foo&quot;&gt;Green&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;foobar&quot;&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;foo foobar&quot;&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;foobar&quot;&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p class=&quot;foo foobar baz&quot;&gt;White!&lt;/p&gt;
</span><del>-    &lt;p&gt;Green&lt;/p&gt;
</del><ins>+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildoftagnameexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-tagname-expected.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-tagname-expected.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-tagname-expected.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -6,11 +6,11 @@
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;fast&gt;White!&lt;/fast&gt;
</span><del>-    &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
-    &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
</del><ins>+    &lt;p&gt;White!&lt;/p&gt;
+    &lt;p&gt;White!&lt;/p&gt;
+    &lt;webkit style=&quot;background-color: lime&quot;&gt;Green&lt;/webkit&gt;
+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx">     &lt;webkit&gt;White!&lt;/webkit&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><del>-    &lt;webkit&gt;White!&lt;/webkit&gt;
-    &lt;p style=&quot;background-color: lime&quot;&gt;Green&lt;/p&gt;
</del><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssnthchildoftagnamehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/nth-child-of-tagname.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/nth-child-of-tagname.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/css/nth-child-of-tagname.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;style&gt;
</span><del>-p:nth-child(odd of webkit, fast) {
</del><ins>+:nth-child(odd of webkit, fast) {
</ins><span class="cx">     background-color: lime;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><span class="lines">@@ -13,11 +13,11 @@
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><span class="cx">     &lt;fast&gt;White!&lt;/fast&gt;
</span><del>-    &lt;p&gt;Green&lt;/p&gt;
-    &lt;p&gt;Green&lt;/p&gt;
</del><ins>+    &lt;p&gt;White!&lt;/p&gt;
+    &lt;p&gt;White!&lt;/p&gt;
+    &lt;webkit&gt;Green&lt;/webkit&gt;
+    &lt;p&gt;White!&lt;/p&gt;
</ins><span class="cx">     &lt;webkit&gt;White!&lt;/webkit&gt;
</span><span class="cx">     &lt;p&gt;White!&lt;/p&gt;
</span><del>-    &lt;webkit&gt;White!&lt;/webkit&gt;
-    &lt;p&gt;Green&lt;/p&gt;
</del><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbacktrackingadjacent2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent-2.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent-2.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent-2.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -3,65 +3,65 @@
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;style&gt;
</span><del>-span.target {
</del><ins>+sibling.target {
</ins><span class="cx">     background-color:rgb(0,0,0);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of a + b sibling) {
</del><ins>+sibling.target:nth-child(n+2 of a + b sibling) {
</ins><span class="cx">     background-color:rgb(1,2,3);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of c + c + d sibling) {
</del><ins>+sibling.target:nth-child(n+2 of c + c + d sibling) {
</ins><span class="cx">     background-color:rgb(4,5,6);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of e + f ~ g sibling) {
</del><ins>+sibling.target:nth-child(n+2 of e + f ~ g sibling) {
</ins><span class="cx">     background-color:rgb(7,8,9);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of h + sibling) {
</del><ins>+sibling.target:nth-child(n+2 of h + sibling) {
</ins><span class="cx">     background-color:rgb(10,11,12);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) {
</del><ins>+sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) {
</ins><span class="cx">     background-color:rgb(13,14,15);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) {
</del><ins>+sibling.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) {
</ins><span class="cx">     background-color:rgb(16,17,18);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) {
</del><ins>+sibling.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) {
</ins><span class="cx">     background-color:rgb(19,20,21);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of p ~ sibling) {
</del><ins>+sibling.target:nth-child(n+2 of p ~ sibling) {
</ins><span class="cx">     background-color:rgb(22,23,24);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of q ~ r sibling) {
</del><ins>+sibling.target:nth-child(n+2 of q ~ r sibling) {
</ins><span class="cx">     background-color:rgb(25,26,27);
</span><span class="cx"> }
</span><del>-span.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) {
</del><ins>+sibling.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) {
</ins><span class="cx">     background-color:rgb(28,29,30);
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div style=&quot;display:none&quot;&gt;
</span><del>-    &lt;!-- span.target:nth-child(n+2 of a + b sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of a + b sibling) --&gt;
</ins><span class="cx">     &lt;target1&gt;
</span><span class="cx">         &lt;a&gt;&lt;/a&gt;
</span><span class="cx">         &lt;b&gt;
</span><span class="cx">             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-            &lt;span class=&quot;target&quot; id=&quot;target1&quot;&gt;&lt;/span&gt;
</del><ins>+            &lt;sibling class=&quot;target&quot; id=&quot;target1&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">         &lt;/b&gt;
</span><span class="cx">     &lt;/target1&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of a + b sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of a + b sibling) --&gt;
</ins><span class="cx">     &lt;target2&gt;
</span><span class="cx">         &lt;a&gt;&lt;/a&gt;
</span><span class="cx">         &lt;b&gt;
</span><span class="cx">             &lt;b&gt;&lt;/b&gt;  &lt;!-- Fail here and restart backtracking. --&gt;
</span><span class="cx">             &lt;b&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target2&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target2&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/b&gt;
</span><span class="cx">         &lt;/b&gt;
</span><span class="cx">     &lt;/target2&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of c + c + d sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of c + c + d sibling) --&gt;
</ins><span class="cx">     &lt;target3&gt;
</span><span class="cx">         &lt;c&gt;&lt;/c&gt;
</span><span class="cx">         &lt;c&gt;&lt;/c&gt;
</span><span class="lines">@@ -73,13 +73,13 @@
</span><span class="cx">                 &lt;c&gt;&lt;/c&gt;
</span><span class="cx">                 &lt;d&gt;
</span><span class="cx">                     &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                    &lt;span class=&quot;target&quot; id=&quot;target3&quot;&gt;&lt;/span&gt;
</del><ins>+                    &lt;sibling class=&quot;target&quot; id=&quot;target3&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                 &lt;/d&gt;
</span><span class="cx">             &lt;/d&gt;
</span><span class="cx">         &lt;/d&gt;
</span><span class="cx">     &lt;/target3&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of e + f ~ g sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of e + f ~ g sibling) --&gt;
</ins><span class="cx">     &lt;target4&gt;
</span><span class="cx">         &lt;d&gt;&lt;/d&gt;
</span><span class="cx">         &lt;e&gt;&lt;/e&gt;
</span><span class="lines">@@ -91,32 +91,33 @@
</span><span class="cx">             &lt;f&gt;&lt;/f&gt;
</span><span class="cx">             &lt;g&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target4&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target4&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/g&gt;
</span><span class="cx">         &lt;/g&gt;
</span><span class="cx">     &lt;/target4&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</ins><span class="cx">     &lt;target6&gt;
</span><span class="cx">         &lt;h&gt;&lt;/h&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target6.1&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;h&gt;&lt;/h&gt;        
+        &lt;sibling class=&quot;target&quot; id=&quot;target6.1&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target6&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</ins><span class="cx">     &lt;target6&gt;
</span><span class="cx">         &lt;a&gt;&lt;/a&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target6.2&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;sibling class=&quot;target&quot; id=&quot;target6.2&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target6&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</ins><span class="cx">     &lt;target6&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target6.3&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;sibling class=&quot;target&quot; id=&quot;target6.3&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target6&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</ins><span class="cx">     &lt;target7&gt;
</span><span class="cx">         &lt;d&gt;&lt;/d&gt;  &lt;!-- Fail here. --&gt;
</span><span class="cx">         &lt;j&gt;&lt;/j&gt;
</span><span class="lines">@@ -124,11 +125,11 @@
</span><span class="cx">         &lt;j&gt;&lt;/j&gt;
</span><span class="cx">         &lt;k&gt;
</span><span class="cx">             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-            &lt;span class=&quot;target&quot; id=&quot;target7&quot;&gt;&lt;/span&gt;
</del><ins>+            &lt;sibling class=&quot;target&quot; id=&quot;target7&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">         &lt;/k&gt;
</span><span class="cx">     &lt;/target7&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of j+j+j~j&gt;k sibling) --&gt;
</ins><span class="cx">     &lt;target8&gt;
</span><span class="cx">         &lt;j&gt;&lt;/j&gt;  &lt;!-- Match here. --&gt;
</span><span class="cx">         &lt;j&gt;&lt;/j&gt;
</span><span class="lines">@@ -140,12 +141,12 @@
</span><span class="cx">         &lt;j&gt;
</span><span class="cx">             &lt;k&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target8&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target8&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/k&gt;
</span><span class="cx">         &lt;/j&gt;
</span><span class="cx">     &lt;/target8&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) --&gt;
</ins><span class="cx">     &lt;target9&gt;
</span><span class="cx">         &lt;m&gt;
</span><span class="cx">             &lt;l&gt;&lt;/l&gt;  &lt;!-- Fail here --&gt;
</span><span class="lines">@@ -161,7 +162,7 @@
</span><span class="cx">                     &lt;m&gt;
</span><span class="cx">                         &lt;m&gt;
</span><span class="cx">                             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                            &lt;span class=&quot;target&quot; id=&quot;target9&quot;&gt;&lt;/span&gt;
</del><ins>+                            &lt;sibling class=&quot;target&quot; id=&quot;target9&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                         &lt;/m&gt;
</span><span class="cx">                     &lt;/m&gt;
</span><span class="cx">                 &lt;/m&gt;
</span><span class="lines">@@ -169,7 +170,7 @@
</span><span class="cx">         &lt;/m&gt;
</span><span class="cx">     &lt;/target9&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of m l+l+l+l~m&gt;m&gt;m sibling) --&gt;
</ins><span class="cx">     &lt;target10&gt;
</span><span class="cx">         &lt;m&gt;
</span><span class="cx">             &lt;l&gt;&lt;/l&gt;  &lt;!-- Match here --&gt;
</span><span class="lines">@@ -186,7 +187,7 @@
</span><span class="cx">                     &lt;m&gt;
</span><span class="cx">                         &lt;m&gt;
</span><span class="cx">                             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                            &lt;span class=&quot;target&quot; id=&quot;target10&quot;&gt;&lt;/span&gt;
</del><ins>+                            &lt;sibling class=&quot;target&quot; id=&quot;target10&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                         &lt;/m&gt;
</span><span class="cx">                     &lt;/m&gt;
</span><span class="cx">                 &lt;/m&gt;
</span><span class="lines">@@ -194,7 +195,7 @@
</span><span class="cx">         &lt;/m&gt;
</span><span class="cx">     &lt;/target10&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) --&gt;
</ins><span class="cx">     &lt;target11&gt;
</span><span class="cx">         &lt;n&gt;
</span><span class="cx">             &lt;a&gt;&lt;/a&gt;  &lt;!-- Fail here --&gt;
</span><span class="lines">@@ -205,7 +206,7 @@
</span><span class="cx">                     &lt;n&gt;
</span><span class="cx">                         &lt;n&gt;
</span><span class="cx">                             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                            &lt;span class=&quot;target&quot; id=&quot;target11&quot;&gt;&lt;/span&gt;
</del><ins>+                            &lt;sibling class=&quot;target&quot; id=&quot;target11&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                         &lt;/n&gt;
</span><span class="cx">                     &lt;/n&gt;
</span><span class="cx">                 &lt;/n&gt;
</span><span class="lines">@@ -213,7 +214,7 @@
</span><span class="cx">         &lt;/n&gt;
</span><span class="cx">     &lt;/target11&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of n o~n&gt;n&gt;n sibling) --&gt;
</ins><span class="cx">     &lt;target12&gt;
</span><span class="cx">         &lt;n&gt;
</span><span class="cx">             &lt;o&gt;&lt;/o&gt;  &lt;!-- Match here --&gt;
</span><span class="lines">@@ -225,7 +226,7 @@
</span><span class="cx">                     &lt;n&gt;
</span><span class="cx">                         &lt;n&gt;
</span><span class="cx">                             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                            &lt;span class=&quot;target&quot; id=&quot;target12&quot;&gt;&lt;/span&gt;
</del><ins>+                            &lt;sibling class=&quot;target&quot; id=&quot;target12&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                         &lt;/n&gt;
</span><span class="cx">                     &lt;/n&gt;
</span><span class="cx">                 &lt;/n&gt;
</span><span class="lines">@@ -233,28 +234,28 @@
</span><span class="cx">         &lt;/n&gt;
</span><span class="cx">     &lt;/target12&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of p ~ sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of p ~ sibling) --&gt;
</ins><span class="cx">     &lt;target13&gt;
</span><span class="cx">         &lt;p&gt;&lt;/p&gt;  &lt;!-- Match here --&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target13.1&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;sibling class=&quot;target&quot; id=&quot;target13.1&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target13&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of p ~ sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of p ~ sibling) --&gt;
</ins><span class="cx">     &lt;target13&gt;
</span><span class="cx">         &lt;a&gt;&lt;/a&gt;  &lt;!-- Fail here --&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target13.2&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;sibling class=&quot;target&quot; id=&quot;target13.2&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target13&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of p ~ sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of p ~ sibling) --&gt;
</ins><span class="cx">     &lt;target13&gt;
</span><span class="cx">         &lt;!-- Fail here --&gt;
</span><span class="cx">         &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-        &lt;span class=&quot;target&quot; id=&quot;target13.3&quot;&gt;&lt;/span&gt;
</del><ins>+        &lt;sibling class=&quot;target&quot; id=&quot;target13.3&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">     &lt;/target13&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of q ~ r sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of q ~ r sibling) --&gt;
</ins><span class="cx">     &lt;target14&gt;
</span><span class="cx">         &lt;q&gt;&lt;/q&gt;  &lt;!-- Match here --&gt;
</span><span class="cx">         &lt;a&gt;&lt;/a&gt;
</span><span class="lines">@@ -262,36 +263,36 @@
</span><span class="cx">             &lt;a&gt;&lt;/a&gt;  &lt;!-- Fail here --&gt;
</span><span class="cx">             &lt;r&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target14.1&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target14.1&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/r&gt;
</span><span class="cx">         &lt;/r&gt;
</span><span class="cx">     &lt;/target14&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of q ~ r sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of q ~ r sibling) --&gt;
</ins><span class="cx">     &lt;target14&gt;
</span><span class="cx">         &lt;!-- Fail here --&gt;
</span><span class="cx">         &lt;r&gt;
</span><span class="cx">             &lt;a&gt;&lt;/a&gt;  &lt;!-- Fail here --&gt;
</span><span class="cx">             &lt;r&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target14.2&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target14.2&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/r&gt;
</span><span class="cx">         &lt;/r&gt;
</span><span class="cx">     &lt;/target14&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of q ~ r sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of q ~ r sibling) --&gt;
</ins><span class="cx">     &lt;target14&gt;
</span><span class="cx">         &lt;!-- Fail here --&gt;
</span><span class="cx">         &lt;r&gt;
</span><span class="cx">             &lt;!-- Fail here --&gt;
</span><span class="cx">             &lt;r&gt;
</span><span class="cx">                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                &lt;span class=&quot;target&quot; id=&quot;target14.3&quot;&gt;&lt;/span&gt;
</del><ins>+                &lt;sibling class=&quot;target&quot; id=&quot;target14.3&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">             &lt;/r&gt;
</span><span class="cx">         &lt;/r&gt;
</span><span class="cx">     &lt;/target14&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) --&gt;
</ins><span class="cx">     &lt;target15&gt;
</span><span class="cx">         &lt;s&gt;
</span><span class="cx">             &lt;!-- Fail here and backtrack with the tail --&gt;
</span><span class="lines">@@ -305,7 +306,7 @@
</span><span class="cx">                     &lt;s&gt;
</span><span class="cx">                         &lt;s&gt;
</span><span class="cx">                             &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                            &lt;span class=&quot;target&quot; id=&quot;target15&quot;&gt;&lt;/span&gt;
</del><ins>+                            &lt;sibling class=&quot;target&quot; id=&quot;target15&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                         &lt;/s&gt;
</span><span class="cx">                     &lt;/s&gt;
</span><span class="cx">                 &lt;/s&gt;
</span><span class="lines">@@ -313,7 +314,7 @@
</span><span class="cx">         &lt;/s&gt;
</span><span class="cx">     &lt;/target15&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- span.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) --&gt;
</del><ins>+    &lt;!-- sibling.target:nth-child(n+2 of s t+t+t+s&gt;s&gt;s sibling) --&gt;
</ins><span class="cx">     &lt;target16&gt;
</span><span class="cx">         &lt;s&gt;
</span><span class="cx">             &lt;t&gt;&lt;/t&gt;  &lt;!-- Match here --&gt;
</span><span class="lines">@@ -331,7 +332,7 @@
</span><span class="cx">                         &lt;s&gt;
</span><span class="cx">                             &lt;s&gt;
</span><span class="cx">                                 &lt;sibling&gt;&lt;/sibling&gt;
</span><del>-                                &lt;span class=&quot;target&quot; id=&quot;target16&quot;&gt;&lt;/span&gt;
</del><ins>+                                &lt;sibling class=&quot;target&quot; id=&quot;target16&quot;&gt;&lt;/sibling&gt;
</ins><span class="cx">                             &lt;/s&gt;
</span><span class="cx">                         &lt;/s&gt;
</span><span class="cx">                     &lt;/s&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbacktrackingadjacenthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-backtracking-adjacent.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -8,31 +8,31 @@
</span><span class="cx">     color:rgb(0,0,0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-a + b:nth-child(n+2 of a + a) span.target {
</del><ins>+a + :nth-child(n+1 of a + a ~ b) span.target {
</ins><span class="cx">     background-color:rgb(1,2,3);
</span><span class="cx"> }
</span><del>-b:nth-child(n+2 of a + a) span.target {
</del><ins>+b:nth-child(n+1 of a + a ~ b) span.target {
</ins><span class="cx">     color:rgb(1,2,3);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-d:nth-child(n+2 of c + c + c) span.target {
</del><ins>+:nth-child(n+1 of c + c + c ~ d) span.target {
</ins><span class="cx">     background-color:rgb(4,5,6);
</span><span class="cx"> }
</span><del>-c + c + c + d:nth-child(n+2 of c + c + c) span.target {
</del><ins>+c + c + c + d:nth-child(n+1 of c + c + c ~ d) span.target {
</ins><span class="cx">     color:rgb(4,5,6);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-f:nth-child(n+2 of e + e) ~ g span.target {
</del><ins>+f:nth-child(n+1 of e + e ~ f) ~ g span.target {
</ins><span class="cx">     background-color:rgb(7,8,9);
</span><span class="cx"> }
</span><del>-e + f:nth-child(n+2 of e + e) ~ g span.target {
</del><ins>+e + f:nth-child(n+1 of e + e ~ f) ~ g span.target {
</ins><span class="cx">     color:rgb(7,8,9);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-span.target:nth-child(n+2 of h + h) {
</del><ins>+span.target:nth-child(n+1 of h + h ~ span.target) {
</ins><span class="cx">     background-color:rgb(10,11,12);
</span><span class="cx"> }
</span><del>-h + span.target:nth-child(n+2 of h + h) {
</del><ins>+h + span.target:nth-child(n+1 of h + h ~ span.target) {
</ins><span class="cx">     color:rgb(10,11,12);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -62,10 +62,10 @@
</span><span class="cx">     background-color:rgb(25,26,27);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-s s:nth-child(n+2 of t+t+t)&gt;s&gt;s span.target {
</del><ins>+s s:nth-child(n+1 of t+t+t+s)&gt;s&gt;s span.target {
</ins><span class="cx">     background-color:rgb(28,29,30);
</span><span class="cx"> }
</span><del>-s t+t+t+s:nth-child(n+2 of t+t+t)&gt;s&gt;s span.target {
</del><ins>+s t+t+t+s:nth-child(n+1 of t+t+t+s)&gt;s&gt;s span.target {
</ins><span class="cx">     color:rgb(28,29,30);
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbasics2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-basics-2-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-basics-2-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-basics-2-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -361,13 +361,12 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(3 of testcaseA)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(3 of testcaseA)').length is 2
-PASS document.querySelectorAll('#test-root :nth-child(3 of testcaseA)')[0].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3 of testcaseA)')[1].id is &quot;testcase5&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(3 of testcaseA)').length is 1
+PASS document.querySelectorAll('#test-root :nth-child(3 of testcaseA)')[0].id is &quot;testcase5&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -430,16 +429,15 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(4 of testcaseB)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(4 of testcaseB)').length is 2
-PASS document.querySelectorAll('#test-root :nth-child(4 of testcaseB)')[0].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4 of testcaseB)')[1].id is &quot;testcase8&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(4 of testcaseB)').length is 1
+PASS document.querySelectorAll('#test-root :nth-child(4 of testcaseB)')[0].id is &quot;testcase8&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -511,64 +509,50 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(n+3 of testcaseA)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)').length is 27
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[0].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[1].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[2].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[3].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[4].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[5].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[6].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[7].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[8].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[9].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[10].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[11].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[12].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[13].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[14].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[15].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[16].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[17].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[18].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[19].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[20].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[21].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[22].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[23].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[24].id is &quot;testcase28&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[25].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[26].id is &quot;testcase30&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)').length is 13
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[0].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[1].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[3].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[4].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[5].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[6].id is &quot;testcase17&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[7].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[8].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[9].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[10].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[11].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+3 of testcaseA)')[12].id is &quot;testcase29&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;testcaseA:nth-child(2n+2 of testcaseA)&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n+2 of testcaseA)').length is 7
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbasics2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-basics-2.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-basics-2.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-basics-2.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -85,12 +85,12 @@
</span><span class="cx"> 
</span><span class="cx"> // Test cases inspired by the :nth-of-type() examples from http://nthmaster.com/.
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(3 of testcaseA)&quot;, [&quot;testcase5&quot;]);
</span><del>-testSelector(&quot;:nth-child(3 of testcaseA)&quot;, [&quot;testcase4&quot;, &quot;testcase5&quot;]);
</del><ins>+testSelector(&quot;:nth-child(3 of testcaseA)&quot;, [&quot;testcase5&quot;]);
</ins><span class="cx"> testSelector(&quot;testcaseB:nth-child(4 of testcaseB)&quot;, [&quot;testcase8&quot;]);
</span><del>-testSelector(&quot;:nth-child(4 of testcaseB)&quot;, [&quot;testcase7&quot;, &quot;testcase8&quot;]);
</del><ins>+testSelector(&quot;:nth-child(4 of testcaseB)&quot;, [&quot;testcase8&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(n+3 of testcaseA)&quot;, [&quot;testcase5&quot;, &quot;testcase7&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase17&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
</span><del>-testSelector(&quot;:nth-child(n+3 of testcaseA)&quot;, [&quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;, &quot;testcase11&quot;, &quot;testcase12&quot;, &quot;testcase13&quot;, &quot;testcase14&quot;, &quot;testcase15&quot;, &quot;testcase16&quot;, &quot;testcase17&quot;, &quot;testcase18&quot;, &quot;testcase19&quot;, &quot;testcase20&quot;, &quot;testcase21&quot;, &quot;testcase22&quot;, &quot;testcase23&quot;, &quot;testcase24&quot;, &quot;testcase25&quot;, &quot;testcase26&quot;, &quot;testcase27&quot;, &quot;testcase28&quot;, &quot;testcase29&quot;, &quot;testcase30&quot;]);
</del><ins>+testSelector(&quot;:nth-child(n+3 of testcaseA)&quot;, [&quot;testcase5&quot;, &quot;testcase7&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase17&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(2n+2 of testcaseA)&quot;, [&quot;testcase3&quot;, &quot;testcase7&quot;, &quot;testcase11&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase23&quot;, &quot;testcase27&quot;]);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-basics-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-basics-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-basics-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -52,76 +52,65 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(2n + 1 of testcaseA)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)').length is 15
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)').length is 8
</ins><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[0].id is &quot;testcase1&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[1].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[2].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[3].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[4].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[5].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[6].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[7].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[8].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[9].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[10].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[11].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[12].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[13].id is &quot;testcase28&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[14].id is &quot;testcase29&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[1].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[3].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[4].id is &quot;testcase17&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[5].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[6].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 1 of testcaseA)')[7].id is &quot;testcase29&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(3n - 2 of [attribute1=value1])&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])').length is 12
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])').length is 8
</ins><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[0].id is &quot;testcase1&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[1].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[2].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[3].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[4].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[5].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[6].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[7].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[8].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[9].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[10].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[11].id is &quot;testcase28&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[1].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[2].id is &quot;testcase10&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[3].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[4].id is &quot;testcase17&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[5].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[6].id is &quot;testcase24&quot;
+PASS document.querySelectorAll('#test-root :nth-child(3n - 2 of [attribute1=value1])')[7].id is &quot;testcase28&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -132,29 +121,28 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(4n - 1 of .bar)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)').length is 6
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[0].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[1].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[2].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[3].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[4].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[5].id is &quot;testcase25&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)').length is 5
+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[0].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[1].id is &quot;testcase10&quot;
+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[2].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[3].id is &quot;testcase20&quot;
+PASS document.querySelectorAll('#test-root :nth-child(4n - 1 of .bar)')[4].id is &quot;testcase25&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -184,28 +172,17 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(2n + 2 of :empty)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)').length is 13
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[0].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[1].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[2].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[3].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[4].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[5].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[6].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[7].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[8].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[9].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[10].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[11].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[12].id is &quot;testcase27&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)').length is 2
+PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[0].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n + 2 of :empty)')[1].id is &quot;testcase27&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -219,11 +196,11 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -270,15 +247,13 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;testcaseA:nth-child(even of testcaseA.bazoo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)').length is 8
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)').length is 6
</ins><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[0].id is &quot;testcase3&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[1].id is &quot;testcase7&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[2].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[3].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[4].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[5].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[6].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[7].id is &quot;testcase29&quot;
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[2].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[3].id is &quot;testcase17&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[4].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of testcaseA.bazoo)')[5].id is &quot;testcase29&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="lines">@@ -289,7 +264,7 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -299,7 +274,7 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -391,16 +366,14 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;testcaseA:nth-child(even of .bar.foo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)').length is 4
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[0].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[1].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[2].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[3].id is &quot;testcase25&quot;
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)').length is 2
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[0].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(even of .bar.foo)')[1].id is &quot;testcase25&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -408,7 +381,7 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -428,21 +401,10 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;*:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)').length is 13
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[0].id is &quot;testcase1&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[1].id is &quot;testcase2&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[2].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[3].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[4].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[5].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[6].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[7].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[8].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[9].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[10].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[11].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[12].id is &quot;testcase20&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)').length is 2
+PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[0].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('#test-root *:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)')[1].id is &quot;testcase20&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -451,16 +413,16 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -474,11 +436,8 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)').length is 4
-PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)')[0].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)')[1].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)')[2].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)')[3].id is &quot;testcase29&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)').length is 1
+PASS document.querySelectorAll('#test-root :-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)')[0].id is &quot;testcase27&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -501,31 +460,25 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;*:nth-child(even of :nth-child(odd of [attribute2]))&quot;
</span><del>-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))').length is 7
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[0].id is &quot;testcase2&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[1].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[2].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[3].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[4].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[5].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[6].id is &quot;testcase29&quot;
</del><ins>+PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))').length is 1
+PASS document.querySelectorAll('#test-root *:nth-child(even of :nth-child(odd of [attribute2]))')[0].id is &quot;testcase9&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -534,11 +487,11 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -547,7 +500,7 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofbasicshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-basics.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-basics.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-basics.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -79,16 +79,16 @@
</span><span class="cx"> /* -- Some generic tests for primitive selectors. -- */
</span><span class="cx"> 
</span><span class="cx"> // Even of a tag name.
</span><del>-testSelector(&quot;:nth-child(2n + 1 of testcaseA)&quot;, [&quot;testcase1&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase12&quot;, &quot;testcase13&quot;, &quot;testcase16&quot;, &quot;testcase17&quot;, &quot;testcase20&quot;, &quot;testcase21&quot;, &quot;testcase24&quot;, &quot;testcase25&quot;, &quot;testcase28&quot;, &quot;testcase29&quot;]);
</del><ins>+testSelector(&quot;:nth-child(2n + 1 of testcaseA)&quot;, [&quot;testcase1&quot;, &quot;testcase5&quot;, &quot;testcase9&quot;, &quot;testcase13&quot;, &quot;testcase17&quot;, &quot;testcase21&quot;, &quot;testcase25&quot;, &quot;testcase29&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Attribute.
</span><del>-testSelector(&quot;:nth-child(3n - 2 of [attribute1=value1])&quot;, [&quot;testcase1&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;, &quot;testcase13&quot;, &quot;testcase17&quot;, &quot;testcase20&quot;, &quot;testcase21&quot;, &quot;testcase24&quot;, &quot;testcase27&quot;, &quot;testcase28&quot;]);
</del><ins>+testSelector(&quot;:nth-child(3n - 2 of [attribute1=value1])&quot;, [&quot;testcase1&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase13&quot;, &quot;testcase17&quot;, &quot;testcase21&quot;, &quot;testcase24&quot;, &quot;testcase28&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Class.
</span><del>-testSelector(&quot;:nth-child(4n - 1 of .bar)&quot;, [&quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase10&quot;, &quot;testcase15&quot;, &quot;testcase20&quot;, &quot;testcase25&quot;]);
</del><ins>+testSelector(&quot;:nth-child(4n - 1 of .bar)&quot;, [&quot;testcase4&quot;, &quot;testcase10&quot;, &quot;testcase15&quot;, &quot;testcase20&quot;, &quot;testcase25&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Value.
</span><del>-testSelector(&quot;:nth-child(2n + 2 of :empty)&quot;, [&quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase22&quot;, &quot;testcase23&quot;, &quot;testcase24&quot;, &quot;testcase25&quot;, &quot;testcase26&quot;, &quot;testcase27&quot;]);
</del><ins>+testSelector(&quot;:nth-child(2n + 2 of :empty)&quot;, [&quot;testcase9&quot;, &quot;testcase27&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /* -- In practice, we expect a lot of filtering will be done on the same type. -- */
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(even of testcaseA)&quot;, [&quot;testcase3&quot;, &quot;testcase7&quot;, &quot;testcase11&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase23&quot;, &quot;testcase27&quot;]);
</span><span class="cx"> 
</span><span class="cx"> // All the testcaseA with an odd number of testcaseA.bazoo before it.
</span><del>-testSelector(&quot;testcaseA:nth-child(even of testcaseA.bazoo)&quot;, [&quot;testcase3&quot;, &quot;testcase7&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase17&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase29&quot;]);
</del><ins>+testSelector(&quot;testcaseA:nth-child(even of testcaseA.bazoo)&quot;, [&quot;testcase3&quot;, &quot;testcase7&quot;, &quot;testcase13&quot;, &quot;testcase17&quot;, &quot;testcase23&quot;, &quot;testcase29&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Odd of [attribute2].
</span><span class="cx"> testSelector(&quot;[attribute2]:nth-child(odd of [attribute2])&quot;, [&quot;testcase2&quot;, &quot;testcase9&quot;, &quot;testcase20&quot;]);
</span><span class="lines">@@ -107,10 +107,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /* -- Compound selectors -- */
</span><del>-testSelector(&quot;testcaseA:nth-child(even of .bar.foo)&quot;, [&quot;testcase5&quot;, &quot;testcase13&quot;, &quot;testcase21&quot;, &quot;testcase25&quot;]);
-testSelector('*:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)', [&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase10&quot;, &quot;testcase11&quot;, &quot;testcase12&quot;, &quot;testcase13&quot;, &quot;testcase14&quot;, &quot;testcase15&quot;, &quot;testcase16&quot;, &quot;testcase17&quot;, &quot;testcase18&quot;, &quot;testcase19&quot;, &quot;testcase20&quot;]);
-testSelector(':-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)', [&quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
-testSelector('*:nth-child(even of :nth-child(odd of [attribute2]))', [&quot;testcase2&quot;, &quot;testcase7&quot;, &quot;testcase9&quot;, &quot;testcase16&quot;, &quot;testcase18&quot;, &quot;testcase20&quot;, &quot;testcase29&quot;]);
</del><ins>+testSelector(&quot;testcaseA:nth-child(even of .bar.foo)&quot;, [&quot;testcase21&quot;, &quot;testcase25&quot;]);
+testSelector('*:nth-child(3n+1 of [id][attribute2^=&quot;value&quot;].bazoo)', [&quot;testcase2&quot;, &quot;testcase20&quot;]);
+testSelector(':-webkit-any(testcaseA, dontExist):nth-child(n+3 of .foo:empty)', [&quot;testcase27&quot;]);
+testSelector('*:nth-child(even of :nth-child(odd of [attribute2]))', [&quot;testcase9&quot;]);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofchained2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-chained-2-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-chained-2-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-chained-2-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -44,20 +44,18 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;testcaseA:nth-child(2n of [attribute1])&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])').length is 8
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])').length is 6
</ins><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[0].id is &quot;testcase3&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[1].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[2].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[3].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[4].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[5].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[6].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[7].id is &quot;testcase27&quot;
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[1].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[2].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[3].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[4].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of [attribute1])')[5].id is &quot;testcase25&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -79,17 +77,16 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])').length is 4
</del><ins>+PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])').length is 3
</ins><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])')[0].id is &quot;testcase3&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])')[1].id is &quot;testcase11&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])')[2].id is &quot;testcase23&quot;
</span><del>-PASS document.querySelectorAll('#test-root testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])')[3].id is &quot;testcase27&quot;
</del><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="lines">@@ -116,7 +113,7 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofchained2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-chained-2.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-chained-2.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-chained-2.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -74,10 +74,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(2n of testcaseA)&quot;, [&quot;testcase3&quot;, &quot;testcase7&quot;, &quot;testcase11&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase23&quot;, &quot;testcase27&quot;]);
</span><del>-testSelector(&quot;testcaseA:nth-child(2n of [attribute1])&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;]);
</del><ins>+testSelector(&quot;testcaseA:nth-child(2n of [attribute1])&quot;, [&quot;testcase3&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // This should be the conjunction of the two selectors, which should return the intersection of the results.
</span><del>-testSelector(&quot;testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])&quot;, [&quot;testcase3&quot;, &quot;testcase11&quot;, &quot;testcase23&quot;, &quot;testcase27&quot;]);
</del><ins>+testSelector(&quot;testcaseA:nth-child(2n of testcaseA):nth-child(2n of [attribute1])&quot;, [&quot;testcase3&quot;, &quot;testcase11&quot;, &quot;testcase23&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // This is the disjunction of the selectors. Due to the counting, it is not the union of the previous results.
</span><span class="cx"> testSelector(&quot;testcaseA:nth-child(2n of testcaseA, [attribute1])&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase7&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofchained3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/nth-child-of-chained-3-expected.txt (0 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-chained-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-chained-3-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -0,0 +1,264 @@
</span><ins>+Test the chaining of multiple :nth-child(An+B of selector) does match every one of the selector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Testing &quot;testcaseA.foo[id]&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]').length is 12
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[1].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[3].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[4].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[5].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[6].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[7].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[8].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[9].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[10].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root testcaseA.foo[id]')[11].id is &quot;testcase29&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+Testing &quot;:nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])').length is 12
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[1].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[3].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[4].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[5].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[6].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[7].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[8].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[9].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[10].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])')[11].id is &quot;testcase29&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+Testing &quot;:nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])').length is 12
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[1].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[3].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[4].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[5].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[6].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[7].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[8].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[9].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[10].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])')[11].id is &quot;testcase29&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+Testing &quot;:nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])').length is 12
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[1].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[2].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[3].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[4].id is &quot;testcase13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[5].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[6].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[7].id is &quot;testcase21&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[8].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[9].id is &quot;testcase25&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[10].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])')[11].id is &quot;testcase29&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+Testing &quot;:nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])').length is 6
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[1].id is &quot;testcase11&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[2].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[3].id is &quot;testcase19&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[4].id is &quot;testcase23&quot;
+PASS document.querySelectorAll('#test-root :nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[5].id is &quot;testcase27&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+Testing &quot;:nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])').length is 3
+PASS document.querySelectorAll('#test-root :nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[0].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[1].id is &quot;testcase15&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])')[2].id is &quot;testcase27&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofchained3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/nth-child-of-chained-3.html (0 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-chained-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-chained-3.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+#test-root * {
+    background-color: red;
+}
+&lt;/style&gt;
+&lt;style id=&quot;style&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div style=&quot;display:none&quot; id=&quot;test-root&quot;&gt;
+        &lt;testcaseA id=&quot;testcase1&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase2&quot; class=&quot;bar baz bazoo&quot; attribute2=&quot;value2&quot; attribute3=&quot;value3&quot;&gt;&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase3&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase4&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase5&quot; class=&quot;foo baz bazoo&quot; attribute2=&quot;value2&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase6&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase7&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase8&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase9&quot; class=&quot;foo bar bazoo&quot; attribute2=&quot;value2&quot; attribute3=&quot;value3&quot;&gt;&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase10&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase11&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase12&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase13&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase14&quot; class=&quot;foo bar baz&quot; attribute2=&quot;value2&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase15&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase16&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase17&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase18&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase19&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase20&quot; class=&quot;bar baz bazoo&quot; attribute2=&quot;value2&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase21&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot; attribute3=&quot;value3&quot;&gt;&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase22&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase23&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase24&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase25&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase26&quot; attribute1=&quot;value1&quot; class=&quot;bar baz bazoo&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase27&quot; class=&quot;foo baz bazoo&quot; attribute2=&quot;value2&quot;&gt;&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase28&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot; attribute3=&quot;value3&quot;&gt;Not empty&lt;/testcaseB&gt;
+        &lt;testcaseA id=&quot;testcase29&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot;&gt;Not empty&lt;/testcaseA&gt;
+        &lt;testcaseB id=&quot;testcase30&quot; attribute1=&quot;value1&quot; class=&quot;foo bar baz&quot;&gt;Not empty&lt;/testcaseB&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the chaining of multiple :nth-child(An+B of selector) does match every one of the selector.');
+
+function testQuerySelector(selector, expectedIds) {
+    shouldBe(&quot;document.querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedIds.length);
+    for (var i = 0; i &lt; expectedIds.length; ++i)
+        shouldBeEqualToString(&quot;document.querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].id&quot;, expectedIds[i]);
+}
+
+function testStyling(selector, expectedIds) {
+    var stylingElement = document.getElementById(&quot;style&quot;);
+    stylingElement.innerHTML = '' + selector + ' { background-color: rgb(10, 100, 200); }';
+
+    var allTestCases = document.querySelectorAll(&quot;#test-root *&quot;);
+    for (var i = 0; i &lt; allTestCases.length; ++i) {
+        var expectMatch = expectedIds.indexOf(allTestCases[i].id) &gt;= 0;
+        shouldBeEqualToString('getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[' + i + ']).backgroundColor', expectMatch ? 'rgb(10, 100, 200)' : 'rgb(255, 0, 0)');
+    }
+
+    stylingElement.innerHTML = '';
+}
+
+function testSelector(selector, expectedIds) {
+    debug(&quot;Testing \&quot;&quot; + selector + &quot;\&quot;&quot;);
+    testQuerySelector(&quot;#test-root &quot; + selector, expectedIds);
+    testStyling(&quot;#test-root &quot; + selector, expectedIds);
+    debug(&quot;&quot;);
+}
+
+// Using n and n+1 are interesting because they always match regardless of the siblings. But since the definition of :nth-child(An+B) include the current element, at least that one needs to match.
+testSelector(&quot;testcaseA.foo[id]&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
+testSelector(&quot;:nth-child(n of .foo):nth-child(n of testcaseA):nth-child(n of [id])&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
+testSelector(&quot;:nth-child(n+1 of .foo):nth-child(n of testcaseA):nth-child(n+1 of [id])&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
+testSelector(&quot;:nth-child(n+1 of .foo):nth-child(n+1 of testcaseA):nth-child(n of [id])&quot;, [&quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
+
+testSelector(&quot;:nth-child(n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])&quot;, [&quot;testcase3&quot;, &quot;testcase11&quot;, &quot;testcase15&quot;, &quot;testcase19&quot;, &quot;testcase23&quot;, &quot;testcase27&quot;]);
+testSelector(&quot;:nth-child(2n+1 of .foo):nth-child(2n of testcaseA):nth-child(n of [id])&quot;, [&quot;testcase3&quot;, &quot;testcase15&quot;, &quot;testcase27&quot;]);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofcomplexselectorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -4,23 +4,20 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(2n of :root parent1&gt;testcaseA)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)').length is 5
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[0].id is &quot;target2&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[1].id is &quot;target3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[2].id is &quot;target6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[3].id is &quot;target7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[4].id is &quot;target10&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)').length is 2
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[0].id is &quot;target3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent1&gt;testcaseA)')[1].id is &quot;target7&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -34,12 +31,9 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(2n of :root parent2&gt;.foo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)').length is 5
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[0].id is &quot;target12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[1].id is &quot;target13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[2].id is &quot;target16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[3].id is &quot;target17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[4].id is &quot;target20&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)').length is 2
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[0].id is &quot;target13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo)')[1].id is &quot;target17&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -53,79 +47,67 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)').length is 10
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[0].id is &quot;target2&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[1].id is &quot;target3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[2].id is &quot;target6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[3].id is &quot;target7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[4].id is &quot;target10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[5].id is &quot;target12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[6].id is &quot;target13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[7].id is &quot;target16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[8].id is &quot;target17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[9].id is &quot;target20&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)').length is 4
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[0].id is &quot;target3&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[1].id is &quot;target7&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[2].id is &quot;target13&quot;
+PASS document.querySelectorAll('#test-root :nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)')[3].id is &quot;target17&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;&gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)&quot;
</span><del>-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)').length is 12
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[0].id is &quot;target1&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[1].id is &quot;target2&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[2].id is &quot;target3&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[3].id is &quot;target4&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[4].id is &quot;target7&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[5].id is &quot;target8&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[6].id is &quot;target11&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[7].id is &quot;target12&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[8].id is &quot;target13&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[9].id is &quot;target15&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[10].id is &quot;target17&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[11].id is &quot;target19&quot;
</del><ins>+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)').length is 6
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[0].id is &quot;target4&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[1].id is &quot;target8&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[2].id is &quot;target13&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[3].id is &quot;target15&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[4].id is &quot;target17&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)')[5].id is &quot;target19&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="lines">@@ -136,66 +118,50 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;&gt; * &gt; *:nth-child(2n+1 of html .foo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)').length is 15
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[0].id is &quot;target1&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[1].id is &quot;target2&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[2].id is &quot;target3&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[3].id is &quot;target4&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[4].id is &quot;target5&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[5].id is &quot;target6&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[6].id is &quot;target7&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[7].id is &quot;target8&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[8].id is &quot;target9&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[9].id is &quot;target10&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[10].id is &quot;target11&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[11].id is &quot;target14&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[12].id is &quot;target15&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[13].id is &quot;target18&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[14].id is &quot;target19&quot;
</del><ins>+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)').length is 3
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[0].id is &quot;target11&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[1].id is &quot;target15&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html .foo)')[2].id is &quot;target19&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;&gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)&quot;
</span><del>-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)').length is 11
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[0].id is &quot;target1&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[1].id is &quot;target2&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[2].id is &quot;target3&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[3].id is &quot;target4&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[4].id is &quot;target7&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[5].id is &quot;target8&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[6].id is &quot;target11&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[7].id is &quot;target14&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[8].id is &quot;target16&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[9].id is &quot;target18&quot;
-PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[10].id is &quot;target20&quot;
</del><ins>+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)').length is 7
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[0].id is &quot;target4&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[1].id is &quot;target8&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[2].id is &quot;target11&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[3].id is &quot;target14&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[4].id is &quot;target16&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[5].id is &quot;target18&quot;
+PASS document.querySelectorAll('#test-root &gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)')[6].id is &quot;target20&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofcomplexselectorshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-complex-selectors.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -67,19 +67,19 @@
</span><span class="cx">     debug(&quot;&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-testSelector(':nth-child(2n of :root parent1&gt;testcaseA)', [&quot;target2&quot;, &quot;target3&quot;, &quot;target6&quot;, &quot;target7&quot;, &quot;target10&quot;]);
</del><ins>+testSelector(':nth-child(2n of :root parent1&gt;testcaseA)', [&quot;target3&quot;, &quot;target7&quot;]);
</ins><span class="cx"> 
</span><del>-testSelector(':nth-child(2n of :root parent2&gt;.foo)', [&quot;target12&quot;, &quot;target13&quot;, &quot;target16&quot;, &quot;target17&quot;, &quot;target20&quot;]);
</del><ins>+testSelector(':nth-child(2n of :root parent2&gt;.foo)', [&quot;target13&quot;, &quot;target17&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Since the two above are disjoint sets, the combined selector should match the combined results.
</span><del>-testSelector(':nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)', [&quot;target2&quot;, &quot;target3&quot;, &quot;target6&quot;, &quot;target7&quot;, &quot;target10&quot;, &quot;target12&quot;, &quot;target13&quot;, &quot;target16&quot;, &quot;target17&quot;, &quot;target20&quot;]);
</del><ins>+testSelector(':nth-child(2n of :root parent2&gt;.foo, :root parent1&gt;testcaseA)', [&quot;target3&quot;, &quot;target7&quot;, &quot;target13&quot;, &quot;target17&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-testSelector('&gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)', [&quot;target1&quot;, &quot;target2&quot;, &quot;target3&quot;, &quot;target4&quot;, &quot;target7&quot;, &quot;target8&quot;, &quot;target11&quot;, &quot;target12&quot;, &quot;target13&quot;, &quot;target15&quot;, &quot;target17&quot;, &quot;target19&quot;]);
</del><ins>+testSelector('&gt; * &gt; *:nth-child(2n + 1 of html div testcaseA~testcaseA + *)', [&quot;target4&quot;, &quot;target8&quot;, &quot;target13&quot;, &quot;target15&quot;, &quot;target17&quot;, &quot;target19&quot;]);
</ins><span class="cx"> 
</span><del>-testSelector('&gt; * &gt; *:nth-child(2n+1 of html .foo)', [&quot;target1&quot;, &quot;target2&quot;, &quot;target3&quot;, &quot;target4&quot;, &quot;target5&quot;, &quot;target6&quot;, &quot;target7&quot;, &quot;target8&quot;, &quot;target9&quot;, &quot;target10&quot;, &quot;target11&quot;, &quot;target14&quot;, &quot;target15&quot;, &quot;target18&quot;, &quot;target19&quot;]);
</del><ins>+testSelector('&gt; * &gt; *:nth-child(2n+1 of html .foo)', [&quot;target11&quot;, &quot;target15&quot;, &quot;target19&quot;]);
</ins><span class="cx"> 
</span><del>-testSelector('&gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)', [&quot;target1&quot;, &quot;target2&quot;, &quot;target3&quot;, &quot;target4&quot;, &quot;target7&quot;, &quot;target8&quot;, &quot;target11&quot;, &quot;target14&quot;, &quot;target16&quot;, &quot;target18&quot;, &quot;target20&quot;]);
</del><ins>+testSelector('&gt; * &gt; *:nth-child(2n+1 of html div testcaseA~testcaseA + *, html .foo)', [&quot;target4&quot;, &quot;target8&quot;, &quot;target11&quot;, &quot;target14&quot;, &quot;target16&quot;, &quot;target18&quot;, &quot;target20&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofnevermatchingselectorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -70,193 +70,103 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(1 of :not(*))&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))').length is 30
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[0].id is &quot;testcase1&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[1].id is &quot;testcase2&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[2].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[3].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[4].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[5].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[6].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[7].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[8].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[9].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[10].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[11].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[12].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[13].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[14].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[15].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[16].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[17].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[18].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[19].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[20].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[21].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[22].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[23].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[24].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[25].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[26].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[27].id is &quot;testcase28&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[28].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))')[29].id is &quot;testcase30&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(1 of :not(*))').length is 0
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(n of :not(*))&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))').length is 30
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[0].id is &quot;testcase1&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[1].id is &quot;testcase2&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[2].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[3].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[4].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[5].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[6].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[7].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[8].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[9].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[10].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[11].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[12].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[13].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[14].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[15].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[16].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[17].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[18].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[19].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[20].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[21].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[22].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[23].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[24].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[25].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[26].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[27].id is &quot;testcase28&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[28].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))')[29].id is &quot;testcase30&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(n of :not(*))').length is 0
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(n-99999 of :not(*))&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))').length is 30
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[0].id is &quot;testcase1&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[1].id is &quot;testcase2&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[2].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[3].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[4].id is &quot;testcase5&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[5].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[6].id is &quot;testcase7&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[7].id is &quot;testcase8&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[8].id is &quot;testcase9&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[9].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[10].id is &quot;testcase11&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[11].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[12].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[13].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[14].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[15].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[16].id is &quot;testcase17&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[17].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[18].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[19].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[20].id is &quot;testcase21&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[21].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[22].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[23].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[24].id is &quot;testcase25&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[25].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[26].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[27].id is &quot;testcase28&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[28].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))')[29].id is &quot;testcase30&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(n-99999 of :not(*))').length is 0
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[6]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[7]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(n+2 of [attribute4])&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(n+2 of [attribute4])').length is 0
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofnevermatchingselectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-never-matching-selector.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -77,9 +77,9 @@
</span><span class="cx"> testSelector(&quot;:nth-child(n+2 of :not(*))&quot;, []);
</span><span class="cx"> 
</span><span class="cx"> // The count of previous sibling must be An+B-1. A never matching selector always satisfies this.
</span><del>-testSelector(&quot;:nth-child(1 of :not(*))&quot;, ['testcase1', 'testcase2', 'testcase3', 'testcase4', 'testcase5', 'testcase6', 'testcase7', 'testcase8', 'testcase9', 'testcase10', 'testcase11', 'testcase12', 'testcase13', 'testcase14', 'testcase15', 'testcase16', 'testcase17', 'testcase18', 'testcase19', 'testcase20', 'testcase21', 'testcase22', 'testcase23', 'testcase24', 'testcase25', 'testcase26', 'testcase27', 'testcase28', 'testcase29', 'testcase30']);
-testSelector(&quot;:nth-child(n of :not(*))&quot;, ['testcase1', 'testcase2', 'testcase3', 'testcase4', 'testcase5', 'testcase6', 'testcase7', 'testcase8', 'testcase9', 'testcase10', 'testcase11', 'testcase12', 'testcase13', 'testcase14', 'testcase15', 'testcase16', 'testcase17', 'testcase18', 'testcase19', 'testcase20', 'testcase21', 'testcase22', 'testcase23', 'testcase24', 'testcase25', 'testcase26', 'testcase27', 'testcase28', 'testcase29', 'testcase30']);
-testSelector(&quot;:nth-child(n-99999 of :not(*))&quot;, ['testcase1', 'testcase2', 'testcase3', 'testcase4', 'testcase5', 'testcase6', 'testcase7', 'testcase8', 'testcase9', 'testcase10', 'testcase11', 'testcase12', 'testcase13', 'testcase14', 'testcase15', 'testcase16', 'testcase17', 'testcase18', 'testcase19', 'testcase20', 'testcase21', 'testcase22', 'testcase23', 'testcase24', 'testcase25', 'testcase26', 'testcase27', 'testcase28', 'testcase29', 'testcase30']);
</del><ins>+testSelector(&quot;:nth-child(1 of :not(*))&quot;, []);
+testSelector(&quot;:nth-child(n of :not(*))&quot;, []);
+testSelector(&quot;:nth-child(n-99999 of :not(*))&quot;, []);
</ins><span class="cx"> 
</span><span class="cx"> // Selectors that could match but do not match in this particular document.
</span><span class="cx"> testSelector(&quot;:nth-child(n+2 of [attribute4])&quot;, []);
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofselectorlistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-selector-list-expected.txt (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-selector-list-expected.txt        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-selector-list-expected.txt        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -229,23 +229,14 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(even of [attribute3$=&quot;3&quot;], :empty)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)').length is 16
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)').length is 7
</ins><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[0].id is &quot;testcase2&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[1].id is &quot;testcase6&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[2].id is &quot;testcase10&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[3].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[4].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[5].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[6].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[7].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[8].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[9].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[10].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[11].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[12].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[13].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[14].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[15].id is &quot;testcase30&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[3].id is &quot;testcase16&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[4].id is &quot;testcase20&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[5].id is &quot;testcase24&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [attribute3$=&quot;3&quot;], :empty)')[6].id is &quot;testcase27&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -259,42 +250,33 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)').length is 16
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)').length is 7
</ins><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[0].id is &quot;testcase2&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[1].id is &quot;testcase6&quot;
</span><span class="cx"> PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[2].id is &quot;testcase10&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[3].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[4].id is &quot;testcase15&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[5].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[6].id is &quot;testcase18&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[7].id is &quot;testcase19&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[8].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[9].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[10].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[11].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[12].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[13].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[14].id is &quot;testcase29&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[15].id is &quot;testcase30&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[3].id is &quot;testcase16&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[4].id is &quot;testcase20&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[5].id is &quot;testcase24&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)')[6].id is &quot;testcase27&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="lines">@@ -308,44 +290,38 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[16]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[17]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[29]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> 
</span><span class="cx"> Testing &quot;:nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)&quot;
</span><del>-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)').length is 15
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[0].id is &quot;testcase3&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[1].id is &quot;testcase4&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[2].id is &quot;testcase6&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[3].id is &quot;testcase10&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[4].id is &quot;testcase12&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[5].id is &quot;testcase13&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[6].id is &quot;testcase14&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[7].id is &quot;testcase16&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[8].id is &quot;testcase20&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[9].id is &quot;testcase22&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[10].id is &quot;testcase23&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[11].id is &quot;testcase24&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[12].id is &quot;testcase26&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[13].id is &quot;testcase27&quot;
-PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[14].id is &quot;testcase30&quot;
</del><ins>+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)').length is 9
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[0].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[1].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[2].id is &quot;testcase10&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[3].id is &quot;testcase14&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[4].id is &quot;testcase16&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[5].id is &quot;testcase20&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[6].id is &quot;testcase24&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[7].id is &quot;testcase27&quot;
+PASS document.querySelectorAll('#test-root :nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)')[8].id is &quot;testcase30&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[1]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[2]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[4]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="lines">@@ -354,8 +330,8 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[8]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[10]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[11]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[12]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[13]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[14]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[15]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="lines">@@ -364,11 +340,11 @@
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[18]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[19]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[20]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[21]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[22]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[23]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[24]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><del>-PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</del><ins>+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[25]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</ins><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[26]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[27]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span><span class="cx"> PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[28]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsnthchildofselectorlisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/nth-child-of-selector-list.html (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/nth-child-of-selector-list.html        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/LayoutTests/fast/selectors/nth-child-of-selector-list.html        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -89,13 +89,13 @@
</span><span class="cx"> testSelector(&quot;:nth-child(odd of [attribute1], [attribute2=value2])&quot;, [&quot;testcase1&quot;, &quot;testcase3&quot;, &quot;testcase5&quot;, &quot;testcase7&quot;, &quot;testcase9&quot;, &quot;testcase11&quot;, &quot;testcase13&quot;, &quot;testcase15&quot;, &quot;testcase17&quot;, &quot;testcase19&quot;, &quot;testcase21&quot;, &quot;testcase23&quot;, &quot;testcase25&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;]);
</span><span class="cx"> 
</span><span class="cx"> // Any element with an odd number of (attribute3 or empty) above.
</span><del>-testSelector(':nth-child(even of [attribute3$=&quot;3&quot;], :empty)', [&quot;testcase2&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase14&quot;, &quot;testcase15&quot;, &quot;testcase16&quot;, &quot;testcase18&quot;, &quot;testcase19&quot;, &quot;testcase20&quot;, &quot;testcase22&quot;, &quot;testcase23&quot;, &quot;testcase24&quot;, &quot;testcase26&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;, &quot;testcase30&quot;]);
</del><ins>+testSelector(':nth-child(even of [attribute3$=&quot;3&quot;], :empty)', [&quot;testcase2&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase16&quot;, &quot;testcase20&quot;, &quot;testcase24&quot;, &quot;testcase27&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // Any element with an odd number of (attribute3 or empty) above. Overqualified with id to test compound selectors.
</span><del>-testSelector(':nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)', [&quot;testcase2&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase14&quot;, &quot;testcase15&quot;, &quot;testcase16&quot;, &quot;testcase18&quot;, &quot;testcase19&quot;, &quot;testcase20&quot;, &quot;testcase22&quot;, &quot;testcase23&quot;, &quot;testcase24&quot;, &quot;testcase26&quot;, &quot;testcase27&quot;, &quot;testcase29&quot;, &quot;testcase30&quot;]);
</del><ins>+testSelector(':nth-child(even of [id][attribute3$=&quot;3&quot;], [id]:empty)', [&quot;testcase2&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase16&quot;, &quot;testcase20&quot;, &quot;testcase24&quot;, &quot;testcase27&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> // id is always there but attribute2 is uncommon. The classes .foo.bar matches many elements.
</span><del>-testSelector(':nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)', [&quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase12&quot;, &quot;testcase13&quot;, &quot;testcase14&quot;, &quot;testcase16&quot;, &quot;testcase20&quot;, &quot;testcase22&quot;, &quot;testcase23&quot;, &quot;testcase24&quot;, &quot;testcase26&quot;, &quot;testcase27&quot;, &quot;testcase30&quot;]);
</del><ins>+testSelector(':nth-child(even of [id][attribute2*=&quot;alue&quot;], .foo.bar)', [&quot;testcase4&quot;, &quot;testcase6&quot;, &quot;testcase10&quot;, &quot;testcase14&quot;, &quot;testcase16&quot;, &quot;testcase20&quot;, &quot;testcase24&quot;, &quot;testcase27&quot;, &quot;testcase30&quot;]);
</ins><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/Source/WebCore/ChangeLog        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-10-10  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Update :nth-child(An+B of selector-list) to the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=137593
+
+        Reviewed by Andreas Kling.
+
+        Following my implementation feedback on :nth-child(An+B of selector-list),
+        the CSS WG decided to change the definition such that the current element on which
+        the selector is matched must also match the selector list in :nth-child().
+
+        This patch updates the implementation accordingly.
+
+        Test: fast/selectors/nth-child-of-chained-3.html
+
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne):
+        (WebCore::SelectorChecker::matchSelectorList):
+        * css/SelectorChecker.h:
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
+
</ins><span class="cx"> 2014-10-10  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject subclasses
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -682,6 +682,13 @@
</span><span class="cx">             if (!selector-&gt;parseNth())
</span><span class="cx">                 break;
</span><span class="cx">             if (element-&gt;parentElement()) {
</span><ins>+#if ENABLE(CSS_SELECTORS_LEVEL4)
+                if (const CSSSelectorList* selectorList = selector-&gt;selectorList()) {
+                    if (!matchSelectorList(context, *element, *selectorList))
+                        return false;
+                }
+#endif
+
</ins><span class="cx">                 if (context.resolvingMode == Mode::ResolvingStyle)
</span><span class="cx">                     element-&gt;setStyleIsAffectedByPreviousSibling();
</span><span class="cx"> 
</span><span class="lines">@@ -692,19 +699,8 @@
</span><span class="cx">                         if (context.resolvingMode == Mode::ResolvingStyle)
</span><span class="cx">                             sibling-&gt;setAffectsNextSiblingElementStyle();
</span><span class="cx"> 
</span><del>-                        for (const CSSSelector* subselector = selectorList-&gt;first(); subselector; subselector = CSSSelectorList::next(subselector)) {
-                            CheckingContextWithStatus subcontext(context);
-                            subcontext.element = sibling;
-                            subcontext.selector = subselector;
-                            subcontext.inFunctionalPseudoClass = true;
-                            subcontext.firstSelectorOfTheFragment = subselector;
-                            PseudoId ignoreDynamicPseudo = NOPSEUDO;
-                            if (matchRecursively(subcontext, ignoreDynamicPseudo) == SelectorMatches) {
-                                ASSERT(ignoreDynamicPseudo == NOPSEUDO);
-                                ++count;
-                                break;
-                            }
-                        }
</del><ins>+                        if (matchSelectorList(context, *sibling, *selectorList))
+                            ++count;
</ins><span class="cx">                     }
</span><span class="cx">                 } else
</span><span class="cx"> #endif
</span><span class="lines">@@ -926,6 +922,23 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool SelectorChecker::matchSelectorList(const CheckingContextWithStatus&amp; baseContext, Element&amp; element, const CSSSelectorList&amp; selectorList) const
+{
+    for (const CSSSelector* subselector = selectorList.first(); subselector; subselector = CSSSelectorList::next(subselector)) {
+        CheckingContextWithStatus subcontext(baseContext);
+        subcontext.element = &amp;element;
+        subcontext.selector = subselector;
+        subcontext.inFunctionalPseudoClass = true;
+        subcontext.firstSelectorOfTheFragment = subselector;
+        PseudoId ignoreDynamicPseudo = NOPSEUDO;
+        if (matchRecursively(subcontext, ignoreDynamicPseudo) == SelectorMatches) {
+            ASSERT(ignoreDynamicPseudo == NOPSEUDO);
+            return true;
+        }
+    }
+    return false;
+}
+
</ins><span class="cx"> bool SelectorChecker::checkScrollbarPseudoClass(const CheckingContextWithStatus&amp; context, const CSSSelector* selector) const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(selector-&gt;match() == CSSSelector::PseudoClass);
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.h (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.h        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/Source/WebCore/css/SelectorChecker.h        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> private:
</span><span class="cx">     Match matchRecursively(const CheckingContextWithStatus&amp;, PseudoId&amp;) const;
</span><span class="cx">     bool checkOne(const CheckingContextWithStatus&amp;) const;
</span><ins>+    bool matchSelectorList(const CheckingContextWithStatus&amp;, Element&amp;, const CSSSelectorList&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     bool checkScrollbarPseudoClass(const CheckingContextWithStatus&amp;, const CSSSelector*) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (174612 => 174613)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-10-10 21:10:26 UTC (rev 174612)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-10-10 21:23:37 UTC (rev 174613)
</span><span class="lines">@@ -239,6 +239,7 @@
</span><span class="cx"> 
</span><span class="cx">     void generateSelectorChecker();
</span><span class="cx">     void generateSelectorCheckerExcludingPseudoElements(Assembler::JumpList&amp; failureCases, const SelectorFragmentList&amp;);
</span><ins>+    Assembler::JumpList generateElementMatchesSelectorList(Assembler::RegisterID elementRegister, const Vector&lt;SelectorFragmentList&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Element relations tree walker.
</span><span class="cx">     void generateWalkToParentNode(Assembler::RegisterID targetRegister);
</span><span class="lines">@@ -1597,6 +1598,45 @@
</span><span class="cx">     m_backtrackingLevels.takeLast();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Assembler::JumpList SelectorCodeGenerator::generateElementMatchesSelectorList(Assembler::RegisterID elementRegister, const Vector&lt;SelectorFragmentList&gt;&amp; selectorList)
+{
+    Assembler::JumpList matchFragmentList;
+    for (const SelectorFragmentList&amp; selectorFragmentList : selectorList) {
+        Assembler::JumpList failureCases;
+
+        RegisterVector allocatedRegisters = m_registerAllocator.allocatedRegisters();
+        if (m_descendantBacktrackingStartInUse)
+            allocatedRegisters.remove(allocatedRegisters.find(m_descendantBacktrackingStart));
+        StackAllocator::StackReferenceVector allocatedRegistersOnStack = m_stackAllocator.push(allocatedRegisters);
+
+        StackAllocator successStack = m_stackAllocator;
+        StackAllocator failureStack = m_stackAllocator;
+
+        for (Assembler::RegisterID registerID : allocatedRegisters) {
+            if (registerID != elementAddressRegister)
+                m_registerAllocator.deallocateRegister(registerID);
+        }
+
+        if (elementRegister != elementAddressRegister)
+            m_assembler.move(elementRegister, elementAddressRegister);
+        generateSelectorCheckerExcludingPseudoElements(failureCases, selectorFragmentList);
+
+        for (Assembler::RegisterID registerID : allocatedRegisters) {
+            if (registerID != elementAddressRegister)
+                m_registerAllocator.allocateRegister(registerID);
+        }
+
+        successStack.pop(allocatedRegistersOnStack, allocatedRegisters);
+        matchFragmentList.append(m_assembler.jump());
+
+        failureCases.link(&amp;m_assembler);
+        failureStack.pop(allocatedRegistersOnStack, allocatedRegisters);
+
+        m_stackAllocator.merge(WTF::move(successStack), WTF::move(failureStack));
+    }
+    return matchFragmentList;
+}
+
</ins><span class="cx"> static inline Assembler::Jump testIsElementFlagOnNode(Assembler::ResultCondition condition, Assembler&amp; assembler, Assembler::RegisterID nodeAddress)
</span><span class="cx"> {
</span><span class="cx">     return assembler.branchTest32(condition, Assembler::Address(nodeAddress, Node::nodeFlagsMemoryOffset()), Assembler::TrustedImm32(Node::flagIsElement()));
</span><span class="lines">@@ -3183,6 +3223,13 @@
</span><span class="cx">         generateWalkToParentElement(failureCases, parentElement);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // The initial element must match the selector list.
+    for (const NthChildOfSelectorInfo&amp; nthChildOfSelectorInfo : fragment.nthChildOfFilters) {
+        Assembler::JumpList matchFragmentList = generateElementMatchesSelectorList(elementAddressRegister, nthChildOfSelectorInfo.selectorList);
+        failureCases.append(m_assembler.jump());
+        matchFragmentList.link(&amp;m_assembler);
+    }
+
</ins><span class="cx">     Vector&lt;const NthChildOfSelectorInfo*&gt; validSubsetFilters;
</span><span class="cx">     for (const NthChildOfSelectorInfo&amp; nthChildOfSelectorInfo : fragment.nthChildOfFilters) {
</span><span class="cx">         if (nthFilterIsAlwaysSatisified(nthChildOfSelectorInfo.a, nthChildOfSelectorInfo.b))
</span><span class="lines">@@ -3205,53 +3252,19 @@
</span><span class="cx">             LocalRegister previousSibling(m_registerAllocator);
</span><span class="cx">             m_assembler.move(elementAddressRegister, previousSibling);
</span><span class="cx"> 
</span><del>-            // Getting the child index is very efficient when it works. When there is no child index,
-            // querying at every iteration is very inefficient. We solve this by only testing the child
-            // index on the first direct adjacent.
</del><span class="cx">             Assembler::JumpList noMoreSiblingsCases;
</span><span class="cx"> 
</span><span class="cx">             Assembler::Label loopStart = m_assembler.label();
</span><ins>+
</ins><span class="cx">             generateWalkToPreviousAdjacentElement(noMoreSiblingsCases, previousSibling);
</span><span class="cx">             markElementIfResolvingStyle(previousSibling, Node::flagAffectsNextSiblingElementStyle());
</span><span class="cx"> 
</span><del>-            Assembler::JumpList matchFragmentList;
-            for (const SelectorFragmentList&amp; selectorFragmentList : nthChildOfSelectorInfo-&gt;selectorList) {
-                Assembler::JumpList failureCases;
-
-                RegisterVector allocatedRegisters = m_registerAllocator.allocatedRegisters();
-                if (m_descendantBacktrackingStartInUse)
-                    allocatedRegisters.remove(allocatedRegisters.find(m_descendantBacktrackingStart));
-                StackAllocator::StackReferenceVector allocatedRegistersOnStack = m_stackAllocator.push(allocatedRegisters);
-
-                StackAllocator successStack = m_stackAllocator;
-                StackAllocator failureStack = m_stackAllocator;
-
-                for (Assembler::RegisterID registerID : allocatedRegisters) {
-                    if (registerID != elementAddressRegister)
-                        m_registerAllocator.deallocateRegister(registerID);
-                }
-
-                m_assembler.move(previousSibling, elementAddressRegister);
-                generateSelectorCheckerExcludingPseudoElements(failureCases, selectorFragmentList);
-
-                for (Assembler::RegisterID registerID : allocatedRegisters) {
-                    if (registerID != elementAddressRegister)
-                        m_registerAllocator.allocateRegister(registerID);
-                }
-
-                successStack.pop(allocatedRegistersOnStack, allocatedRegisters);
-                matchFragmentList.append(m_assembler.jump());
-
-                failureCases.link(&amp;m_assembler);
-                failureStack.pop(allocatedRegistersOnStack, allocatedRegisters);
-
-                m_stackAllocator.merge(WTF::move(successStack), WTF::move(failureStack));
-            }
</del><ins>+            Assembler::JumpList matchFragmentList = generateElementMatchesSelectorList(previousSibling, nthChildOfSelectorInfo-&gt;selectorList);
</ins><span class="cx">             m_assembler.jump().linkTo(loopStart, &amp;m_assembler);
</span><del>-
</del><span class="cx">             matchFragmentList.link(&amp;m_assembler);
</span><span class="cx">             m_assembler.add32(Assembler::TrustedImm32(1), elementCounter);
</span><span class="cx">             m_assembler.jump().linkTo(loopStart, &amp;m_assembler);
</span><ins>+
</ins><span class="cx">             noMoreSiblingsCases.link(&amp;m_assembler);
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>