No subject


Tue Jan 27 15:54:36 PST 2015


and generate the code. The new case-insensitive case is a simplified version
of the legacy HTML behavior without runtime check for the element type.

Tests: fast/css/implicitly-case-insensitive-attribute-with-svg.html
       fast/selectors/case-insensitive-attribute-register-requirement-1.html
       fast/selectors/case-insensitive-attribute-register-requirement-2.html
       fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::attributeSelectorCaseSensitivity):
(WebCore::SelectorCompiler::AttributeMatchingInfo::AttributeMatchingInfo):
(WebCore::SelectorCompiler::AttributeMatchingInfo::attributeCaseSensitivity):
(WebCore::SelectorCompiler::AttributeMatchingInfo::canDefaultToCaseSensitiveValueMatch): Deleted.
(WebCore::SelectorCompiler::constructFragmentsInternal):
Compute the type of value matching and store it on the AttributeMatchingInfo
when creating the fragment.

(WebCore::SelectorCompiler::minimumRegisterRequirements):
(WebCore::SelectorCompiler::attributeValueTestingRequiresExtraRegister):
(WebCore::SelectorCompiler::attributeValueTestingRequiresCaseFoldingRegister): Deleted.
In general, AttributeCaseSensitivity::CaseInsensitive does not require an extra
register. I have made an exception for generateElementAttributeValueExactMatching()
for simplicity. I use that register to load the StringImpl of the attribute
being tested, that way I can use WTF::equalIgnoringCaseNonNull() directly.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
Matching itself is just function calls. Unlike AttributeCaseSensitivity::HTMLLegacyCaseInsensitive,
the behavior is consistent between XML and HTML.

LayoutTests:

* fast/css/case-insensitive-attribute-with-svg-expected.html:
* fast/css/case-insensitive-attribute-with-svg.html:
* fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html: Copied from LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html.
* fast/css/implicitly-case-insensitive-attribute-with-svg.html: Copied from LayoutTests/fast/css/case-insensitive-attribute-with-svg.html.

I renamed the HTML legacy case-insensitive behavior to separate
it from the new selector.

* fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt: Added.
* fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html: Added.
Mixing explicit case-insensitive with implicit.

* fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-register-requirement-1.html: Added.
* fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-register-requirement-2.html: Added.
The usual register allocation stress tests.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsscaseinsensitiveattributewithsvgexpectedhtml">trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsscaseinsensitiveattributewithsvghtml">trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssimplicitlycaseinsensitiveattributewithsvgexpectedhtml">trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssimplicitlycaseinsensitiveattributewithsvghtml">trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement1expectedtxt">trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement1html">trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement2expectedtxt">trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement2html">trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectorexplicitcaseinsensitiveattributematchwithsvgexpectedtxt">trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectorexplicitcaseinsensitiveattributematchwithsvghtml">trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180543 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog	2015-02-24 03:25:26 UTC (rev 180543)
+++ trunk/LayoutTests/ChangeLog	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-02-23  Benjamin Poulain  &lt;benjamin at webkit.org&gt;
+
+        CSS JIT: add support for case-insensitive attribute matching
+        https://bugs.webkit.org/show_bug.cgi?id=141880
+
+        Reviewed by Andreas Kling.
+
+        * fast/css/case-insensitive-attribute-with-svg-expected.html:
+        * fast/css/case-insensitive-attribute-with-svg.html:
+        * fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html: Copied from LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html.
+        * fast/css/implicitly-case-insensitive-attribute-with-svg.html: Copied from LayoutTests/fast/css/case-insensitive-attribute-with-svg.html.
+
+        I renamed the HTML legacy case-insensitive behavior to separate
+        it from the new selector.
+
+        * fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt: Added.
+        * fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html: Added.
+        Mixing explicit case-insensitive with implicit.
+
+        * fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt: Added.
+        * fast/selectors/case-insensitive-attribute-register-requirement-1.html: Added.
+        * fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt: Added.
+        * fast/selectors/case-insensitive-attribute-register-requirement-2.html: Added.
+        The usual register allocation stress tests.
+
+
</ins><span class="cx"> 2015-02-23  Gyuyoung Kim  &lt;gyuyoung.kim at samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, EFL gardening. Mark webgl tests to crash.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscaseinsensitiveattributewithsvgexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html (180543 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html	2015-02-24 03:25:26 UTC (rev 180543)
+++ trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg-expected.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -1,14 +1,12 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;title&gt;Case Insensitive and Case Sensitive Attribute matching&lt;/title&gt;
</del><ins>+&lt;title&gt;Case Insensitive Attribute matching&lt;/title&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-    &lt;p&gt;On success, there should be a large green surface visible and no red anywhere.&lt;/p&gt;
</del><ins>+    &lt;p&gt;On success, there should be no red anywhere.&lt;/p&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot; style=&quot;margin-top:50px&quot;&gt;
</span><del>-        &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:green&quot; /&gt;
-        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:green&quot; /&gt;
</del><span class="cx">     &lt;/svg&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscaseinsensitiveattributewithsvghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg.html (180543 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg.html	2015-02-24 03:25:26 UTC (rev 180543)
+++ trunk/LayoutTests/fast/css/case-insensitive-attribute-with-svg.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -1,15 +1,15 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;title&gt;Case Insensitive and Case Sensitive Attribute matching&lt;/title&gt;
</del><ins>+&lt;title&gt;Case Insensitive Attribute matching&lt;/title&gt;
</ins><span class="cx"> &lt;style&gt;
</span><del>-[link=foobar], [lang=foobar] {
</del><ins>+[link=foobar I], [lang=foobar I] {
</ins><span class="cx">     display: none;
</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><del>-    &lt;p&gt;On success, there should be a large green surface visible and no red anywhere.&lt;/p&gt;
</del><ins>+    &lt;p&gt;On success, there should be no red anywhere.&lt;/p&gt;
</ins><span class="cx">     &lt;!-- None of these rects should appear, lang and link attribute matching is case insensitive for HTML documents. --&gt;
</span><span class="cx">     &lt;div style=&quot;background-color: red; position: absolute; left:0; width:50px; height:50px&quot;  lang=&quot;FooBar&quot;&gt;&lt;/div&gt;
</span><span class="cx">     &lt;div style=&quot;background-color: red; position: absolute; left:50px; width:50px; height:50px&quot; link=&quot;FooBar&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -18,8 +18,8 @@
</span><span class="cx"> 
</span><span class="cx">     &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot; style=&quot;margin-top:50px&quot;&gt;
</span><span class="cx">         &lt;!-- The first green rects should be visible, attribute matching is always case sensitive for XML or SVG documents. --&gt;
</span><del>-        &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
-        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
</del><ins>+        &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;FooBar&quot; style=&quot;fill:red&quot; /&gt;
+        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;FooBar&quot; style=&quot;fill:red&quot; /&gt;
</ins><span class="cx">         &lt;!-- These are regular match and should not appear. --&gt;
</span><span class="cx">         &lt;rect x=&quot;0&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
</span><span class="cx">         &lt;rect x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssimplicitlycaseinsensitiveattributewithsvgexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg-expected.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;Case Insensitive and Case Sensitive Attribute matching&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;On success, there should be a large green surface visible and no red anywhere.&lt;/p&gt;
+
+    &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot; style=&quot;margin-top:50px&quot;&gt;
+        &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:green&quot; /&gt;
+        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:green&quot; /&gt;
+    &lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssimplicitlycaseinsensitiveattributewithsvghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg.html (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/implicitly-case-insensitive-attribute-with-svg.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;Case Insensitive and Case Sensitive Attribute matching&lt;/title&gt;
+&lt;style&gt;
+[link=foobar], [lang=foobar] {
+    display: none;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;On success, there should be a large green surface visible and no red anywhere.&lt;/p&gt;
+    &lt;!-- None of these rects should appear, lang and link attribute matching is case insensitive for HTML documents. --&gt;
+    &lt;div style=&quot;background-color: red; position: absolute; left:0; width:50px; height:50px&quot;  lang=&quot;FooBar&quot;&gt;&lt;/div&gt;
+    &lt;div style=&quot;background-color: red; position: absolute; left:50px; width:50px; height:50px&quot; link=&quot;FooBar&quot;&gt;&lt;/div&gt;
+    &lt;div style=&quot;background-color: red; position: absolute; left:100px; width:50px; height:50px&quot; lang=&quot;foobar&quot;&gt;&lt;/div&gt;
+    &lt;div style=&quot;background-color: red; position: absolute; left:150px; width:50px; height:50px&quot; link=&quot;foobar&quot;&gt;&lt;/div&gt;
+
+    &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot; style=&quot;margin-top:50px&quot;&gt;
+        &lt;!-- The first green rects should be visible, attribute matching is always case sensitive for XML or SVG documents. --&gt;
+        &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
+        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
+        &lt;!-- These are regular match and should not appear. --&gt;
+        &lt;rect x=&quot;0&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
+        &lt;rect x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
+    &lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1-expected.txt	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,1301 @@
</span><ins>+Check various cases of register pressure with case-insensitive attribute matching (e.g. [foo=bar i]).
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Testing &quot;[type=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type=foobar i]').length is 10
+PASS document.querySelectorAll('[type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]').length is 10
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i][type=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[attribute1=VALUE1 i]&quot;
+-baseline:
+PASS document.querySelectorAll('[attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))').length is 7
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i], #this-is-not-in-the-document))')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+
+Testing &quot;[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]&quot;
+-baseline:
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]').length is 7
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i]')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))').length is 7
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[1].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[2].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[3].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[4].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[5].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i][attribute1=VALUE1 i], #this-is-not-in-the-document))')[6].id is &quot;testcase10&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(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(10, 100, 200)&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(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(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;#test-root *&quot;)[9]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+
+Testing &quot;[type~=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type~=foobar i]').length is 10
+PASS document.querySelectorAll('[type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type~=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]').length is 10
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i][type~=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type|=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type|=foobar i]').length is 10
+PASS document.querySelectorAll('[type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type|=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]').length is 10
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]').length is 10
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i][type|=foobar i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type^=foOba i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type^=foOba i]').length is 10
+PASS document.querySelectorAll('[type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type^=foOba i]').length is 10
+PASS document.querySelectorAll('testcase[type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]').length is 10
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]').length is 10
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i][type^=foOba i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type$=oobAR i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type$=oobAR i]').length is 10
+PASS document.querySelectorAll('[type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type$=oobAR i]').length is 10
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]').length is 10
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]').length is 10
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i][type$=oobAR i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type*=OOba i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type*=OOba i]').length is 10
+PASS document.querySelectorAll('[type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type*=OOba i]').length is 10
+PASS document.querySelectorAll('testcase[type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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;
+
+
+Testing &quot;[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]&quot;
+-baseline:
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]').length is 10
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-with tagname:
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]').length is 10
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll('testcase[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-with classes:
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]').length is 10
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':matches(.foo, .bar, .bazoo)[type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i]')[9].id is &quot;testcase10&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;
+
+-in functional pseudo classes:
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))').length is 10
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[0].id is &quot;testcase1&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[1].id is &quot;testcase2&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[2].id is &quot;testcase3&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[3].id is &quot;testcase4&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[4].id is &quot;testcase5&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[5].id is &quot;testcase6&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[6].id is &quot;testcase7&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[7].id is &quot;testcase8&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[8].id is &quot;testcase9&quot;
+PASS document.querySelectorAll(':nth-child(n of :matches([type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i][type*=OOba i], #this-is-not-in-the-document))')[9].id is &quot;testcase10&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 successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1.html (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1.html	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-1.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,98 @@
</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;
+testcase {
+    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;testcase id=&quot;testcase1&quot; type=&quot;foobar&quot; attribute1=&quot;Value1&quot; class=&quot;bar baz bazoo&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase2&quot; type=&quot;Foobar&quot; class=&quot;bar baz bazoo&quot; attribute2=&quot;value2&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase3&quot; type=&quot;FOOBAR&quot; attribute1=&quot;value1&quot; class=&quot;foo baz bazoo&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase4&quot; type=&quot;foobar&quot; attribute1=&quot;vAlue1&quot; class=&quot;foo bar bazoo&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase5&quot; type=&quot;Foobar&quot; class=&quot;foo baz bazoo&quot; attribute2=&quot;value2&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase6&quot; type=&quot;FOOBAR&quot; attribute1=&quot;vaLue1&quot; class=&quot;foo bar baz&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase7&quot; type=&quot;foobar&quot; attribute1=&quot;valUe1&quot; class=&quot;bar baz bazoo&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase8&quot; type=&quot;Foobar&quot; attribute1=&quot;valuE1&quot; class=&quot;foo baz bazoo&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase9&quot; type=&quot;FOOBAR&quot; class=&quot;foo bar bazoo&quot; attribute2=&quot;value2&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase id=&quot;testcase10&quot; type=&quot;foobar&quot; attribute1=&quot;value1&quot; class=&quot;foo bar bazoo&quot;&gt;&lt;/testcase&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Check various cases of register pressure with case-insensitive attribute matching (e.g. [foo=bar i]).');
+
+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) {
+    testQuerySelector(selector, expectedIds);
+    testStyling(selector, expectedIds);
+}
+
+function testSelectorVariants(selector, expectedIds) {
+    debug(&quot;Testing \&quot;&quot; + selector + &quot;\&quot;&quot;);
+    debug(&quot;-baseline:&quot;);
+    testSelector(selector, expectedIds);
+    debug(&quot;&quot;);
+
+    debug(&quot;-with tagname:&quot;);
+    testSelector('testcase' + selector, expectedIds);
+    debug(&quot;&quot;);
+
+    debug(&quot;-with classes:&quot;);
+    testSelector(':matches(.foo, .bar, .bazoo)' + selector, expectedIds);
+    debug(&quot;&quot;);
+
+    debug(&quot;-in functional pseudo classes:&quot;);
+    testSelector(':nth-child(n of :matches(' + selector + ', #this-is-not-in-the-document))', expectedIds);
+    debug(&quot;&quot;);
+
+
+    debug(&quot;&quot;);
+}
+
+var simpleCases = [
+    [&quot;[type=foobar i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+    [&quot;[attribute1=VALUE1 i]&quot;,[&quot;testcase1&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase10&quot;]],
+    [&quot;[type~=foobar i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+    [&quot;[type|=foobar i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+    [&quot;[type^=foOba i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+    [&quot;[type$=oobAR i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+    [&quot;[type*=OOba i]&quot;,[&quot;testcase1&quot;, &quot;testcase2&quot;, &quot;testcase3&quot;, &quot;testcase4&quot;, &quot;testcase5&quot;, &quot;testcase6&quot;, &quot;testcase7&quot;, &quot;testcase8&quot;, &quot;testcase9&quot;, &quot;testcase10&quot;]],
+];
+
+for (var testCase of simpleCases) {
+    testSelectorVariants(testCase[0], testCase[1]);
+
+    var repeatedSelector = testCase[0];
+    for (var i = 0; i &lt; 20; ++i) {
+        repeatedSelector += testCase[0];
+    }
+    testSelectorVariants(repeatedSelector, testCase[1]);
+}
+
+&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="trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2-expected.txt	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,393 @@
</span><ins>+Check various cases of register pressure with case-insensitive attribute matching (e.g. [foo=bar i]).
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Testing &quot;[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase').length is 8
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase1&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase')[7].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+Testing &quot;[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase').length is 7
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[0].id is &quot;innertestcase2&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[1].id is &quot;innertestcase3&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[2].id is &quot;innertestcase4&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[3].id is &quot;innertestcase5&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[4].id is &quot;innertestcase6&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[5].id is &quot;innertestcase7&quot;
+PASS document.querySelectorAll('[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase')[6].id is &quot;innertestcase8&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[0]).backgroundColor is &quot;rgb(255, 0, 0)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[1]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[2]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[3]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[4]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[5]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[6]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;innerTestCase&quot;)[7]).backgroundColor is &quot;rgb(10, 100, 200)&quot;
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorscaseinsensitiveattributeregisterrequirement2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2.html (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/case-insensitive-attribute-register-requirement-2.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,91 @@
</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;
+innerTestCase {
+    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;testcase type=&quot;foobar&quot; attribute1=&quot;Value1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase1&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;Foobar&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;FOOBAR&quot; attribute1=&quot;value1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase2&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;foobar&quot; attribute1=&quot;vAlue1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase3&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;Foobar&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase4&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;FOOBAR&quot; attribute1=&quot;vaLue1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase5&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;foobar&quot; attribute1=&quot;valUe1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase6&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;Foobar&quot; attribute1=&quot;valuE1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase7&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;FOOBAR&quot;&gt;&lt;/testcase&gt;
+        &lt;testcase type=&quot;foobar&quot; attribute1=&quot;value1&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;innerTestCase id=&quot;innertestcase8&quot;&gt;&lt;/innerTestCase&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/testcase&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Check various cases of register pressure with case-insensitive attribute matching (e.g. [foo=bar i]).');
+
+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;innerTestCase&quot;);
+    for (var i = 0; i &lt; allTestCases.length; ++i) {
+        var expectMatch = expectedIds.indexOf(allTestCases[i].id) &gt;= 0;
+        shouldBeEqualToString('getComputedStyle(document.querySelectorAll(&quot;innerTestCase&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(selector, expectedIds);
+    testStyling(selector, expectedIds);
+    debug(&quot;&quot;);
+}
+
+var simpleCases = [
+    [&quot;[type=foobar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[attribute1=VALUE1 i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;,[&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type=foobar i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[attribute1=VALUE1 i] ~ * ~ * &gt;&gt; innerTestCase&quot;,[&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[attribute1=VALUE1 i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;,[&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+
+    [&quot;[type~=fOobar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type~=foObar i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type~=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+
+    [&quot;[type|=foObar i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type|=fooBar i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type|=foobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+
+    [&quot;[type^=fooBa i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type^=fOoba i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type^=fooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+
+    [&quot;[type$=oobAr i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type$=oObar i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type$=oobar i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+
+    [&quot;[type*=oOba i] &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase1&quot;, &quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type*=ooBa i] ~ * ~ * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+    [&quot;[type*=ooba i] ~ * ~ *  &gt; * &gt; * &gt;&gt; innerTestCase&quot;, [&quot;innertestcase2&quot;, &quot;innertestcase3&quot;, &quot;innertestcase4&quot;, &quot;innertestcase5&quot;, &quot;innertestcase6&quot;, &quot;innertestcase7&quot;, &quot;innertestcase8&quot;]],
+];
+
+for (var testCase of simpleCases) {
+    testSelector(testCase[0], testCase[1]);
+}
+
+&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="trunkLayoutTestsfastselectorsquerySelectorexplicitcaseinsensitiveattributematchwithsvgexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg-expected.txt	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+Some attribute needs case insensitive value matching with HTML, they should not match XML elements like SVG. On the other hand, explicitely case-insensitive selector should match SVG.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;[lang=foobar]&quot;).length is 3
+PASS document.querySelectorAll(&quot;[lang=foobar]&quot;)[0].id is &quot;div1&quot;
+PASS document.querySelectorAll(&quot;[lang=foobar]&quot;)[1].id is &quot;div3&quot;
+PASS document.querySelectorAll(&quot;[lang=foobar]&quot;)[2].id is &quot;rect3&quot;
+PASS document.querySelectorAll(&quot;[lang=foobar i]&quot;).length is 4
+PASS document.querySelectorAll(&quot;[lang=foobar i]&quot;)[0].id is &quot;div1&quot;
+PASS document.querySelectorAll(&quot;[lang=foobaR i]&quot;)[1].id is &quot;div3&quot;
+PASS document.querySelectorAll(&quot;[lang=Foobar i]&quot;)[2].id is &quot;rect1&quot;
+PASS document.querySelectorAll(&quot;[lang=FOOBAR i]&quot;)[3].id is &quot;rect3&quot;
+PASS document.querySelectorAll(&quot;[link=foobar]&quot;).length is 3
+PASS document.querySelectorAll(&quot;[link=foobar]&quot;)[0].id is &quot;div2&quot;
+PASS document.querySelectorAll(&quot;[link=foobar]&quot;)[1].id is &quot;div4&quot;
+PASS document.querySelectorAll(&quot;[link=foobar]&quot;)[2].id is &quot;rect4&quot;
+PASS document.querySelectorAll(&quot;[link=foobar i]&quot;).length is 4
+PASS document.querySelectorAll(&quot;[link=foobar i]&quot;)[0].id is &quot;div2&quot;
+PASS document.querySelectorAll(&quot;[link=FOOBAR i]&quot;)[1].id is &quot;div4&quot;
+PASS document.querySelectorAll(&quot;[link=foobaR i]&quot;)[2].id is &quot;rect2&quot;
+PASS document.querySelectorAll(&quot;[link=Foobar i]&quot;)[3].id is &quot;rect4&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsquerySelectorexplicitcaseinsensitiveattributematchwithsvghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html (0 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html	                        (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -0,0 +1,47 @@
</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;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;display:none&quot;&gt;
+    &lt;div id=div1 style=&quot;background-color: red; position: absolute; left:0; width:50px; height:50px&quot;  lang=&quot;FooBar&quot;&gt;&lt;/div&gt;
+    &lt;div id=div2 style=&quot;background-color: red; position: absolute; left:50px; width:50px; height:50px&quot; link=&quot;FooBar&quot;&gt;&lt;/div&gt;
+    &lt;div id=div3 style=&quot;background-color: red; position: absolute; left:100px; width:50px; height:50px&quot; lang=&quot;foobar&quot;&gt;&lt;/div&gt;
+    &lt;div id=div4 style=&quot;background-color: red; position: absolute; left:150px; width:50px; height:50px&quot; link=&quot;foobar&quot;&gt;&lt;/div&gt;
+    
+    &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot; style=&quot;margin-top:50px&quot;&gt;
+        &lt;rect id=rect1 x=&quot;50&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
+        &lt;rect id=rect2 x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;FooBar&quot; style=&quot;fill:green&quot; /&gt;
+        &lt;rect id=rect3 x=&quot;0&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; lang=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
+        &lt;rect id=rect4 x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; link=&quot;foobar&quot; style=&quot;fill:red&quot; /&gt;
+    &lt;/svg&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Some attribute needs case insensitive value matching with HTML, they should not match XML elements like SVG. On the other hand, explicitely case-insensitive selector should match SVG.');
+
+shouldBe('document.querySelectorAll(&quot;[lang=foobar]&quot;).length', '3');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=foobar]&quot;)[0].id', 'div1');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=foobar]&quot;)[1].id', 'div3');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=foobar]&quot;)[2].id', 'rect3');
+
+shouldBe('document.querySelectorAll(&quot;[lang=foobar i]&quot;).length', '4');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=foobar i]&quot;)[0].id', 'div1');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=foobaR i]&quot;)[1].id', 'div3');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=Foobar i]&quot;)[2].id', 'rect1');
+shouldBeEqualToString('document.querySelectorAll(&quot;[lang=FOOBAR i]&quot;)[3].id', 'rect3');
+
+shouldBe('document.querySelectorAll(&quot;[link=foobar]&quot;).length', '3');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=foobar]&quot;)[0].id', 'div2');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=foobar]&quot;)[1].id', 'div4');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=foobar]&quot;)[2].id', 'rect4');
+
+shouldBe('document.querySelectorAll(&quot;[link=foobar i]&quot;).length', '4');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=foobar i]&quot;)[0].id', 'div2');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=FOOBAR i]&quot;)[1].id', 'div4');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=foobaR i]&quot;)[2].id', 'rect2');
+shouldBeEqualToString('document.querySelectorAll(&quot;[link=Foobar i]&quot;)[3].id', 'rect4');
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180543 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2015-02-24 03:25:26 UTC (rev 180543)
+++ trunk/Source/WebCore/ChangeLog	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2015-02-23  Benjamin Poulain  &lt;benjamin at webkit.org&gt;
+
+        CSS JIT: add support for case-insensitive attribute matching
+        https://bugs.webkit.org/show_bug.cgi?id=141880
+
+        Reviewed by Andreas Kling.
+
+        The value matching now has 3 cases:
+        1) Case-sensitive.
+        2) Case-insensitive.
+        3) Legacy HTML Case-insensitive.
+
+        The information to determine the case is split over 2 source:
+        -To know if explicit case-insensitive is needed, we need to ask the selector
+         for attributeValueMatchingIsCaseInsensitive().
+        -To know if the legacy HTML behavior is needed, we need to test the attribute
+         name filter with HTMLDocument::isCaseSensitiveAttribute().
+
+        I decided to perform all those checks at the fragment creation step.
+        This makes the register requirements and code generation more explicit.
+
+        From there, everything is easy: switch() on the type of matching needed,
+        and generate the code. The new case-insensitive case is a simplified version
+        of the legacy HTML behavior without runtime check for the element type.
+
+        Tests: fast/css/implicitly-case-insensitive-attribute-with-svg.html
+               fast/selectors/case-insensitive-attribute-register-requirement-1.html
+               fast/selectors/case-insensitive-attribute-register-requirement-2.html
+               fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html
+
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::attributeSelectorCaseSensitivity):
+        (WebCore::SelectorCompiler::AttributeMatchingInfo::AttributeMatchingInfo):
+        (WebCore::SelectorCompiler::AttributeMatchingInfo::attributeCaseSensitivity):
+        (WebCore::SelectorCompiler::AttributeMatchingInfo::canDefaultToCaseSensitiveValueMatch): Deleted.
+        (WebCore::SelectorCompiler::constructFragmentsInternal):
+        Compute the type of value matching and store it on the AttributeMatchingInfo
+        when creating the fragment.
+
+        (WebCore::SelectorCompiler::minimumRegisterRequirements):
+        (WebCore::SelectorCompiler::attributeValueTestingRequiresExtraRegister):
+        (WebCore::SelectorCompiler::attributeValueTestingRequiresCaseFoldingRegister): Deleted.
+        In general, AttributeCaseSensitivity::CaseInsensitive does not require an extra
+        register. I have made an exception for generateElementAttributeValueExactMatching()
+        for simplicity. I use that register to load the StringImpl of the attribute
+        being tested, that way I can use WTF::equalIgnoringCaseNonNull() directly.
+
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
+        Matching itself is just function calls. Unlike AttributeCaseSensitivity::HTMLLegacyCaseInsensitive,
+        the behavior is consistent between XML and HTML.
+
</ins><span class="cx"> 2015-02-23  Alex Christensen  &lt;achristensen at webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [WinCairo] Unreviewed build fix after r180532
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (180543 => 180544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2015-02-24 03:25:26 UTC (rev 180543)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2015-02-24 03:31:08 UTC (rev 180544)
</span><span class="lines">@@ -112,20 +112,45 @@
</span><span class="cx">     Visited
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum class AttributeCaseSensitivity {
+    CaseSensitive,
+    // Some values are matched case-insensitively for HTML elements.
+    // That is a legacy behavior decided by HTMLDocument::isCaseSensitiveAttribute().
+    HTMLLegacyCaseInsensitive,
+    CaseInsensitive
+};
+
+static AttributeCaseSensitivity attributeSelectorCaseSensitivity(const CSSSelector&amp; selector)
+{
+    ASSERT(selector.isAttributeSelector());
+
+    // This is by convention, the case is irrelevant for Set.
+    if (selector.match() == CSSSelector::Set)
+        return AttributeCaseSensitivity::CaseSensitive;
+
+    if (selector.attributeValueMatchingIsCaseInsensitive())
+        return AttributeCaseSensitivity::CaseInsensitive;
+    if (HTMLDocument::isCaseSensitiveAttribute(selector.attribute()))
+        return AttributeCaseSensitivity::CaseSensitive;
+    return AttributeCaseSensitivity::HTMLLegacyCaseInsensitive;
+}
+
</ins><span class="cx"> class AttributeMatchingInfo {
</span><span class="cx"> public:
</span><del>-    AttributeMatchingInfo(const CSSSelector* selector, bool canDefaultToCaseSensitiveValueMatch)
-        : m_selector(selector)
-        , m_canDefaultToCaseSensitiveValueMatch(canDefaultToCaseSensitiveValueMatch)
</del><ins>+    explicit AttributeMatchingInfo(const CSSSelector&amp; selector)
+        : m_selector(&amp;selector)
+        , m_attributeCaseSensitivity(attributeSelectorCaseSensitivity(selector))
</ins><span class="cx">     {
</span><ins>+        ASSERT(!(m_attributeCaseSensitivity == AttributeCaseSensitivity::CaseInsensitive &amp;&amp; !selector.attributeValueMatchingIsCaseInsensitive()));
+        ASSERT(!(selector.match() == CSSSelector::Set &amp;&amp; m_attributeCaseSensitivity != AttributeCaseSensitivity::CaseSensitive));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool canDefaultToCaseSensitiveValueMatch() const { return m_canDefaultToCaseSensitiveValueMatch; }
</del><ins>+    AttributeCaseSensitivity attributeCaseSensitivity() const { return m_attributeCaseSensitivity; }
</ins><span class="cx">     const CSSSelector&amp; selector() const { return *m_selector; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const CSSSelector* m_selector;
</span><del>-    bool m_canDefaultToCaseSensitiveValueMatch;
</del><ins>+    AttributeCaseSensitivity m_attributeCaseSensitivity;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static const unsigned invalidHeight = std::numeric_limits&lt;unsigned&gt;::max();
</span><span class="lines">@@ -287,8 +312,8 @@
</span><span class="cx">     void generateElementAttributesMatching(Assembler::JumpList&amp; failureCases, const LocalRegister&amp; elementDataAddress, const SelectorFragment&amp;);
</span><span class="cx">     void generateElementAttributeMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, Assembler::RegisterID decIndexRegister, const AttributeMatchingInfo&amp; attributeInfo);
</span><span class="cx">     void generateElementAttributeValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AttributeMatchingInfo&amp; attributeInfo);
</span><del>-    void generateElementAttributeValueExactMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool caseSensitive);
-    void generateElementAttributeFunctionCallValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool caseSensitive, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest);
</del><ins>+    void generateElementAttributeValueExactMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, AttributeCaseSensitivity valueCaseSensitivity);
+    void generateElementAttributeFunctionCallValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, AttributeCaseSensitivity valueCaseSensitivity, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest);
</ins><span class="cx">     void generateElementHasTagName(Assembler::JumpList&amp; failureCases, const CSSSelector&amp; tagMatchingSelector);
</span><span class="cx">     void generateElementHasId(Assembler::JumpList&amp; failureCases, const LocalRegister&amp; elementDataAddress, const AtomicString&amp; idToMatch);
</span><span class="cx">     void generateElementHasClasses(Assembler::JumpList&amp; failureCases, const LocalRegister&amp; elementDataAddress, const Vector&lt;const AtomicStringImpl*&gt;&amp; classNames);
</span><span class="lines">@@ -996,15 +1021,13 @@
</span><span class="cx">             FALLTHROUGH;
</span><span class="cx">         case CSSSelector::Exact:
</span><span class="cx">         case CSSSelector::Hyphen:
</span><del>-            if (selector-&gt;attributeValueMatchingIsCaseInsensitive())
-                return FunctionType::CannotCompile;
</del><span class="cx">             fragment-&gt;onlyMatchesLinksInQuirksMode = false;
</span><del>-            fragment-&gt;attributes.append(AttributeMatchingInfo(selector, HTMLDocument::isCaseSensitiveAttribute(selector-&gt;attribute())));
</del><ins>+            fragment-&gt;attributes.append(AttributeMatchingInfo(*selector));
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case CSSSelector::Set:
</span><span class="cx">             fragment-&gt;onlyMatchesLinksInQuirksMode = false;
</span><del>-            fragment-&gt;attributes.append(AttributeMatchingInfo(selector, true));
</del><ins>+            fragment-&gt;attributes.append(AttributeMatchingInfo(*selector));
</ins><span class="cx">             break;
</span><span class="cx">         case CSSSelector::PagePseudoClass:
</span><span class="cx">             fragment-&gt;onlyMatchesLinksInQuirksMode = false;
</span><span class="lines">@@ -1068,9 +1091,17 @@
</span><span class="cx">     return attributeSelector.attribute().prefix() != starAtom &amp;&amp; !attributeSelector.attribute().namespaceURI().isNull();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool attributeValueTestingRequiresCaseFoldingRegister(const AttributeMatchingInfo&amp; attributeInfo)
</del><ins>+static inline bool attributeValueTestingRequiresExtraRegister(const AttributeMatchingInfo&amp; attributeInfo)
</ins><span class="cx"> {
</span><del>-    return !attributeInfo.canDefaultToCaseSensitiveValueMatch();
</del><ins>+    switch (attributeInfo.attributeCaseSensitivity()) {
+    case AttributeCaseSensitivity::CaseSensitive:
+        return false;
+    case AttributeCaseSensitivity::HTMLLegacyCaseInsensitive:
+        return true;
+    case AttributeCaseSensitivity::CaseInsensitive:
+        return attributeInfo.selector().match() == CSSSelector::Exact;
+    }
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Element + ElementData + a pointer to values + an index on that pointer + the value we expect;
</span><span class="lines">@@ -1098,7 +1129,7 @@
</span><span class="cx">         const AttributeMatchingInfo&amp; attributeInfo = attributes[attributeIndex];
</span><span class="cx">         const CSSSelector&amp; attributeSelector = attributeInfo.selector();
</span><span class="cx">         if (attributeNameTestingRequiresNamespaceRegister(attributeSelector)
</span><del>-            || attributeValueTestingRequiresCaseFoldingRegister(attributeInfo))
</del><ins>+            || attributeValueTestingRequiresExtraRegister(attributeInfo))
</ins><span class="cx">             attributeMinimum += 1;
</span><span class="cx"> 
</span><span class="cx">         minimum = std::max(minimum, attributeMinimum);
</span><span class="lines">@@ -2873,26 +2904,26 @@
</span><span class="cx">     const CSSSelector&amp; attributeSelector = attributeInfo.selector();
</span><span class="cx">     const AtomicString&amp; expectedValue = attributeSelector.value();
</span><span class="cx">     ASSERT(!expectedValue.isNull());
</span><del>-    bool defaultToCaseSensitiveValueMatch = attributeInfo.canDefaultToCaseSensitiveValueMatch();
</del><ins>+    AttributeCaseSensitivity valueCaseSensitivity = attributeInfo.attributeCaseSensitivity();
</ins><span class="cx"> 
</span><span class="cx">     switch (attributeSelector.match()) {
</span><span class="cx">     case CSSSelector::Begin:
</span><del>-        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch, attributeValueBeginsWith&lt;CaseSensitive&gt;, attributeValueBeginsWith&lt;CaseInsensitive&gt;);
</del><ins>+        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity, attributeValueBeginsWith&lt;CaseSensitive&gt;, attributeValueBeginsWith&lt;CaseInsensitive&gt;);
</ins><span class="cx">         break;
</span><span class="cx">     case CSSSelector::Contain:
</span><del>-        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch, attributeValueContains&lt;CaseSensitive&gt;, attributeValueContains&lt;CaseInsensitive&gt;);
</del><ins>+        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity, attributeValueContains&lt;CaseSensitive&gt;, attributeValueContains&lt;CaseInsensitive&gt;);
</ins><span class="cx">         break;
</span><span class="cx">     case CSSSelector::End:
</span><del>-        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch, attributeValueEndsWith&lt;CaseSensitive&gt;, attributeValueEndsWith&lt;CaseInsensitive&gt;);
</del><ins>+        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity, attributeValueEndsWith&lt;CaseSensitive&gt;, attributeValueEndsWith&lt;CaseInsensitive&gt;);
</ins><span class="cx">         break;
</span><span class="cx">     case CSSSelector::Exact:
</span><del>-        generateElementAttributeValueExactMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch);
</del><ins>+        generateElementAttributeValueExactMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity);
</ins><span class="cx">         break;
</span><span class="cx">     case CSSSelector::Hyphen:
</span><del>-        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch, attributeValueMatchHyphenRule&lt;CaseSensitive&gt;, attributeValueMatchHyphenRule&lt;CaseInsensitive&gt;);
</del><ins>+        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity, attributeValueMatchHyphenRule&lt;CaseSensitive&gt;, attributeValueMatchHyphenRule&lt;CaseInsensitive&gt;);
</ins><span class="cx">         break;
</span><span class="cx">     case CSSSelector::List:
</span><del>-        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, defaultToCaseSensitiveValueMatch, attributeValueSpaceSeparetedListContains&lt;CaseSensitive&gt;, attributeValueSpaceSeparetedListContains&lt;CaseInsensitive&gt;);
</del><ins>+        generateElementAttributeFunctionCallValueMatching(failureCases, currentAttributeAddress, expectedValue, valueCaseSensitivity, attributeValueSpaceSeparetedListContains&lt;CaseSensitive&gt;, attributeValueSpaceSeparetedListContains&lt;CaseInsensitive&gt;);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -2904,14 +2935,17 @@
</span><span class="cx">     return assembler.branchTest32(condition, Assembler::Address(documentAddress, Document::documentClassesMemoryOffset()), Assembler::TrustedImm32(Document::isHTMLDocumentClassFlag()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SelectorCodeGenerator::generateElementAttributeValueExactMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool canDefaultToCaseSensitiveValueMatch)
</del><ins>+void SelectorCodeGenerator::generateElementAttributeValueExactMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, AttributeCaseSensitivity valueCaseSensitivity)
</ins><span class="cx"> {
</span><span class="cx">     LocalRegisterWithPreference expectedValueRegister(m_registerAllocator, JSC::GPRInfo::argumentGPR1);
</span><span class="cx">     m_assembler.move(Assembler::TrustedImmPtr(expectedValue.impl()), expectedValueRegister);
</span><span class="cx"> 
</span><del>-    if (canDefaultToCaseSensitiveValueMatch)
</del><ins>+    switch (valueCaseSensitivity) {
+    case AttributeCaseSensitivity::CaseSensitive: {
</ins><span class="cx">         failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(currentAttributeAddress, Attribute::valueMemoryOffset()), expectedValueRegister));
</span><del>-    else {
</del><ins>+        break;
+    }
+    case AttributeCaseSensitivity::HTMLLegacyCaseInsensitive: {
</ins><span class="cx">         Assembler::Jump skipCaseInsensitiveComparison = m_assembler.branchPtr(Assembler::Equal, Assembler::Address(currentAttributeAddress, Attribute::valueMemoryOffset()), expectedValueRegister);
</span><span class="cx"> 
</span><span class="cx">         // If the element is an HTML element, in a HTML dcoument (not including XHTML), value matching is case insensitive.
</span><span class="lines">@@ -2934,20 +2968,38 @@
</span><span class="cx">         failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
</span><span class="cx"> 
</span><span class="cx">         skipCaseInsensitiveComparison.link(&amp;m_assembler);
</span><ins>+        break;
</ins><span class="cx">     }
</span><ins>+    case AttributeCaseSensitivity::CaseInsensitive: {
+        LocalRegister valueStringImpl(m_registerAllocator);
+        m_assembler.loadPtr(Assembler::Address(currentAttributeAddress, Attribute::valueMemoryOffset()), valueStringImpl);
+
+        Assembler::Jump skipCaseInsensitiveComparison = m_assembler.branchPtr(Assembler::Equal, valueStringImpl, expectedValueRegister);
+        FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+        functionCall.setFunctionAddress(WTF::equalIgnoringCaseNonNull);
+        functionCall.setTwoArguments(valueStringImpl, expectedValueRegister);
+        failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
+        skipCaseInsensitiveComparison.link(&amp;m_assembler);
+        break;
+    }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool canDefaultToCaseSensitiveValueMatch, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest)
</del><ins>+void SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, AttributeCaseSensitivity valueCaseSensitivity, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest)
</ins><span class="cx"> {
</span><span class="cx">     LocalRegisterWithPreference expectedValueRegister(m_registerAllocator, JSC::GPRInfo::argumentGPR1);
</span><span class="cx">     m_assembler.move(Assembler::TrustedImmPtr(expectedValue.impl()), expectedValueRegister);
</span><span class="cx"> 
</span><del>-    if (canDefaultToCaseSensitiveValueMatch) {
</del><ins>+
+    switch (valueCaseSensitivity) {
+    case AttributeCaseSensitivity::CaseSensitive: {
</ins><span class="cx">         FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
</span><span class="cx">         functionCall.setFunctionAddress(caseSensitiveTest);
</span><span class="cx">         functionCall.setTwoArguments(currentAttributeAddress, expectedValueRegister);
</span><span class="cx">         failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
</span><del>-    } else {
</del><ins>+        break;
+    }
+    case AttributeCaseSensitivity::HTMLLegacyCaseInsensitive: {
</ins><span class="cx">         Assembler::JumpList shouldUseCaseSensitiveComparison;
</span><span class="cx">         shouldUseCaseSensitiveComparison.append(testIsHTMLFlagOnNode(Assembler::Zero, m_assembler, elementAddressRegister));
</span><span class="cx">         {
</span><span class="lines">@@ -2977,7 +3029,16 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         skipCaseSensitiveCase.link(&amp;m_assembler);
</span><ins>+        break;
</ins><span class="cx">     }
</span><ins>+    case AttributeCaseSensitivity::CaseInsensitive: {
+        FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+        functionCall.setFunctionAddress(caseInsensitiveTest);
+        functionCall.setTwoArguments(currentAttributeAddress, expectedValueRegister);
+        failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
+        break;
+    }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SelectorCodeGenerator::generateElementFunctionCallTest(Assembler::JumpList&amp; failureCases, JSC::FunctionPtr testFunction)
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list