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

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

<h3>Log Message</h3>
<pre>Fix CSS Selector's tag name matching when mixing HTML and XML
https://bugs.webkit.org/show_bug.cgi?id=140878

Reviewed by Darin Adler.

Source/WebCore:

Previsouly, WebKit was unable to match any XML element that had
any uppercase character if the stylesheet was in a HTML document.
This problem was most often reported due to the inability to style
SVG-in-HTML.

The reason was that the tag local name was incorrectly transformed
to lowercase at parsing time. Instead, we are supposed to only
do case-insensitive match for HTML elements in a HTML document.

This fix is very similar with how we handle attributes:
-Keep both the original and the lowercase versions of the name.
-When matching, chose which version to use depending on the element being matched.

There is one major difference in the way the names are stored.
Unlike attribute selectors, tag name selectors are common, and the uppercase
version is not that uncommon. I wanted to preserve the dense representation
so I specialized CSSSelector specifically for tag names.

To store the data, if the name is already lowercase, just use the m_data pointer
as usual.
If the name is not lowercase, allocate a new small structure in the union to store
both names.

Tests: fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html
       fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml
       fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml
       fast/css/tagname-case-sensitivity-svg-in-html.html
       fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml
       fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml
       fast/css/tagname-case-sensitivity-xml-in-html.html
       fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml
       fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml
       fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html
       fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml
       fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html
       fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml
       fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html
       fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml
       fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html
       fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml
       fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html
       fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html

* css/CSSGrammar.y.in:
The parser is unaware of anything case related. CSSSelector takes care of that.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::createRareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::NameWithCase::NameWithCase):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::tagQName):
(WebCore::CSSSelector::tagLowercaseLocalName):
The new representation stores both the original form and the lower case
form.

* css/RuleSet.cpp:
(WebCore::RuleSet::addRule):
(WebCore::RuleSet::shrinkToFit):
* css/RuleSet.h:
(WebCore::RuleSet::tagRules):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
The tag name partition is now split in two: lowercase and original case.
If the matched element is HTML, the lowercase partition is used. 

* css/SelectorFilter.cpp:
(WebCore::collectElementIdentifierHashes):
(WebCore::collectDescendantSelectorIdentifierHashes):
This is the most annoying part of the patch performance wise:
the bloom filter knows the case of the real elements but it cannot know
how selectors will match them.

To make it work, all names are now converted to lowercase.
That implies that we can filter less on XML and we may have to pay for
converting the tag name to lowercase.

I expect the performance hit to be small because:
-Having two XML elements with the same name but different case is uncommon.
-Most elements use lowercase names.

Still sad...that's the price to pay for correctness.

* css/SelectorChecker.cpp:
(WebCore::tagMatches):
(WebCore::SelectorChecker::checkOne):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::tagMatches): Deleted.
Update the legacy matcher, nothing special.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
(WebCore::SelectorCompiler::TagNamePattern::TagNamePattern):
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::equalTagNames):
(WebCore::SelectorCompiler::equalTagNamePatterns):
(WebCore::SelectorCompiler::computeBacktrackingStartOffsetInChain):
(WebCore::SelectorCompiler::computeBacktrackingHeightFromDescendant):
(WebCore::SelectorCompiler::computeBacktrackingWidthFromIndirectAdjacent):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
Tag names are used to optimize backtracking; this is quite common for descendant
(e.g. div &gt; ul &gt; li).
We have to differenciate one new case there: if two tag names are equal
when compared case-insensitively but strictly different, they may still
be equal if they don't match the same kind of elements or both matches
and HTML element.

* dom/SelectorQuery.cpp:
(WebCore::localNameMatches):
(WebCore::elementsForLocalName):
(WebCore::SelectorDataList::executeSingleTagNameSelectorData):
Update the inline versions of SelectorQuery.

LayoutTests:

We had very little coverage for XHTML and XML in HTML.
I added lots of new tests to cover the basics.

* fast/dom/css-dom-read-2-expected.txt:
* fast/dom/css-dom-read-expected.txt:
CSSOM now provide the tagname in the original case instead of lowercase,
which is actually what the spec defines:
&quot;If the character is not handled by one of the above rules and is greater
 than or equal to U+0080, is &quot;-&quot; (U+002D) or &quot;_&quot; (U+005F), or is in one
 of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A),
 or [a-z] (U+0061 to U+007A), then the character itself.&quot;

* fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html: Added.
* fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html: Added.
* fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml: Added.
* fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml: Added.
* fast/css/tagname-case-sensitivity-svg-in-html-expected.html: Added.
* fast/css/tagname-case-sensitivity-svg-in-html.html: Added.
* fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml: Added.
* fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
* fast/css/tagname-case-sensitivity-xml-in-html-expected.html: Added.
* fast/css/tagname-case-sensitivity-xml-in-html.html: Added.
* fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml: Added.
* fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml: Added.
* fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
* fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html: Added.
* fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
* fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
* fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
* fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html: Added.
* fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
* fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt: Added.
* fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml: Added.
* fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt: Added.
* fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html: Added.
* fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt: Added.
* fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomcssdomread2expectedtxt">trunk/LayoutTests/fast/dom/css-dom-read-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomcssdomreadexpectedtxt">trunk/LayoutTests/fast/dom/css-dom-read-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorh">trunk/Source/WebCore/css/CSSSelector.h</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssRuleSetcpp">trunk/Source/WebCore/css/RuleSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssRuleSeth">trunk/Source/WebCore/css/RuleSet.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerh">trunk/Source/WebCore/css/SelectorChecker.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorFiltercpp">trunk/Source/WebCore/css/SelectorFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCoredomSelectorQuerycpp">trunk/Source/WebCore/dom/SelectorQuery.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinhtmlexpectedhtml">trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinhtmlhtml">trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinxhtmlexpectedxhtml">trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinxhtmlxhtml">trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivitysvginhtmlexpectedhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivitysvginhtmlhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivitysvginxhtmlexpectedxhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivitysvginxhtmlxhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivityxmlinhtmlexpectedhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivityxmlinhtmlhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivityxmlinxhtmlexpectedxhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastcsstagnamecasesensitivityxmlinxhtmlxhtml">trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginhtmlhtml">trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginxhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginxhtmlxhtml">trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginhtmlhtml">trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginxhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginxhtmlxhtml">trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginhtmlhtml">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginxhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginxhtmlxhtml">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinhtmlhtml">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinxhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinxhtmlxhtml">trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastselectorstagnameadjacentbacktrackingcasesensitivityhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorstagnameadjacentbacktrackingcasesensitivityhtmlhtml">trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorstagnamedescendantbacktrackingcasesensitivityhtmlexpectedtxt">trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorstagnamedescendantbacktrackingcasesensitivityhtmlhtml">trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/LayoutTests/ChangeLog        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2015-01-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Fix CSS Selector's tag name matching when mixing HTML and XML
+        https://bugs.webkit.org/show_bug.cgi?id=140878
+
+        Reviewed by Darin Adler.
+
+        We had very little coverage for XHTML and XML in HTML.
+        I added lots of new tests to cover the basics.
+
+        * fast/dom/css-dom-read-2-expected.txt:
+        * fast/dom/css-dom-read-expected.txt:
+        CSSOM now provide the tagname in the original case instead of lowercase,
+        which is actually what the spec defines:
+        &quot;If the character is not handled by one of the above rules and is greater
+         than or equal to U+0080, is &quot;-&quot; (U+002D) or &quot;_&quot; (U+005F), or is in one
+         of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A),
+         or [a-z] (U+0061 to U+007A), then the character itself.&quot;
+
+        * fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html: Added.
+        * fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html: Added.
+        * fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml: Added.
+        * fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml: Added.
+        * fast/css/tagname-case-sensitivity-svg-in-html-expected.html: Added.
+        * fast/css/tagname-case-sensitivity-svg-in-html.html: Added.
+        * fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml: Added.
+        * fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
+        * fast/css/tagname-case-sensitivity-xml-in-html-expected.html: Added.
+        * fast/css/tagname-case-sensitivity-xml-in-html.html: Added.
+        * fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml: Added.
+        * fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml: Added.
+        * fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
+        * fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html: Added.
+        * fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
+        * fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
+        * fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
+        * fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html: Added.
+        * fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
+        * fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt: Added.
+        * fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml: Added.
+        * fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt: Added.
+        * fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html: Added.
+        * fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt: Added.
+        * fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html: Added.
+
</ins><span class="cx"> 2015-01-26  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Remove references to removed tests from GTK+ TestExpectations.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinhtmlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html-expected.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+
+target1, target2, target3, target4 {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+
+target1 {
+    background-color: cyan;
+    border: 2px solid darkblue;
+    color: maroon;
+}
+
+target2 {
+    background-color: red;
+}
+target3 {
+    border: 2px solid blue;
+}
+target4 {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target2&gt;Target&lt;/target2&gt;&lt;target3&gt;Target&lt;/target3&gt;&lt;target4&gt;Target&lt;/target4&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+@namespace WebKit url(https://www.webkit.org/awesome);
+@namespace AweWebKit url(https://www.webkit.org/Awesome);
+@namespace XHTML url(http://www.w3.org/1999/xhtml);
+
+target, Target, TARGET {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+
+XHTML|target {
+    background-color: cyan;
+}
+XHTML|Target {
+    border: 2px solid darkblue;
+}
+XHTML|TARGET {
+    color: maroon;
+}
+
+WebKit|target {
+    background-color: red;
+}
+WebKit|Target {
+    border: 2px solid blue;
+}
+WebKit|TARGET {
+    color: green;
+}
+
+webkit|target {
+    background-color: purple;
+}
+webkit|Target {
+    border: 2px solid yellow;
+}
+webkit|TARGET {
+    color: orange;
+}
+
+AweWebKit|target {
+    background-color: lime;
+}
+AweWebKit|Target {
+    border: 2px solid olive;
+}
+AweWebKit|TARGET {
+    color: silver;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target&gt;Target&lt;/target&gt;
+        &lt;Target&gt;Target&lt;/Target&gt;
+        &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target&gt;Target&lt;/target&gt;
+            &lt;Target&gt;Target&lt;/Target&gt;
+            &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target&gt;Target&lt;/target&gt;&lt;Target&gt;Target&lt;/Target&gt;&lt;TARGET&gt;Target&lt;/TARGET&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinxhtmlexpectedxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+
+target1, target2, target3, target4, target5, target6 {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+
+target1 {
+    background-color: cyan;
+}
+target2 {
+    border: 2px solid darkblue;
+}
+target3 {
+    color: maroon;
+}
+
+target4 {
+    background-color: red;
+}
+target5 {
+    border: 2px solid blue;
+}
+target6 {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;target2&gt;Target&lt;/target2&gt;
+        &lt;target3&gt;Target&lt;/target3&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target4&gt;Target&lt;/target4&gt;
+            &lt;target5&gt;Target&lt;/target5&gt;
+            &lt;target6&gt;Target&lt;/target6&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target4&gt;Target&lt;/target4&gt;&lt;target5&gt;Target&lt;/target5&gt;&lt;target6&gt;Target&lt;/target6&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnameandnamespacecasesensitivityxmlinxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+@namespace WebKit url(https://www.webkit.org/awesome);
+@namespace AweWebKit url(https://www.webkit.org/Awesome);
+@namespace XHTML url(http://www.w3.org/1999/xhtml);
+
+target, Target, TARGET {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+
+XHTML|target {
+    background-color: cyan;
+}
+XHTML|Target {
+    border: 2px solid darkblue;
+}
+XHTML|TARGET {
+    color: maroon;
+}
+
+WebKit|target {
+    background-color: red;
+}
+WebKit|Target {
+    border: 2px solid blue;
+}
+WebKit|TARGET {
+    color: green;
+}
+
+webkit|target {
+    background-color: purple;
+}
+webkit|Target {
+    border: 2px solid yellow;
+}
+webkit|TARGET {
+    color: orange;
+}
+
+AweWebKit|target {
+    background-color: lime;
+}
+AweWebKit|Target {
+    border: 2px solid olive;
+}
+AweWebKit|TARGET {
+    color: silver;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target&gt;Target&lt;/target&gt;
+        &lt;Target&gt;Target&lt;/Target&gt;
+        &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target&gt;Target&lt;/target&gt;
+            &lt;Target&gt;Target&lt;/Target&gt;
+            &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target&gt;Target&lt;/target&gt;&lt;Target&gt;Target&lt;/Target&gt;&lt;TARGET&gt;Target&lt;/TARGET&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivitysvginhtmlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html-expected.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html-expected.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML (specifically SVG in this case).&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;rect style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue; stroke: purple; border: 2px dashed lime; fill: yellow; background-color: orange;&quot;&gt;&lt;/rect&gt;
+        &lt;Rect style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue; stroke: purple; border: 2px dashed lime; fill: yellow; background-color: orange;&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue; stroke: purple; border: 2px dashed lime; fill: yellow; background-color: orange;&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/rect&gt;
+            &lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/rect&gt;&lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;stroke: purple; border: 2px dashed lime;&quot;&gt;&lt;/Rect&gt;&lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;fill: yellow; background-color: orange;&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivitysvginhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+rect {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    border: 1px solid red;
+    display: block;
+    float: left;
+    stroke: purple;
+    fill: blue;
+}
+Rect {
+    stroke: purple;
+    border: 2px dashed lime;
+}
+RECT {
+    fill: yellow;
+    background-color: orange;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML (specifically SVG in this case).&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;rect&gt;&lt;/rect&gt;
+        &lt;Rect&gt;&lt;/Rect&gt;
+        &lt;RECT&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/rect&gt;
+            &lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/rect&gt;&lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/Rect&gt;&lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivitysvginxhtmlexpectedxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should always be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;rect style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/rect&gt;
+        &lt;Rect style=&quot;stroke: purple; border: 2px dashed lime;&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT style=&quot;fill: yellow; background-color: orange;&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/rect&gt;
+            &lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;stroke: purple; border: 2px dashed lime;&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;fill: yellow; background-color: orange;&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect width=&quot;100&quot; height=&quot;100&quot; style=&quot;width: 100px; height: 100px; background-color: green; border: 1px solid red; display: block; float: left; stroke: purple; fill: blue;&quot;&gt;&lt;/rect&gt;&lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;stroke: purple; border: 2px dashed lime;&quot;&gt;&lt;/Rect&gt;&lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot; style=&quot;fill: yellow; background-color: orange;&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivitysvginxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+rect {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    border: 1px solid red;
+    display: block;
+    float: left;
+    stroke: purple;
+    fill: blue;
+}
+Rect {
+    stroke: purple;
+    border: 2px dashed lime;
+}
+RECT {
+    fill: yellow;
+    background-color: orange;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should always be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;rect&gt;&lt;/rect&gt;
+        &lt;Rect&gt;&lt;/Rect&gt;
+        &lt;RECT&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/rect&gt;
+            &lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/rect&gt;&lt;Rect x=&quot;100&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/Rect&gt;&lt;RECT x=&quot;200&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivityxmlinhtmlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html-expected.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html-expected.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+target1, target2, target3, target4 {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+target1 {
+    background-color: red;
+    border: 2px solid blue;
+    color: green;
+}
+target2 {
+    background-color: red;
+}
+target3 {
+    border: 2px solid blue;
+}
+target4 {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target1 class=&quot;&quot;&gt;Target&lt;/target1&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target2&gt;Target&lt;/target2&gt;&lt;target3&gt;Target&lt;/target3&gt;&lt;target4&gt;Target&lt;/target4&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivityxmlinhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+target, Target, TARGET {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+target {
+    background-color: red;
+}
+Target {
+    border: 2px solid blue;
+}
+TARGET {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-insensitive for HTML, case-sensitive for XML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target&gt;Target&lt;/target&gt;
+        &lt;Target&gt;Target&lt;/Target&gt;
+        &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target&gt;Target&lt;/target&gt;
+            &lt;Target&gt;Target&lt;/Target&gt;
+            &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target&gt;Target&lt;/target&gt;&lt;Target&gt;Target&lt;/Target&gt;&lt;TARGET&gt;Target&lt;/TARGET&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivityxmlinxhtmlexpectedxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+target1, target2, target3, target4 {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+target1 {
+    background-color: red;
+}
+target2 {
+    border: 2px solid blue;
+}
+target3 {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target1 class=&quot;&quot;&gt;Target&lt;/target1&gt;
+        &lt;target2&gt;Target&lt;/target2&gt;
+        &lt;target3&gt;Target&lt;/target3&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target1&gt;Target&lt;/target1&gt;
+            &lt;target2&gt;Target&lt;/target2&gt;
+            &lt;target3&gt;Target&lt;/target3&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target1&gt;Target&lt;/target1&gt;&lt;target2&gt;Target&lt;/target2&gt;&lt;target3&gt;Target&lt;/target3&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstagnamecasesensitivityxmlinxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+target, Target, TARGET {
+    width: 100px;
+    height: 100px;
+    display: block;
+    float: left;
+    background-color: white;
+    color: white;
+    border: none;
+}
+target {
+    background-color: red;
+}
+Target {
+    border: 2px solid blue;
+}
+TARGET {
+    color: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test styling of elements using their local name. Matching the name should be case-sensitive for XHTML.&lt;/p&gt;
+    &lt;div id=&quot;test-cases&quot;&gt;
+        &lt;target&gt;Target&lt;/target&gt;
+        &lt;Target&gt;Target&lt;/Target&gt;
+        &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;target&gt;Target&lt;/target&gt;
+            &lt;Target&gt;Target&lt;/Target&gt;
+            &lt;TARGET&gt;Target&lt;/TARGET&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+    var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;target&gt;Target&lt;/target&gt;&lt;Target&gt;Target&lt;/Target&gt;&lt;TARGET&gt;Target&lt;/TARGET&gt;&lt;/xml&gt;', 'text/xml');
+    var testCases = document.getElementById(&quot;test-cases&quot;);
+    testCases.appendChild(document.importNode(xmlDocument.documentElement, true));
+]]&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcssdomread2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/css-dom-read-2-expected.txt (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/css-dom-read-2-expected.txt        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/LayoutTests/fast/dom/css-dom-read-2-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> .two { display: inline; } 
</span><span class="cx"> .three { display: list-item; list-style-type: square; margin-left: 3em; } 
</span><span class="cx"> .four { display: none; color: red; } 
</span><del>-i { display: block; } 
</del><ins>+I { display: block; } 
</ins><span class="cx"> 
</span><span class="cx"> @import url(&quot;fancyfonts.css&quot;) screen;
</span><span class="cx"> @media print { 
</span><span class="lines">@@ -45,6 +45,6 @@
</span><span class="cx"> .two { display: inline; }
</span><span class="cx"> .three { display: list-item; list-style-type: square; margin-left: 3em; }
</span><span class="cx"> .four { display: none; color: red; }
</span><del>-i { display: block; }
</del><ins>+I { display: block; }
</ins><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcssdomreadexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/css-dom-read-expected.txt (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/css-dom-read-expected.txt        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/LayoutTests/fast/dom/css-dom-read-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -9,5 +9,5 @@
</span><span class="cx"> .two { display: inline; }
</span><span class="cx"> .three { display: list-item; list-style-type: square; margin-left: 3em; }
</span><span class="cx"> .four { display: none; color: red; }
</span><del>-i { display: block; }
</del><ins>+I { display: block; }
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-HTML with Element.closest().
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('target1').closest('Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('CONTAINER').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('Container') is null
+PASS document.getElementById('target2').closest('container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('CONTAINER') is null
+PASS document.getElementById('target3').closest('Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('CONTAINER').getAttribute('class') is &quot;container1&quot;
+
+Compound selectors.
+PASS document.getElementById('target1').closest('Container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('CONTAINER[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('Container[class^=&quot;container&quot;]') is null
+PASS document.getElementById('target2').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('CONTAINER[class^=&quot;container&quot;]') is null
+PASS document.getElementById('target3').closest('Container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('CONTAINER[class^=&quot;container&quot;]').getAttribute('class') is &quot;container1&quot;
+
+Complex selectors.
+PASS document.getElementById('target1').closest('div Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('div container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('div CONTAINER').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('div Container') is null
+PASS document.getElementById('target2').closest('div container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('div CONTAINER') is null
+PASS document.getElementById('target3').closest('div Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('div container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('div CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target3').closest('container &gt; Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('CONTAINER &gt; Container') is null
+PASS document.getElementById('target3').closest('Container &gt; Container') is null
+PASS document.getElementById('target3').closest('CONTAINER &gt; container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('Container &gt; container') is null
+PASS document.getElementById('target3').closest('container &gt; container') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,93 @@
</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 id=&quot;test-cases&quot; style=&quot;display:none;&quot;&gt;
+        &lt;CONTAINER class=&quot;container1&quot;&gt;
+            &lt;container class=&quot;container2&quot;&gt;
+                &lt;Container class=&quot;container3&quot;&gt;
+                    &lt;target id=&quot;target1&quot;&gt;&lt;/target&gt;
+                &lt;/Container&gt;
+            &lt;/container&gt;
+        &lt;/CONTAINER&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;CONTAINER class=&quot;container1&quot;&gt;
+                &lt;container class=&quot;container2&quot;&gt;
+                    &lt;Container class=&quot;container3&quot;&gt;
+                        &lt;target id=&quot;target2&quot;&gt;&lt;/target&gt;
+                    &lt;/Container&gt;
+                &lt;/container&gt;
+            &lt;/CONTAINER&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-HTML with Element.closest().&quot;);
+
+var testCases = document.getElementById(&quot;test-cases&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;CONTAINER class=&quot;container1&quot;&gt;&lt;container class=&quot;container2&quot;&gt;&lt;Container class=&quot;container3&quot;&gt;&lt;target id=&quot;target3&quot;&gt;&lt;/target&gt;&lt;/Container&gt;&lt;/container&gt;&lt;/CONTAINER&gt;&lt;/svg&gt;', 'text/xml');
+testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function testSelector(sourceID, selector, expectedClass)
+{
+    if (expectedClass)
+        shouldBeEqualToString(&quot;document.getElementById('&quot; + sourceID + &quot;').closest('&quot; + selector + &quot;').getAttribute('class')&quot;, '' + expectedClass);
+    else
+        shouldBe(&quot;document.getElementById('&quot; + sourceID + &quot;').closest('&quot; + selector + &quot;')&quot;, &quot;null&quot;);
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;target1&quot;, &quot;Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;CONTAINER&quot;, &quot;container3&quot;);
+
+testSelector(&quot;target2&quot;, &quot;Container&quot;);
+testSelector(&quot;target2&quot;, &quot;container&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;CONTAINER&quot;);
+
+testSelector(&quot;target3&quot;, &quot;Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER&quot;, &quot;container1&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;target1&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+
+testSelector(&quot;target2&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;);
+testSelector(&quot;target2&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;);
+
+testSelector(&quot;target3&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;, &quot;container1&quot;);
+
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;target1&quot;, &quot;div Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;div container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;div CONTAINER&quot;, &quot;container3&quot;);
+
+testSelector(&quot;target2&quot;, &quot;div Container&quot;);
+testSelector(&quot;target2&quot;, &quot;div container&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;div CONTAINER&quot;);
+
+testSelector(&quot;target3&quot;, &quot;div Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;div container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;div CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target3&quot;, &quot;container &gt; Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER &gt; Container&quot;);
+testSelector(&quot;target3&quot;, &quot;Container &gt; Container&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER &gt; container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;Container &gt; container&quot;);
+testSelector(&quot;target3&quot;, &quot;container &gt; container&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginxhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-XHTML with Element.closest().
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('target1').closest('Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target1').closest('CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target2').closest('Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target2').closest('CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target3').closest('Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('CONTAINER').getAttribute('class') is &quot;container1&quot;
+
+Compound selectors.
+PASS document.getElementById('target1').closest('Container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target1').closest('CONTAINER[class^=&quot;container&quot;]').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target2').closest('Container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target2').closest('CONTAINER[class^=&quot;container&quot;]').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target3').closest('Container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('container[class^=&quot;container&quot;]').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('CONTAINER[class^=&quot;container&quot;]').getAttribute('class') is &quot;container1&quot;
+
+Complex selectors.
+PASS document.getElementById('target1').closest('div Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target1').closest('div container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target1').closest('div CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target2').closest('div Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target2').closest('div container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target2').closest('div CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target3').closest('div Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('div container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('div CONTAINER').getAttribute('class') is &quot;container1&quot;
+PASS document.getElementById('target3').closest('container &gt; Container').getAttribute('class') is &quot;container3&quot;
+PASS document.getElementById('target3').closest('CONTAINER &gt; Container') is null
+PASS document.getElementById('target3').closest('Container &gt; Container') is null
+PASS document.getElementById('target3').closest('CONTAINER &gt; container').getAttribute('class') is &quot;container2&quot;
+PASS document.getElementById('target3').closest('Container &gt; container') is null
+PASS document.getElementById('target3').closest('container &gt; container') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementclosesttagnamecasesensitivitysvginxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&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 id=&quot;test-cases&quot; style=&quot;display:none;&quot;&gt;
+        &lt;CONTAINER class=&quot;container1&quot;&gt;
+            &lt;container class=&quot;container2&quot;&gt;
+                &lt;Container class=&quot;container3&quot;&gt;
+                    &lt;target id=&quot;target1&quot;&gt;&lt;/target&gt;
+                &lt;/Container&gt;
+            &lt;/container&gt;
+        &lt;/CONTAINER&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;CONTAINER class=&quot;container1&quot;&gt;
+                &lt;container class=&quot;container2&quot;&gt;
+                    &lt;Container class=&quot;container3&quot;&gt;
+                        &lt;target id=&quot;target2&quot;&gt;&lt;/target&gt;
+                    &lt;/Container&gt;
+                &lt;/container&gt;
+            &lt;/CONTAINER&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-XHTML with Element.closest().&quot;);
+
+var testCases = document.getElementById(&quot;test-cases&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;CONTAINER class=&quot;container1&quot;&gt;&lt;container class=&quot;container2&quot;&gt;&lt;Container class=&quot;container3&quot;&gt;&lt;target id=&quot;target3&quot;&gt;&lt;/target&gt;&lt;/Container&gt;&lt;/container&gt;&lt;/CONTAINER&gt;&lt;/svg&gt;', 'text/xml');
+testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function testSelector(sourceID, selector, expectedClass)
+{
+    if (expectedClass)
+        shouldBeEqualToString(&quot;document.getElementById('&quot; + sourceID + &quot;').closest('&quot; + selector + &quot;').getAttribute('class')&quot;, '' + expectedClass);
+    else
+        shouldBe(&quot;document.getElementById('&quot; + sourceID + &quot;').closest('&quot; + selector + &quot;')&quot;, &quot;null&quot;);
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;target1&quot;, &quot;Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;container&quot;, &quot;container2&quot;);
+testSelector(&quot;target1&quot;, &quot;CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target2&quot;, &quot;Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;container&quot;, &quot;container2&quot;);
+testSelector(&quot;target2&quot;, &quot;CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target3&quot;, &quot;Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER&quot;, &quot;container1&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;target1&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container2&quot;);
+testSelector(&quot;target1&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target2&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container2&quot;);
+testSelector(&quot;target2&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target3&quot;, &quot;Container[class^=\&quot;container\&quot;]&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;container[class^=\&quot;container\&quot;]&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER[class^=\&quot;container\&quot;]&quot;, &quot;container1&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;target1&quot;, &quot;div Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target1&quot;, &quot;div container&quot;, &quot;container2&quot;);
+testSelector(&quot;target1&quot;, &quot;div CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target2&quot;, &quot;div Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target2&quot;, &quot;div container&quot;, &quot;container2&quot;);
+testSelector(&quot;target2&quot;, &quot;div CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target3&quot;, &quot;div Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;div container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;div CONTAINER&quot;, &quot;container1&quot;);
+
+testSelector(&quot;target3&quot;, &quot;container &gt; Container&quot;, &quot;container3&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER &gt; Container&quot;);
+testSelector(&quot;target3&quot;, &quot;Container &gt; Container&quot;);
+testSelector(&quot;target3&quot;, &quot;CONTAINER &gt; container&quot;, &quot;container2&quot;);
+testSelector(&quot;target3&quot;, &quot;Container &gt; container&quot;);
+testSelector(&quot;target3&quot;, &quot;container &gt; container&quot;);
+
+]]&gt;&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="trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-HTML with Element.matches().
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('container1').matches('Container') is true
+PASS document.getElementById('container1').matches('container') is true
+PASS document.getElementById('container1').matches('CONTAINER') is true
+PASS document.getElementById('container2').matches('Container') is true
+PASS document.getElementById('container2').matches('container') is true
+PASS document.getElementById('container2').matches('CONTAINER') is true
+PASS document.getElementById('container3').matches('Container') is true
+PASS document.getElementById('container3').matches('container') is true
+PASS document.getElementById('container3').matches('CONTAINER') is true
+PASS document.getElementById('container4').matches('Container') is false
+PASS document.getElementById('container4').matches('container') is true
+PASS document.getElementById('container4').matches('CONTAINER') is false
+PASS document.getElementById('container5').matches('Container') is false
+PASS document.getElementById('container5').matches('container') is true
+PASS document.getElementById('container5').matches('CONTAINER') is false
+PASS document.getElementById('container6').matches('Container') is false
+PASS document.getElementById('container6').matches('container') is true
+PASS document.getElementById('container6').matches('CONTAINER') is false
+PASS document.getElementById('container7').matches('Container') is false
+PASS document.getElementById('container7').matches('container') is false
+PASS document.getElementById('container7').matches('CONTAINER') is true
+PASS document.getElementById('container8').matches('Container') is false
+PASS document.getElementById('container8').matches('container') is true
+PASS document.getElementById('container8').matches('CONTAINER') is false
+PASS document.getElementById('container9').matches('Container') is true
+PASS document.getElementById('container9').matches('container') is false
+PASS document.getElementById('container9').matches('CONTAINER') is false
+
+Complex selectors
+PASS document.getElementById('container1').matches('div Container') is true
+PASS document.getElementById('container1').matches('div container') is true
+PASS document.getElementById('container1').matches('div CONTAINER') is true
+PASS document.getElementById('container2').matches('div Container') is true
+PASS document.getElementById('container2').matches('div container') is true
+PASS document.getElementById('container2').matches('div CONTAINER') is true
+PASS document.getElementById('container3').matches('div Container') is true
+PASS document.getElementById('container3').matches('div container') is true
+PASS document.getElementById('container3').matches('div CONTAINER') is true
+PASS document.getElementById('container4').matches('div Container') is false
+PASS document.getElementById('container4').matches('div container') is true
+PASS document.getElementById('container4').matches('div CONTAINER') is false
+PASS document.getElementById('container5').matches('div Container') is false
+PASS document.getElementById('container5').matches('div container') is true
+PASS document.getElementById('container5').matches('div CONTAINER') is false
+PASS document.getElementById('container6').matches('div Container') is false
+PASS document.getElementById('container6').matches('div container') is true
+PASS document.getElementById('container6').matches('div CONTAINER') is false
+PASS document.getElementById('container7').matches('div Container') is false
+PASS document.getElementById('container7').matches('div container') is false
+PASS document.getElementById('container7').matches('div CONTAINER') is true
+PASS document.getElementById('container8').matches('div Container') is false
+PASS document.getElementById('container8').matches('div container') is true
+PASS document.getElementById('container8').matches('div CONTAINER') is false
+PASS document.getElementById('container9').matches('div Container') is true
+PASS document.getElementById('container9').matches('div container') is false
+PASS document.getElementById('container9').matches('div CONTAINER') is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,118 @@
</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 id=&quot;test-cases&quot; style=&quot;display:none;&quot;&gt;
+        &lt;CONTAINER id=&quot;container1&quot;&gt;
+            &lt;container id=&quot;container2&quot;&gt;
+                &lt;Container id=&quot;container3&quot;&gt;
+                &lt;/Container&gt;
+            &lt;/container&gt;
+        &lt;/CONTAINER&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;CONTAINER id=&quot;container4&quot;&gt;
+                &lt;container id=&quot;container5&quot;&gt;
+                    &lt;Container id=&quot;container6&quot;&gt;
+                    &lt;/Container&gt;
+                &lt;/container&gt;
+            &lt;/CONTAINER&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-HTML with Element.matches().&quot;);
+
+var testCases = document.getElementById(&quot;test-cases&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;CONTAINER id=&quot;container7&quot;&gt;&lt;container id=&quot;container8&quot;&gt;&lt;Container id=&quot;container9&quot;&gt;&lt;/Container&gt;&lt;/container&gt;&lt;/CONTAINER&gt;&lt;/svg&gt;', 'text/xml');
+testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function shouldMatch(sourceID, selector)
+{
+    shouldBeTrue(&quot;document.getElementById('&quot; + sourceID + &quot;').matches('&quot; + selector + &quot;')&quot;)
+}
+
+function shouldNotMatch(sourceID, selector)
+{
+    shouldBeFalse(&quot;document.getElementById('&quot; + sourceID + &quot;').matches('&quot; + selector + &quot;')&quot;)
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+shouldMatch(&quot;container1&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container2&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container3&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container3&quot;, &quot;container&quot;);
+shouldMatch(&quot;container3&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container4&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container4&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container4&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container5&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container5&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container5&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container6&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container6&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container7&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container7&quot;, &quot;container&quot;);
+shouldMatch(&quot;container7&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container8&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container8&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container8&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container9&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;CONTAINER&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors&quot;);
+shouldMatch(&quot;container1&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container2&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container3&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container3&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container3&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container4&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container4&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container4&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container5&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container5&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container5&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container6&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container6&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container7&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container7&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container7&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container8&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container8&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container8&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container9&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;div CONTAINER&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginxhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-XHTML with Element.matches().
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('container1').matches('Container') is false
+PASS document.getElementById('container1').matches('container') is false
+PASS document.getElementById('container1').matches('CONTAINER') is true
+PASS document.getElementById('container2').matches('Container') is false
+PASS document.getElementById('container2').matches('container') is true
+PASS document.getElementById('container2').matches('CONTAINER') is false
+PASS document.getElementById('container3').matches('Container') is true
+PASS document.getElementById('container3').matches('container') is false
+PASS document.getElementById('container3').matches('CONTAINER') is false
+PASS document.getElementById('container4').matches('Container') is false
+PASS document.getElementById('container4').matches('container') is false
+PASS document.getElementById('container4').matches('CONTAINER') is true
+PASS document.getElementById('container5').matches('Container') is false
+PASS document.getElementById('container5').matches('container') is true
+PASS document.getElementById('container5').matches('CONTAINER') is false
+PASS document.getElementById('container6').matches('Container') is true
+PASS document.getElementById('container6').matches('container') is false
+PASS document.getElementById('container6').matches('CONTAINER') is false
+PASS document.getElementById('container7').matches('Container') is false
+PASS document.getElementById('container7').matches('container') is false
+PASS document.getElementById('container7').matches('CONTAINER') is true
+PASS document.getElementById('container8').matches('Container') is false
+PASS document.getElementById('container8').matches('container') is true
+PASS document.getElementById('container8').matches('CONTAINER') is false
+PASS document.getElementById('container9').matches('Container') is true
+PASS document.getElementById('container9').matches('container') is false
+PASS document.getElementById('container9').matches('CONTAINER') is false
+
+Complex selectors
+PASS document.getElementById('container1').matches('div Container') is false
+PASS document.getElementById('container1').matches('div container') is false
+PASS document.getElementById('container1').matches('div CONTAINER') is true
+PASS document.getElementById('container2').matches('div Container') is false
+PASS document.getElementById('container2').matches('div container') is true
+PASS document.getElementById('container2').matches('div CONTAINER') is false
+PASS document.getElementById('container3').matches('div Container') is true
+PASS document.getElementById('container3').matches('div container') is false
+PASS document.getElementById('container3').matches('div CONTAINER') is false
+PASS document.getElementById('container4').matches('div Container') is false
+PASS document.getElementById('container4').matches('div container') is false
+PASS document.getElementById('container4').matches('div CONTAINER') is true
+PASS document.getElementById('container5').matches('div Container') is false
+PASS document.getElementById('container5').matches('div container') is true
+PASS document.getElementById('container5').matches('div CONTAINER') is false
+PASS document.getElementById('container6').matches('div Container') is true
+PASS document.getElementById('container6').matches('div container') is false
+PASS document.getElementById('container6').matches('div CONTAINER') is false
+PASS document.getElementById('container7').matches('div Container') is false
+PASS document.getElementById('container7').matches('div container') is false
+PASS document.getElementById('container7').matches('div CONTAINER') is true
+PASS document.getElementById('container8').matches('div Container') is false
+PASS document.getElementById('container8').matches('div container') is true
+PASS document.getElementById('container8').matches('div CONTAINER') is false
+PASS document.getElementById('container9').matches('div Container') is true
+PASS document.getElementById('container9').matches('div container') is false
+PASS document.getElementById('container9').matches('div CONTAINER') is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorselementmatchestagnamecasesensitivitysvginxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&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 id=&quot;test-cases&quot; style=&quot;display:none;&quot;&gt;
+        &lt;CONTAINER id=&quot;container1&quot;&gt;
+            &lt;container id=&quot;container2&quot;&gt;
+                &lt;Container id=&quot;container3&quot;&gt;
+                &lt;/Container&gt;
+            &lt;/container&gt;
+        &lt;/CONTAINER&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;CONTAINER id=&quot;container4&quot;&gt;
+                &lt;container id=&quot;container5&quot;&gt;
+                    &lt;Container id=&quot;container6&quot;&gt;
+                    &lt;/Container&gt;
+                &lt;/container&gt;
+            &lt;/CONTAINER&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-XHTML with Element.matches().&quot;);
+
+var testCases = document.getElementById(&quot;test-cases&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;CONTAINER id=&quot;container7&quot;&gt;&lt;container id=&quot;container8&quot;&gt;&lt;Container id=&quot;container9&quot;&gt;&lt;/Container&gt;&lt;/container&gt;&lt;/CONTAINER&gt;&lt;/svg&gt;', 'text/xml');
+testCases.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function shouldMatch(sourceID, selector)
+{
+    shouldBeTrue(&quot;document.getElementById('&quot; + sourceID + &quot;').matches('&quot; + selector + &quot;')&quot;)
+}
+
+function shouldNotMatch(sourceID, selector)
+{
+    shouldBeFalse(&quot;document.getElementById('&quot; + sourceID + &quot;').matches('&quot; + selector + &quot;')&quot;)
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+shouldNotMatch(&quot;container1&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container1&quot;, &quot;container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container2&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container2&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container3&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container3&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container3&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container4&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container4&quot;, &quot;container&quot;);
+shouldMatch(&quot;container4&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container5&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container5&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container5&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container6&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container7&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container7&quot;, &quot;container&quot;);
+shouldMatch(&quot;container7&quot;, &quot;CONTAINER&quot;);
+
+shouldNotMatch(&quot;container8&quot;, &quot;Container&quot;);
+shouldMatch(&quot;container8&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container8&quot;, &quot;CONTAINER&quot;);
+
+shouldMatch(&quot;container9&quot;, &quot;Container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;CONTAINER&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors&quot;);
+shouldNotMatch(&quot;container1&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container1&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container1&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container2&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container2&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container2&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container3&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container3&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container3&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container4&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container4&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container4&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container5&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container5&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container5&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container6&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container6&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container7&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container7&quot;, &quot;div container&quot;);
+shouldMatch(&quot;container7&quot;, &quot;div CONTAINER&quot;);
+
+shouldNotMatch(&quot;container8&quot;, &quot;div Container&quot;);
+shouldMatch(&quot;container8&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container8&quot;, &quot;div CONTAINER&quot;);
+
+shouldMatch(&quot;container9&quot;, &quot;div Container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;div container&quot;);
+shouldNotMatch(&quot;container9&quot;, &quot;div CONTAINER&quot;);
+]]&gt;&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="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,448 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-HTML with querySelector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('with-renderer').querySelectorAll('rect').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('Rect').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('RECT').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[3].getAttribute('class') is &quot;target9&quot;
+
+Compound selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+
+Complex selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; Rect[class]').length is 1
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; Rect[class]').length is 1
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[0].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[0].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; RECT[class]').length is 1
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; RECT[class]').length is 1
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[0].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[0].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]').length is 1
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]').length is 1
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]').length is 1
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]').length is 1
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+
+With functional pseudo classes.
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target9&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,107 @@
</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 id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-HTML with querySelector.&quot;);
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect class=&quot;target7&quot;&gt;&lt;/rect&gt;&lt;Rect class=&quot;target8&quot;&gt;&lt;/Rect&gt;&lt;RECT class=&quot;target9&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+withRenderer.appendChild(document.importNode(svgDocument.documentElement, true));
+withoutRenderer.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function testSelector(selector, expectedClasses)
+{
+    shouldBe(&quot;document.getElementById('with-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    shouldBe(&quot;document.getElementById('without-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    for (var i = 0; i &lt; expectedClasses.length; ++i) {
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;with-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;without-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+    }
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;rect&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect&quot;, [1, 2, 3, 8]);
+testSelector(&quot;RECT&quot;, [1, 2, 3, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect[class]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;RECT[class]&quot;, [1, 2, 3, 9]);
+testSelector(&quot;rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;svg &gt; rect[class]&quot;, [4, 5, 6, 7]);
+testSelector(&quot;svg &gt; Rect[class]&quot;, [8]);
+testSelector(&quot;svg &gt; RECT[class]&quot;, [9]);
+testSelector(&quot;svg &gt; rect[class^=\&quot;target\&quot;]&quot;, [4, 5, 6, 7]);
+testSelector(&quot;svg &gt; Rect[class^=\&quot;target\&quot;]&quot;, [8]);
+testSelector(&quot;svg &gt; RECT[class^=\&quot;target\&quot;]&quot;, [9]);
+
+testSelector(&quot;div rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;div Rect[class]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;div RECT[class]&quot;, [1, 2, 3, 9]);
+testSelector(&quot;div rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;div Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;div RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 9]);
+
+testSelector(&quot;:root div rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div Rect[class]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div RECT[class]&quot;, [1, 2, 3, 9]);
+testSelector(&quot;:root div rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;With functional pseudo classes.&quot;);
+testSelector(&quot;:root div :matches(not-there, rect[class])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class])&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class])&quot;, [1, 2, 3, 9]);
+testSelector(&quot;:root div :matches(not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 9]);
+
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class])&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class])&quot;, [1, 2, 3, 9]);
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 9]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginxhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,316 @@
</span><ins>+Test tagname's case-sensitivity when matching SVG-in-XHTML with querySelector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('with-renderer').querySelectorAll('rect').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target9&quot;
+
+Compound selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+
+Complex selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; rect[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; rect[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; Rect[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; Rect[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; RECT[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; RECT[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('svg &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+
+With functional pseudo classes.
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivitysvginxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&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 id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/svg&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+description(&quot;Test tagname's case-sensitivity when matching SVG-in-XHTML with querySelector.&quot;);
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+var svgDocument = new DOMParser().parseFromString('&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;rect class=&quot;target7&quot;&gt;&lt;/rect&gt;&lt;Rect class=&quot;target8&quot;&gt;&lt;/Rect&gt;&lt;RECT class=&quot;target9&quot;&gt;&lt;/RECT&gt;&lt;/svg&gt;', 'text/xml');
+withRenderer.appendChild(document.importNode(svgDocument.documentElement, true));
+withoutRenderer.appendChild(document.importNode(svgDocument.documentElement, true));
+
+function testSelector(selector, expectedClasses)
+{
+    shouldBe(&quot;document.getElementById('with-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    shouldBe(&quot;document.getElementById('without-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    for (var i = 0; i &lt; expectedClasses.length; ++i) {
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;with-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;without-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+    }
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;rect&quot;, [1, 4, 7]);
+testSelector(&quot;Rect&quot;, [2, 5, 8]);
+testSelector(&quot;RECT&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;svg &gt; rect[class]&quot;, [4, 7]);
+testSelector(&quot;svg &gt; Rect[class]&quot;, [5, 8]);
+testSelector(&quot;svg &gt; RECT[class]&quot;, [6, 9]);
+testSelector(&quot;svg &gt; rect[class^=\&quot;target\&quot;]&quot;, [4, 7]);
+testSelector(&quot;svg &gt; Rect[class^=\&quot;target\&quot;]&quot;, [5, 8]);
+testSelector(&quot;svg &gt; RECT[class^=\&quot;target\&quot;]&quot;, [6, 9]);
+
+testSelector(&quot;div rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;div Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;div RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;div rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;div Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;div RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+testSelector(&quot;:root div rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;:root div Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;:root div RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;:root div rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;:root div Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;:root div RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;With functional pseudo classes.&quot;);
+testSelector(&quot;:root div :matches(not-there, rect[class])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class])&quot;, [3, 6, 9]);
+testSelector(&quot;:root div :matches(not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class^=\&quot;target\&quot;])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class^=\&quot;target\&quot;])&quot;, [3, 6, 9]);
+
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class])&quot;, [3, 6, 9]);
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class^=\&quot;target\&quot;])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class^=\&quot;target\&quot;])&quot;, [3, 6, 9]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+]]&gt;&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="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,604 @@
</span><ins>+Test tagname's case-sensitivity when matching XML-in-HTML with querySelector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('with-renderer').querySelectorAll('rect').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('Rect').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('RECT').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[6].getAttribute('class') is &quot;target9&quot;
+
+Compound selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+
+Complex selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; Rect[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; Rect[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; RECT[class]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; RECT[class]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]').length is 4
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[6].getAttribute('class') is &quot;target9&quot;
+
+With functional pseudo classes.
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 7
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[3].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[4].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[5].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[6].getAttribute('class') is &quot;target9&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,107 @@
</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 id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test tagname's case-sensitivity when matching XML-in-HTML with querySelector.&quot;);
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;rect class=&quot;target7&quot;&gt;&lt;/rect&gt;&lt;Rect class=&quot;target8&quot;&gt;&lt;/Rect&gt;&lt;RECT class=&quot;target9&quot;&gt;&lt;/RECT&gt;&lt;/xml&gt;', 'text/xml');
+withRenderer.appendChild(document.importNode(xmlDocument.documentElement, true));
+withoutRenderer.appendChild(document.importNode(xmlDocument.documentElement, true));
+
+function testSelector(selector, expectedClasses)
+{
+    shouldBe(&quot;document.getElementById('with-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    shouldBe(&quot;document.getElementById('without-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    for (var i = 0; i &lt; expectedClasses.length; ++i) {
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;with-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;without-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+    }
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;rect&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;RECT&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect[class]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;RECT[class]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+testSelector(&quot;rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;xml &gt; rect[class]&quot;, [4, 5, 6, 7]);
+testSelector(&quot;xml &gt; Rect[class]&quot;, [4, 5, 6, 8]);
+testSelector(&quot;xml &gt; RECT[class]&quot;, [4, 5, 6, 9]);
+testSelector(&quot;xml &gt; rect[class^=\&quot;target\&quot;]&quot;, [4, 5, 6, 7]);
+testSelector(&quot;xml &gt; Rect[class^=\&quot;target\&quot;]&quot;, [4, 5, 6, 8]);
+testSelector(&quot;xml &gt; RECT[class^=\&quot;target\&quot;]&quot;, [4, 5, 6, 9]);
+
+testSelector(&quot;div rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;div Rect[class]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;div RECT[class]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+testSelector(&quot;div rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;div Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;div RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+testSelector(&quot;:root div rect[class]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div Rect[class]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div RECT[class]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+testSelector(&quot;:root div rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div Rect[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div RECT[class^=\&quot;target\&quot;]&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;With functional pseudo classes.&quot;);
+testSelector(&quot;:root div :matches(not-there, rect[class])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class])&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class])&quot;, [1, 2, 3, 4, 5, 6, 9]);
+testSelector(&quot;:root div :matches(not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class])&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class])&quot;, [1, 2, 3, 4, 5, 6, 9]);
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class^=\&quot;target\&quot;])&quot;, [1, 2, 3, 4, 5, 6, 9]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinxhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,316 @@
</span><ins>+Test tagname's case-sensitivity when matching XML-in-XHTML with querySelector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Basic cases, tagname alone.
+PASS document.getElementById('with-renderer').querySelectorAll('rect').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT')[2].getAttribute('class') is &quot;target9&quot;
+
+Compound selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+
+Complex selectors.
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; rect[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; rect[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; Rect[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; Rect[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; RECT[class]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; RECT[class]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById('without-renderer').querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]').length is 2
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('xml &gt; RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll('div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll('div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div Rect[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div Rect[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div RECT[class^=&quot;target&quot;]').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div RECT[class^=&quot;target&quot;]')[2].getAttribute('class') is &quot;target9&quot;
+
+With functional pseudo classes.
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :matches(not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target1&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target4&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target7&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target2&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target5&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, Rect[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target8&quot;
+PASS document.getElementById('with-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById('without-renderer').querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])').length is 3
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[0].getAttribute('class') is &quot;target3&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[1].getAttribute('class') is &quot;target6&quot;
+PASS document.getElementById(&quot;with-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS document.getElementById(&quot;without-renderer&quot;).querySelectorAll(':root div :nth-child(n of not-there, RECT[class^=&quot;target&quot;])')[2].getAttribute('class') is &quot;target9&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsquerySelectortagnamecasesensitivityxmlinxhtmlxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&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 id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;rect class=&quot;target1&quot;&gt;&lt;/rect&gt;
+        &lt;Rect class=&quot;target2&quot;&gt;&lt;/Rect&gt;
+        &lt;RECT class=&quot;target3&quot;&gt;&lt;/RECT&gt;
+        &lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;
+            &lt;rect class=&quot;target4&quot;&gt;&lt;/rect&gt;
+            &lt;Rect class=&quot;target5&quot;&gt;&lt;/Rect&gt;
+            &lt;RECT class=&quot;target6&quot;&gt;&lt;/RECT&gt;
+        &lt;/xml&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;&lt;![CDATA[
+description(&quot;Test tagname's case-sensitivity when matching XML-in-XHTML with querySelector.&quot;);
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+var xmlDocument = new DOMParser().parseFromString('&lt;xml xmlns=&quot;https://www.webkit.org/awesome&quot;&gt;&lt;rect class=&quot;target7&quot;&gt;&lt;/rect&gt;&lt;Rect class=&quot;target8&quot;&gt;&lt;/Rect&gt;&lt;RECT class=&quot;target9&quot;&gt;&lt;/RECT&gt;&lt;/xml&gt;', 'text/xml');
+withRenderer.appendChild(document.importNode(xmlDocument.documentElement, true));
+withoutRenderer.appendChild(document.importNode(xmlDocument.documentElement, true));
+
+function testSelector(selector, expectedClasses)
+{
+    shouldBe(&quot;document.getElementById('with-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    shouldBe(&quot;document.getElementById('without-renderer').querySelectorAll('&quot; + selector + &quot;').length&quot;, '' + expectedClasses.length);
+    for (var i = 0; i &lt; expectedClasses.length; ++i) {
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;with-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+        shouldBeEqualToString(&quot;document.getElementById(\&quot;without-renderer\&quot;).querySelectorAll('&quot; + selector + &quot;')[&quot; + i + &quot;].getAttribute('class')&quot;, &quot;target&quot; + expectedClasses[i]);
+    }
+}
+
+debug(&quot;Basic cases, tagname alone.&quot;);
+testSelector(&quot;rect&quot;, [1, 4, 7]);
+testSelector(&quot;Rect&quot;, [2, 5, 8]);
+testSelector(&quot;RECT&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Compound selectors.&quot;);
+testSelector(&quot;rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;Complex selectors.&quot;);
+testSelector(&quot;xml &gt; rect[class]&quot;, [4, 7]);
+testSelector(&quot;xml &gt; Rect[class]&quot;, [5, 8]);
+testSelector(&quot;xml &gt; RECT[class]&quot;, [6, 9]);
+testSelector(&quot;xml &gt; rect[class^=\&quot;target\&quot;]&quot;, [4, 7]);
+testSelector(&quot;xml &gt; Rect[class^=\&quot;target\&quot;]&quot;, [5, 8]);
+testSelector(&quot;xml &gt; RECT[class^=\&quot;target\&quot;]&quot;, [6, 9]);
+
+testSelector(&quot;div rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;div Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;div RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;div rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;div Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;div RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+testSelector(&quot;:root div rect[class]&quot;, [1, 4, 7]);
+testSelector(&quot;:root div Rect[class]&quot;, [2, 5, 8]);
+testSelector(&quot;:root div RECT[class]&quot;, [3, 6, 9]);
+testSelector(&quot;:root div rect[class^=\&quot;target\&quot;]&quot;, [1, 4, 7]);
+testSelector(&quot;:root div Rect[class^=\&quot;target\&quot;]&quot;, [2, 5, 8]);
+testSelector(&quot;:root div RECT[class^=\&quot;target\&quot;]&quot;, [3, 6, 9]);
+
+debug(&quot;&quot;);
+debug(&quot;With functional pseudo classes.&quot;);
+testSelector(&quot;:root div :matches(not-there, rect[class])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class])&quot;, [3, 6, 9]);
+testSelector(&quot;:root div :matches(not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :matches(not-there, Rect[class^=\&quot;target\&quot;])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :matches(not-there, RECT[class^=\&quot;target\&quot;])&quot;, [3, 6, 9]);
+
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class])&quot;, [3, 6, 9]);
+testSelector(&quot;:root div :nth-child(n of not-there, rect[class^=\&quot;target\&quot;])&quot;, [1, 4, 7]);
+testSelector(&quot;:root div :nth-child(n of not-there, Rect[class^=\&quot;target\&quot;])&quot;, [2, 5, 8]);
+testSelector(&quot;:root div :nth-child(n of not-there, RECT[class^=\&quot;target\&quot;])&quot;, [3, 6, 9]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+]]&gt;&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="trunkLayoutTestsfastselectorstagnameadjacentbacktrackingcasesensitivityhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test the correctness of the backtracking optimizations with mixed case tag names in the selector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;SIBLING.target + SIBLING + sibling ~ target&quot;).length is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorstagnameadjacentbacktrackingcasesensitivityhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,22 @@
</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;sibling class=&quot;target&quot;&gt;&lt;/sibling&gt;
+        &lt;sibling&gt;&lt;/sibling&gt;
+        &lt;sibling&gt;&lt;/sibling&gt;
+        &lt;sibling&gt;&lt;/sibling&gt;
+        &lt;padding&gt;&lt;/padding&gt;
+        &lt;target&gt;&lt;/target&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test the correctness of the backtracking optimizations with mixed case tag names in the selector.&quot;);
+
+shouldBe('document.querySelectorAll(&quot;SIBLING.target + SIBLING + sibling ~ target&quot;).length', '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="trunkLayoutTestsfastselectorstagnamedescendantbacktrackingcasesensitivityhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html-expected.txt        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test the correctness of the backtracking optimizations with mixed case tag names in the selector.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;CONTAINER.target &gt; CONTAINER &gt; container target&quot;).length is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorstagnamedescendantbacktrackingcasesensitivityhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html (0 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -0,0 +1,27 @@
</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;container style=&quot;display:none&quot;&gt;
+        &lt;container class=&quot;target&quot;&gt;
+            &lt;container&gt;
+                &lt;container&gt;
+                    &lt;container&gt;
+                        &lt;padding&gt;
+                            &lt;target&gt;&lt;/target&gt;
+                        &lt;/padding&gt;
+                    &lt;/container&gt;
+                &lt;/container&gt;
+            &lt;/container&gt;
+        &lt;/container&gt;
+    &lt;/container&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description(&quot;Test the correctness of the backtracking optimizations with mixed case tag names in the selector.&quot;);
+
+shouldBe('document.querySelectorAll(&quot;CONTAINER.target &gt; CONTAINER &gt; container target&quot;).length', '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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/ChangeLog        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -1,3 +1,126 @@
</span><ins>+2015-01-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Fix CSS Selector's tag name matching when mixing HTML and XML
+        https://bugs.webkit.org/show_bug.cgi?id=140878
+
+        Reviewed by Darin Adler.
+
+        Previsouly, WebKit was unable to match any XML element that had
+        any uppercase character if the stylesheet was in a HTML document.
+        This problem was most often reported due to the inability to style
+        SVG-in-HTML.
+
+        The reason was that the tag local name was incorrectly transformed
+        to lowercase at parsing time. Instead, we are supposed to only
+        do case-insensitive match for HTML elements in a HTML document.
+
+        This fix is very similar with how we handle attributes:
+        -Keep both the original and the lowercase versions of the name.
+        -When matching, chose which version to use depending on the element being matched.
+
+        There is one major difference in the way the names are stored.
+        Unlike attribute selectors, tag name selectors are common, and the uppercase
+        version is not that uncommon. I wanted to preserve the dense representation
+        so I specialized CSSSelector specifically for tag names.
+
+        To store the data, if the name is already lowercase, just use the m_data pointer
+        as usual.
+        If the name is not lowercase, allocate a new small structure in the union to store
+        both names.
+
+        Tests: fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html
+               fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml
+               fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml
+               fast/css/tagname-case-sensitivity-svg-in-html.html
+               fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml
+               fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml
+               fast/css/tagname-case-sensitivity-xml-in-html.html
+               fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml
+               fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml
+               fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html
+               fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml
+               fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html
+               fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml
+               fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html
+               fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml
+               fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html
+               fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml
+               fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html
+               fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html
+
+        * css/CSSGrammar.y.in:
+        The parser is unaware of anything case related. CSSSelector takes care of that.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::CSSSelector):
+        (WebCore::CSSSelector::createRareData):
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::NameWithCase::NameWithCase):
+        (WebCore::CSSSelector::CSSSelector):
+        (WebCore::CSSSelector::~CSSSelector):
+        (WebCore::CSSSelector::tagQName):
+        (WebCore::CSSSelector::tagLowercaseLocalName):
+        The new representation stores both the original form and the lower case
+        form.
+
+        * css/RuleSet.cpp:
+        (WebCore::RuleSet::addRule):
+        (WebCore::RuleSet::shrinkToFit):
+        * css/RuleSet.h:
+        (WebCore::RuleSet::tagRules):
+        * css/ElementRuleCollector.cpp:
+        (WebCore::ElementRuleCollector::collectMatchingRules):
+        The tag name partition is now split in two: lowercase and original case.
+        If the matched element is HTML, the lowercase partition is used. 
+
+        * css/SelectorFilter.cpp:
+        (WebCore::collectElementIdentifierHashes):
+        (WebCore::collectDescendantSelectorIdentifierHashes):
+        This is the most annoying part of the patch performance wise:
+        the bloom filter knows the case of the real elements but it cannot know
+        how selectors will match them.
+
+        To make it work, all names are now converted to lowercase.
+        That implies that we can filter less on XML and we may have to pay for
+        converting the tag name to lowercase.
+
+        I expect the performance hit to be small because:
+        -Having two XML elements with the same name but different case is uncommon.
+        -Most elements use lowercase names.
+
+        Still sad...that's the price to pay for correctness.
+
+        * css/SelectorChecker.cpp:
+        (WebCore::tagMatches):
+        (WebCore::SelectorChecker::checkOne):
+        * css/SelectorChecker.h:
+        (WebCore::SelectorChecker::tagMatches): Deleted.
+        Update the legacy matcher, nothing special.
+
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
+        (WebCore::SelectorCompiler::TagNamePattern::TagNamePattern):
+        (WebCore::SelectorCompiler::constructFragmentsInternal):
+        (WebCore::SelectorCompiler::equalTagNames):
+        (WebCore::SelectorCompiler::equalTagNamePatterns):
+        (WebCore::SelectorCompiler::computeBacktrackingStartOffsetInChain):
+        (WebCore::SelectorCompiler::computeBacktrackingHeightFromDescendant):
+        (WebCore::SelectorCompiler::computeBacktrackingWidthFromIndirectAdjacent):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
+        Tag names are used to optimize backtracking; this is quite common for descendant
+        (e.g. div &gt; ul &gt; li).
+        We have to differenciate one new case there: if two tag names are equal
+        when compared case-insensitively but strictly different, they may still
+        be equal if they don't match the same kind of elements or both matches
+        and HTML element.
+
+        * dom/SelectorQuery.cpp:
+        (WebCore::localNameMatches):
+        (WebCore::elementsForLocalName):
+        (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
+        Update the inline versions of SelectorQuery.
+
</ins><span class="cx"> 2015-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use std::forward() instead of WTF::move() in CSSPrimitiveValue::create(T&amp;&amp; value)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -1214,8 +1214,6 @@
</span><span class="cx"> 
</span><span class="cx"> element_name:
</span><span class="cx">     IDENT {
</span><del>-        if (parser-&gt;m_context.isHTMLDocument)
-            $1.lower();
</del><span class="cx">         $$ = $1;
</span><span class="cx">     }
</span><span class="cx">     | '*' {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -49,9 +49,35 @@
</span><span class="cx"> 
</span><span class="cx"> static_assert(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), &quot;CSSSelector should remain small.&quot;);
</span><span class="cx"> 
</span><ins>+CSSSelector::CSSSelector(const QualifiedName&amp; tagQName, bool tagIsForNamespaceRule)
+    : m_relation(Descendant)
+    , m_match(Tag)
+    , m_pseudoType(0)
+    , m_parsedNth(false)
+    , m_isLastInSelectorList(false)
+    , m_isLastInTagHistory(true)
+    , m_hasRareData(false)
+    , m_hasNameWithCase(false)
+    , m_isForPage(false)
+    , m_tagIsForNamespaceRule(tagIsForNamespaceRule)
+    , m_descendantDoubleChildSyntax(false)
+{
+    const AtomicString&amp; tagLocalName = tagQName.localName();
+    const AtomicString tagLocalNameASCIILowercase = tagLocalName.convertToASCIILowercase();
+
+    if (tagLocalName == tagLocalNameASCIILowercase) {
+        m_data.m_tagQName = tagQName.impl();
+        m_data.m_tagQName-&gt;ref();
+    } else {
+        m_data.m_nameWithCase = adoptRef(new NameWithCase(tagQName, tagLocalNameASCIILowercase)).leakRef();
+        m_hasNameWithCase = true;
+    }
+}
+
</ins><span class="cx"> void CSSSelector::createRareData()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(match() != Tag);
</span><ins>+    ASSERT(!m_hasNameWithCase);
</ins><span class="cx">     if (m_hasRareData)
</span><span class="cx">         return;
</span><span class="cx">     // Move the value to the rare data stucture.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/CSSSelector.h        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -228,6 +228,8 @@
</span><span class="cx">         const CSSSelector* tagHistory() const { return m_isLastInTagHistory ? 0 : const_cast&lt;CSSSelector*&gt;(this + 1); }
</span><span class="cx"> 
</span><span class="cx">         const QualifiedName&amp; tagQName() const;
</span><ins>+        const AtomicString&amp; tagLowercaseLocalName() const;
+
</ins><span class="cx">         const AtomicString&amp; value() const;
</span><span class="cx">         const QualifiedName&amp; attribute() const;
</span><span class="cx">         const AtomicString&amp; attributeCanonicalLocalName() const;
</span><span class="lines">@@ -325,6 +327,7 @@
</span><span class="cx">         unsigned m_isLastInSelectorList  : 1;
</span><span class="cx">         unsigned m_isLastInTagHistory    : 1;
</span><span class="cx">         unsigned m_hasRareData           : 1;
</span><ins>+        unsigned m_hasNameWithCase       : 1;
</ins><span class="cx">         unsigned m_isForPage             : 1;
</span><span class="cx">         unsigned m_tagIsForNamespaceRule : 1;
</span><span class="cx">         unsigned m_descendantDoubleChildSyntax : 1;
</span><span class="lines">@@ -357,11 +360,24 @@
</span><span class="cx">         };
</span><span class="cx">         void createRareData();
</span><span class="cx"> 
</span><ins>+        struct NameWithCase : public RefCounted&lt;NameWithCase&gt; {
+            NameWithCase(const QualifiedName&amp; originalName, const AtomicString&amp; lowercaseName)
+                : m_originalName(originalName)
+                , m_lowercaseLocalName(lowercaseName)
+            {
+                ASSERT(originalName.localName() != lowercaseName);
+            }
+
+            const QualifiedName m_originalName;
+            const AtomicString m_lowercaseLocalName;
+        };
+
</ins><span class="cx">         union DataUnion {
</span><span class="cx">             DataUnion() : m_value(0) { }
</span><span class="cx">             AtomicStringImpl* m_value;
</span><span class="cx">             QualifiedName::QualifiedNameImpl* m_tagQName;
</span><span class="cx">             RareData* m_rareData;
</span><ins>+            NameWithCase* m_nameWithCase;
</ins><span class="cx">         } m_data;
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -452,28 +468,13 @@
</span><span class="cx">     , m_isLastInSelectorList(false)
</span><span class="cx">     , m_isLastInTagHistory(true)
</span><span class="cx">     , m_hasRareData(false)
</span><ins>+    , m_hasNameWithCase(false)
</ins><span class="cx">     , m_isForPage(false)
</span><span class="cx">     , m_tagIsForNamespaceRule(false)
</span><span class="cx">     , m_descendantDoubleChildSyntax(false)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline CSSSelector::CSSSelector(const QualifiedName&amp; tagQName, bool tagIsForNamespaceRule)
-    : m_relation(Descendant)
-    , m_match(Tag)
-    , m_pseudoType(0)
-    , m_parsedNth(false)
-    , m_isLastInSelectorList(false)
-    , m_isLastInTagHistory(true)
-    , m_hasRareData(false)
-    , m_isForPage(false)
-    , m_tagIsForNamespaceRule(tagIsForNamespaceRule)
-    , m_descendantDoubleChildSyntax(false)
-{
-    m_data.m_tagQName = tagQName.impl();
-    m_data.m_tagQName-&gt;ref();
-}
-
</del><span class="cx"> inline CSSSelector::CSSSelector(const CSSSelector&amp; o)
</span><span class="cx">     : m_relation(o.m_relation)
</span><span class="cx">     , m_match(o.m_match)
</span><span class="lines">@@ -482,16 +483,20 @@
</span><span class="cx">     , m_isLastInSelectorList(o.m_isLastInSelectorList)
</span><span class="cx">     , m_isLastInTagHistory(o.m_isLastInTagHistory)
</span><span class="cx">     , m_hasRareData(o.m_hasRareData)
</span><ins>+    , m_hasNameWithCase(o.m_hasNameWithCase)
</ins><span class="cx">     , m_isForPage(o.m_isForPage)
</span><span class="cx">     , m_tagIsForNamespaceRule(o.m_tagIsForNamespaceRule)
</span><span class="cx">     , m_descendantDoubleChildSyntax(o.m_descendantDoubleChildSyntax)
</span><span class="cx"> {
</span><del>-    if (o.match() == Tag) {
</del><ins>+    if (o.m_hasRareData) {
+        m_data.m_rareData = o.m_data.m_rareData;
+        m_data.m_rareData-&gt;ref();
+    } else if (o.m_hasNameWithCase) {
+        m_data.m_nameWithCase = o.m_data.m_nameWithCase;
+        m_data.m_nameWithCase-&gt;ref();
+    } if (o.match() == Tag) {
</ins><span class="cx">         m_data.m_tagQName = o.m_data.m_tagQName;
</span><span class="cx">         m_data.m_tagQName-&gt;ref();
</span><del>-    } else if (o.m_hasRareData) {
-        m_data.m_rareData = o.m_data.m_rareData;
-        m_data.m_rareData-&gt;ref();
</del><span class="cx">     } else if (o.m_data.m_value) {
</span><span class="cx">         m_data.m_value = o.m_data.m_value;
</span><span class="cx">         m_data.m_value-&gt;ref();
</span><span class="lines">@@ -500,10 +505,12 @@
</span><span class="cx"> 
</span><span class="cx"> inline CSSSelector::~CSSSelector()
</span><span class="cx"> {
</span><del>-    if (match() == Tag)
</del><ins>+    if (m_hasRareData)
+        m_data.m_rareData-&gt;deref();
+    else if (m_hasNameWithCase)
+        m_data.m_nameWithCase-&gt;deref();
+    else if (match() == Tag)
</ins><span class="cx">         m_data.m_tagQName-&gt;deref();
</span><del>-    else if (m_hasRareData)
-        m_data.m_rareData-&gt;deref();
</del><span class="cx">     else if (m_data.m_value)
</span><span class="cx">         m_data.m_value-&gt;deref();
</span><span class="cx"> }
</span><span class="lines">@@ -511,9 +518,18 @@
</span><span class="cx"> inline const QualifiedName&amp; CSSSelector::tagQName() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(match() == Tag);
</span><ins>+    if (m_hasNameWithCase)
+        return m_data.m_nameWithCase-&gt;m_originalName;
</ins><span class="cx">     return *reinterpret_cast&lt;const QualifiedName*&gt;(&amp;m_data.m_tagQName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline const AtomicString&amp; CSSSelector::tagLowercaseLocalName() const
+{
+    if (m_hasNameWithCase)
+        return m_data.m_nameWithCase-&gt;m_lowercaseLocalName;
+    return m_data.m_tagQName-&gt;m_localName;
+}
+
</ins><span class="cx"> inline const AtomicString&amp; CSSSelector::value() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(match() != Tag);
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">         collectMatchingRulesForList(matchRequest.ruleSet-&gt;linkPseudoClassRules(), matchRequest, ruleRange);
</span><span class="cx">     if (SelectorChecker::matchesFocusPseudoClass(&amp;m_element))
</span><span class="cx">         collectMatchingRulesForList(matchRequest.ruleSet-&gt;focusPseudoClassRules(), matchRequest, ruleRange);
</span><del>-    collectMatchingRulesForList(matchRequest.ruleSet-&gt;tagRules(m_element.localName().impl()), matchRequest, ruleRange);
</del><ins>+    collectMatchingRulesForList(matchRequest.ruleSet-&gt;tagRules(m_element.localName().impl(), m_element.isHTMLElement() &amp;&amp; m_element.document().isHTMLDocument()), matchRequest, ruleRange);
</ins><span class="cx">     collectMatchingRulesForList(matchRequest.ruleSet-&gt;universalRules(), matchRequest, ruleRange);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/RuleSet.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -281,7 +281,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (tagSelector) {
</span><del>-        addToRuleSet(tagSelector-&gt;tagQName().localName().impl(), m_tagRules, ruleData);
</del><ins>+        addToRuleSet(tagSelector-&gt;tagQName().localName().impl(), m_tagLocalNameRules, ruleData);
+        addToRuleSet(tagSelector-&gt;tagLowercaseLocalName().impl(), m_tagLowercaseLocalNameRules, ruleData);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -385,7 +386,8 @@
</span><span class="cx"> {
</span><span class="cx">     shrinkMapVectorsToFit(m_idRules);
</span><span class="cx">     shrinkMapVectorsToFit(m_classRules);
</span><del>-    shrinkMapVectorsToFit(m_tagRules);
</del><ins>+    shrinkMapVectorsToFit(m_tagLocalNameRules);
+    shrinkMapVectorsToFit(m_tagLowercaseLocalNameRules);
</ins><span class="cx">     shrinkMapVectorsToFit(m_shadowPseudoElementRules);
</span><span class="cx">     m_linkPseudoClassRules.shrinkToFit();
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.h (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.h        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/RuleSet.h        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> class CSSSelector;
</span><span class="cx"> class ContainerNode;
</span><span class="cx"> class MediaQueryEvaluator;
</span><ins>+class Node;
</ins><span class="cx"> class StyleResolver;
</span><span class="cx"> class StyleRuleRegion;
</span><span class="cx"> class StyleSheetContents;
</span><span class="lines">@@ -172,7 +173,7 @@
</span><span class="cx"> 
</span><span class="cx">     const RuleDataVector* idRules(AtomicStringImpl* key) const { return m_idRules.get(key); }
</span><span class="cx">     const RuleDataVector* classRules(AtomicStringImpl* key) const { return m_classRules.get(key); }
</span><del>-    const RuleDataVector* tagRules(AtomicStringImpl* key) const { return m_tagRules.get(key); }
</del><ins>+    const RuleDataVector* tagRules(AtomicStringImpl* key, bool isHTMLName) const;
</ins><span class="cx">     const RuleDataVector* shadowPseudoElementRules(AtomicStringImpl* key) const { return m_shadowPseudoElementRules.get(key); }
</span><span class="cx">     const RuleDataVector* linkPseudoClassRules() const { return &amp;m_linkPseudoClassRules; }
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -193,7 +194,8 @@
</span><span class="cx"> 
</span><span class="cx">     AtomRuleMap m_idRules;
</span><span class="cx">     AtomRuleMap m_classRules;
</span><del>-    AtomRuleMap m_tagRules;
</del><ins>+    AtomRuleMap m_tagLocalNameRules;
+    AtomRuleMap m_tagLowercaseLocalNameRules;
</ins><span class="cx">     AtomRuleMap m_shadowPseudoElementRules;
</span><span class="cx">     RuleDataVector m_linkPseudoClassRules;
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -214,6 +216,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline const RuleSet::RuleDataVector* RuleSet::tagRules(AtomicStringImpl* key, bool isHTMLName) const
+{
+    const AtomRuleMap* tagRules;
+    if (isHTMLName)
+        tagRules = &amp;m_tagLowercaseLocalNameRules;
+    else
+        tagRules = &amp;m_tagLocalNameRules;
+    return tagRules-&gt;get(key);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -543,6 +543,21 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline bool tagMatches(const Element&amp; element, const CSSSelector&amp; simpleSelector)
+{
+    const QualifiedName&amp; tagQName = simpleSelector.tagQName();
+
+    if (tagQName == anyQName())
+        return true;
+
+    const AtomicString&amp; localName = (element.isHTMLElement() &amp;&amp; element.document().isHTMLDocument()) ? simpleSelector.tagLowercaseLocalName() : tagQName.localName();
+
+    if (localName != starAtom &amp;&amp; localName != element.localName())
+        return false;
+    const AtomicString&amp; namespaceURI = tagQName.namespaceURI();
+    return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
+}
+
</ins><span class="cx"> bool SelectorChecker::checkOne(const CheckingContextWithStatus&amp; context, PseudoIdSet&amp; dynamicPseudoIdSet, MatchType&amp; matchType, unsigned&amp; specificity) const
</span><span class="cx"> {
</span><span class="cx">     Element* const &amp; element = context.element;
</span><span class="lines">@@ -553,7 +568,7 @@
</span><span class="cx">     specificity = CSSSelector::addSpecificities(specificity, selector-&gt;simpleSelectorSpecificity());
</span><span class="cx"> 
</span><span class="cx">     if (selector-&gt;match() == CSSSelector::Tag)
</span><del>-        return SelectorChecker::tagMatches(element, selector-&gt;tagQName());
</del><ins>+        return tagMatches(*element, *selector);
</ins><span class="cx"> 
</span><span class="cx">     if (selector-&gt;match() == CSSSelector::Class)
</span><span class="cx">         return element-&gt;hasClass() &amp;&amp; element-&gt;classNames().contains(selector-&gt;value());
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.h (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.h        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/SelectorChecker.h        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -98,7 +98,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool match(const CSSSelector*, Element*, const CheckingContext&amp;, unsigned&amp; specificity) const;
</span><span class="cx"> 
</span><del>-    static bool tagMatches(const Element*, const QualifiedName&amp;);
</del><span class="cx">     static bool isCommonPseudoClassSelector(const CSSSelector*);
</span><span class="cx">     static bool matchesFocusPseudoClass(const Element*);
</span><span class="cx">     static bool checkExactAttribute(const Element*, const CSSSelector*, const QualifiedName&amp; selectorAttributeName, const AtomicStringImpl* value);
</span><span class="lines">@@ -131,17 +130,6 @@
</span><span class="cx">         || pseudoType == CSSSelector::PseudoClassFocus;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline bool SelectorChecker::tagMatches(const Element* element, const QualifiedName&amp; tagQName)
-{
-    if (tagQName == anyQName())
-        return true;
-    const AtomicString&amp; localName = tagQName.localName();
-    if (localName != starAtom &amp;&amp; localName != element-&gt;localName())
-        return false;
-    const AtomicString&amp; namespaceURI = tagQName.namespaceURI();
-    return namespaceURI == starAtom || namespaceURI == element-&gt;namespaceURI();
-}
-
</del><span class="cx"> inline bool SelectorChecker::checkExactAttribute(const Element* element, const CSSSelector* selector, const QualifiedName&amp; selectorAttributeName, const AtomicStringImpl* value)
</span><span class="cx"> {
</span><span class="cx">     if (!element-&gt;hasAttributesWithoutUpdate())
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorFilter.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorFilter.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/css/SelectorFilter.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -39,7 +39,9 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void collectElementIdentifierHashes(const Element* element, Vector&lt;unsigned, 4&gt;&amp; identifierHashes)
</span><span class="cx"> {
</span><del>-    identifierHashes.append(element-&gt;localName().impl()-&gt;existingHash() * TagNameSalt);
</del><ins>+    AtomicString tagLowercaseLocalName = element-&gt;localName().convertToASCIILowercase();
+    identifierHashes.append(tagLowercaseLocalName.impl()-&gt;existingHash() * TagNameSalt);
+
</ins><span class="cx">     if (element-&gt;hasID())
</span><span class="cx">         identifierHashes.append(element-&gt;idForStyleResolution().impl()-&gt;existingHash() * IdAttributeSalt);
</span><span class="cx">     const StyledElement* styledElement = element-&gt;isStyledElement() ? static_cast&lt;const StyledElement*&gt;(element) : 0;
</span><span class="lines">@@ -121,10 +123,12 @@
</span><span class="cx">         if (!selector-&gt;value().isEmpty())
</span><span class="cx">             (*hash++) = selector-&gt;value().impl()-&gt;existingHash() * ClassAttributeSalt;
</span><span class="cx">         break;
</span><del>-    case CSSSelector::Tag:
-        if (selector-&gt;tagQName().localName() != starAtom)
-            (*hash++) = selector-&gt;tagQName().localName().impl()-&gt;existingHash() * TagNameSalt;
</del><ins>+    case CSSSelector::Tag: {
+        const AtomicString&amp; tagLowercaseLocalName = selector-&gt;tagLowercaseLocalName();
+        if (tagLowercaseLocalName != starAtom)
+            (*hash++) = tagLowercaseLocalName.impl()-&gt;existingHash() * TagNameSalt;
</ins><span class="cx">         break;
</span><ins>+    }
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2014 Yusuke Suzuki &lt;utatane.tea@gmail.com&gt;
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">         , tagNameMatchedBacktrackingStartWidthFromIndirectAdjacent(invalidWidth)
</span><span class="cx">         , tagNameNotMatchedBacktrackingStartWidthFromIndirectAdjacent(invalidWidth)
</span><span class="cx">         , widthFromIndirectAdjacent(0)
</span><del>-        , tagName(nullptr)
</del><ins>+        , tagNameSelector(nullptr)
</ins><span class="cx">         , id(nullptr)
</span><span class="cx">         , langFilter(nullptr)
</span><span class="cx">         , pseudoElementSelector(nullptr)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: the large stack allocation caused by the inline capacity causes memory inefficiency. We should dump
</span><span class="cx">     // the min/max/average of the vectors and pick better inline capacity.
</span><del>-    const QualifiedName* tagName;
</del><ins>+    const CSSSelector* tagNameSelector;
</ins><span class="cx">     const AtomicString* id;
</span><span class="cx">     const AtomicString* langFilter;
</span><span class="cx">     Vector&lt;const AtomicStringImpl*, 8&gt; classNames;
</span><span class="lines">@@ -224,11 +224,11 @@
</span><span class="cx"> 
</span><span class="cx"> struct TagNamePattern {
</span><span class="cx">     TagNamePattern()
</span><del>-        : tagName(nullptr)
</del><ins>+        : tagNameSelector(nullptr)
</ins><span class="cx">         , inverted(false)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    const QualifiedName* tagName;
</del><ins>+    const CSSSelector* tagNameSelector;
</ins><span class="cx">     bool inverted;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx">     void generateElementAttributeValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AttributeMatchingInfo&amp; attributeInfo);
</span><span class="cx">     void generateElementAttributeValueExactMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool caseSensitive);
</span><span class="cx">     void generateElementAttributeFunctionCallValueMatching(Assembler::JumpList&amp; failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString&amp; expectedValue, bool caseSensitive, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest);
</span><del>-    void generateElementHasTagName(Assembler::JumpList&amp; failureCases, const QualifiedName&amp; nameToMatch);
</del><ins>+    void generateElementHasTagName(Assembler::JumpList&amp; failureCases, const CSSSelector&amp; tagMatchingSelector);
</ins><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="cx">     void generateElementIsLink(Assembler::JumpList&amp; failureCases);
</span><span class="lines">@@ -913,9 +913,9 @@
</span><span class="cx"> 
</span><span class="cx">         switch (selector-&gt;match()) {
</span><span class="cx">         case CSSSelector::Tag:
</span><del>-            ASSERT(!fragment-&gt;tagName);
-            fragment-&gt;tagName = &amp;(selector-&gt;tagQName());
-            if (*fragment-&gt;tagName != anyQName())
</del><ins>+            ASSERT(!fragment-&gt;tagNameSelector);
+            fragment-&gt;tagNameSelector = selector;
+            if (fragment-&gt;tagNameSelector-&gt;tagQName() != anyQName())
</ins><span class="cx">                 fragment-&gt;onlyMatchesLinksInQuirksMode = false;
</span><span class="cx">             break;
</span><span class="cx">         case CSSSelector::Id: {
</span><span class="lines">@@ -1368,26 +1368,35 @@
</span><span class="cx">     StrictlyEqual
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static inline TagNameEquality equalTagNames(const QualifiedName* lhs, const QualifiedName* rhs)
</del><ins>+static inline TagNameEquality equalTagNames(const CSSSelector* lhs, const CSSSelector* rhs)
</ins><span class="cx"> {
</span><del>-    if (!lhs || *lhs == anyQName())
</del><ins>+    if (!lhs || !rhs)
</ins><span class="cx">         return TagNameEquality::MaybeEqual;
</span><span class="cx"> 
</span><del>-    if (!rhs || *rhs == anyQName())
</del><ins>+    const QualifiedName&amp; lhsQualifiedName = lhs-&gt;tagQName();
+    if (lhsQualifiedName == anyQName())
</ins><span class="cx">         return TagNameEquality::MaybeEqual;
</span><span class="cx"> 
</span><del>-    ASSERT(lhs &amp;&amp; rhs);
</del><ins>+    const QualifiedName&amp; rhsQualifiedName = rhs-&gt;tagQName();
+    if (rhsQualifiedName == anyQName())
+        return TagNameEquality::MaybeEqual;
</ins><span class="cx"> 
</span><del>-    const AtomicString&amp; lhsLocalName = lhs-&gt;localName();
-    const AtomicString&amp; rhsLocalName = rhs-&gt;localName();
</del><ins>+    const AtomicString&amp; lhsLocalName = lhsQualifiedName.localName();
+    const AtomicString&amp; rhsLocalName = rhsQualifiedName.localName();
</ins><span class="cx">     if (lhsLocalName != starAtom &amp;&amp; rhsLocalName != starAtom) {
</span><del>-        if (lhsLocalName != rhsLocalName)
</del><ins>+        const AtomicString&amp; lhsLowercaseLocalName = lhs-&gt;tagLowercaseLocalName();
+        const AtomicString&amp; rhsLowercaseLocalName = rhs-&gt;tagLowercaseLocalName();
+
+        if (lhsLowercaseLocalName != rhsLowercaseLocalName)
</ins><span class="cx">             return TagNameEquality::StrictlyNotEqual;
</span><del>-        return TagNameEquality::StrictlyEqual;
</del><ins>+
+        if (lhsLocalName == lhsLowercaseLocalName &amp;&amp; rhsLocalName == rhsLowercaseLocalName)
+            return TagNameEquality::StrictlyEqual;
+        return TagNameEquality::MaybeEqual;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const AtomicString&amp; lhsNamespaceURI = lhs-&gt;namespaceURI();
-    const AtomicString&amp; rhsNamespaceURI = rhs-&gt;namespaceURI();
</del><ins>+    const AtomicString&amp; lhsNamespaceURI = lhsQualifiedName.namespaceURI();
+    const AtomicString&amp; rhsNamespaceURI = rhsQualifiedName.namespaceURI();
</ins><span class="cx">     if (lhsNamespaceURI != starAtom &amp;&amp; rhsNamespaceURI != starAtom) {
</span><span class="cx">         if (lhsNamespaceURI != rhsNamespaceURI)
</span><span class="cx">             return TagNameEquality::StrictlyNotEqual;
</span><span class="lines">@@ -1397,9 +1406,9 @@
</span><span class="cx">     return TagNameEquality::MaybeEqual;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool equalTagNamePatterns(const TagNamePattern&amp; lhs, const QualifiedName* rhs)
</del><ins>+static inline bool equalTagNamePatterns(const TagNamePattern&amp; lhs, const TagNamePattern&amp; rhs)
</ins><span class="cx"> {
</span><del>-    TagNameEquality result = equalTagNames(lhs.tagName, rhs);
</del><ins>+    TagNameEquality result = equalTagNames(lhs.tagNameSelector, rhs.tagNameSelector);
</ins><span class="cx">     if (result == TagNameEquality::MaybeEqual)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="lines">@@ -1425,7 +1434,7 @@
</span><span class="cx">         for (unsigned i = 0; i &lt; largestPrefixSize; ++i) {
</span><span class="cx">             unsigned lastIndex = tagNames.size() - 1;
</span><span class="cx">             unsigned currentIndex = lastIndex - i;
</span><del>-            if (!equalTagNamePatterns(tagNames[currentIndex], tagNames[currentIndex - offsetToLargestPrefix].tagName)) {
</del><ins>+            if (!equalTagNamePatterns(tagNames[currentIndex], tagNames[currentIndex - offsetToLargestPrefix])) {
</ins><span class="cx">                 matched = false;
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="lines">@@ -1445,13 +1454,13 @@
</span><span class="cx">         tagNamesForChildChain.clear();
</span><span class="cx"> 
</span><span class="cx">         TagNamePattern pattern;
</span><del>-        pattern.tagName = fragment.tagName;
</del><ins>+        pattern.tagNameSelector = fragment.tagNameSelector;
</ins><span class="cx">         tagNamesForChildChain.append(pattern);
</span><span class="cx">         fragment.heightFromDescendant = 0;
</span><span class="cx">         previousChildFragmentInChildChain = nullptr;
</span><span class="cx">     } else if (fragment.relationToRightFragment == FragmentRelation::Child) {
</span><span class="cx">         TagNamePattern pattern;
</span><del>-        pattern.tagName = fragment.tagName;
</del><ins>+        pattern.tagNameSelector = fragment.tagNameSelector;
</ins><span class="cx">         tagNamesForChildChain.append(pattern);
</span><span class="cx"> 
</span><span class="cx">         unsigned maxPrefixSize = tagNamesForChildChain.size() - 1;
</span><span class="lines">@@ -1460,7 +1469,7 @@
</span><span class="cx">             maxPrefixSize = tagNamesForChildChain.size() - previousChildFragmentInChildChain-&gt;tagNameMatchedBacktrackingStartHeightFromDescendant;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (pattern.tagName) {
</del><ins>+        if (pattern.tagNameSelector) {
</ins><span class="cx">             // Compute height from descendant in the case that tagName is not matched.
</span><span class="cx">             tagNamesForChildChain.last().inverted = true;
</span><span class="cx">             fragment.tagNameNotMatchedBacktrackingStartHeightFromDescendant = computeBacktrackingStartOffsetInChain(tagNamesForChildChain, maxPrefixSize);
</span><span class="lines">@@ -1493,13 +1502,13 @@
</span><span class="cx">         tagNamesForDirectAdjacentChain.clear();
</span><span class="cx"> 
</span><span class="cx">         TagNamePattern pattern;
</span><del>-        pattern.tagName = fragment.tagName;
</del><ins>+        pattern.tagNameSelector = fragment.tagNameSelector;
</ins><span class="cx">         tagNamesForDirectAdjacentChain.append(pattern);
</span><span class="cx">         fragment.widthFromIndirectAdjacent = 0;
</span><span class="cx">         previousDirectAdjacentFragmentInDirectAdjacentChain = nullptr;
</span><span class="cx">     } else if (fragment.relationToRightFragment == FragmentRelation::DirectAdjacent) {
</span><span class="cx">         TagNamePattern pattern;
</span><del>-        pattern.tagName = fragment.tagName;
</del><ins>+        pattern.tagNameSelector = fragment.tagNameSelector;
</ins><span class="cx">         tagNamesForDirectAdjacentChain.append(pattern);
</span><span class="cx"> 
</span><span class="cx">         unsigned maxPrefixSize = tagNamesForDirectAdjacentChain.size() - 1;
</span><span class="lines">@@ -1508,7 +1517,7 @@
</span><span class="cx">             maxPrefixSize = tagNamesForDirectAdjacentChain.size() - previousDirectAdjacentFragmentInDirectAdjacentChain-&gt;tagNameMatchedBacktrackingStartWidthFromIndirectAdjacent;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (pattern.tagName) {
</del><ins>+        if (pattern.tagNameSelector) {
</ins><span class="cx">             // Compute height from descendant in the case that tagName is not matched.
</span><span class="cx">             tagNamesForDirectAdjacentChain.last().inverted = true;
</span><span class="cx">             fragment.tagNameNotMatchedBacktrackingStartWidthFromIndirectAdjacent = computeBacktrackingStartOffsetInChain(tagNamesForDirectAdjacentChain, maxPrefixSize);
</span><span class="lines">@@ -2474,8 +2483,8 @@
</span><span class="cx"> 
</span><span class="cx"> void SelectorCodeGenerator::generateElementMatching(Assembler::JumpList&amp; matchingTagNameFailureCases, Assembler::JumpList&amp; matchingPostTagNameFailureCases, const SelectorFragment&amp; fragment)
</span><span class="cx"> {
</span><del>-    if (fragment.tagName)
-        generateElementHasTagName(matchingTagNameFailureCases, *(fragment.tagName));
</del><ins>+    if (fragment.tagNameSelector)
+        generateElementHasTagName(matchingTagNameFailureCases, *(fragment.tagNameSelector));
</ins><span class="cx"> 
</span><span class="cx">     generateElementLinkMatching(matchingPostTagNameFailureCases, fragment);
</span><span class="cx"> 
</span><span class="lines">@@ -3396,8 +3405,9 @@
</span><span class="cx">     failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void SelectorCodeGenerator::generateElementHasTagName(Assembler::JumpList&amp; failureCases, const QualifiedName&amp; nameToMatch)
</del><ins>+inline void SelectorCodeGenerator::generateElementHasTagName(Assembler::JumpList&amp; failureCases, const CSSSelector&amp; tagMatchingSelector)
</ins><span class="cx"> {
</span><ins>+    const QualifiedName&amp; nameToMatch = tagMatchingSelector.tagQName();
</ins><span class="cx">     if (nameToMatch == anyQName())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -3407,10 +3417,32 @@
</span><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; selectorLocalName = nameToMatch.localName();
</span><span class="cx">     if (selectorLocalName != starAtom) {
</span><del>-        // Generate localName == element-&gt;localName().
-        LocalRegister constantRegister(m_registerAllocator);
-        m_assembler.move(Assembler::TrustedImmPtr(selectorLocalName.impl()), constantRegister);
-        failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(qualifiedNameImpl, QualifiedName::QualifiedNameImpl::localNameMemoryOffset()), constantRegister));
</del><ins>+        const AtomicString&amp; lowercaseLocalName = tagMatchingSelector.tagLowercaseLocalName();
+
+        if (selectorLocalName == lowercaseLocalName) {
+            // Generate localName == element-&gt;localName().
+            LocalRegister constantRegister(m_registerAllocator);
+            m_assembler.move(Assembler::TrustedImmPtr(selectorLocalName.impl()), constantRegister);
+            failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(qualifiedNameImpl, QualifiedName::QualifiedNameImpl::localNameMemoryOffset()), constantRegister));
+        } else {
+            Assembler::JumpList caseSensitiveCases;
+            caseSensitiveCases.append(testIsHTMLFlagOnNode(Assembler::Zero, m_assembler, elementAddressRegister));
+            {
+                LocalRegister document(m_registerAllocator);
+                getDocument(m_assembler, elementAddressRegister, document);
+                caseSensitiveCases.append(testIsHTMLClassOnDocument(Assembler::Zero, m_assembler, document));
+            }
+
+            LocalRegister constantRegister(m_registerAllocator);
+            m_assembler.move(Assembler::TrustedImmPtr(lowercaseLocalName.impl()), constantRegister);
+            Assembler::Jump skipCaseSensitiveCase = m_assembler.jump();
+
+            caseSensitiveCases.link(&amp;m_assembler);
+            m_assembler.move(Assembler::TrustedImmPtr(selectorLocalName.impl()), constantRegister);
+            skipCaseSensitiveCase.link(&amp;m_assembler);
+
+            failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(qualifiedNameImpl, QualifiedName::QualifiedNameImpl::localNameMemoryOffset()), constantRegister));
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; selectorNamespaceURI = nameToMatch.namespaceURI();
</span></span></pre></div>
<a id="trunkSourceWebCoredomSelectorQuerycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SelectorQuery.cpp (179131 => 179132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SelectorQuery.cpp        2015-01-26 20:04:38 UTC (rev 179131)
+++ trunk/Source/WebCore/dom/SelectorQuery.cpp        2015-01-26 20:40:18 UTC (rev 179132)
</span><span class="lines">@@ -282,15 +282,33 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+static ALWAYS_INLINE bool localNameMatches(const Element&amp; element, const AtomicString&amp; localName, const AtomicString&amp; lowercaseLocalName)
+{
+    if (element.isHTMLElement() &amp;&amp; element.document().isHTMLDocument())
+        return element.localName() == lowercaseLocalName;
+    return element.localName() == localName;
+
+}
+
</ins><span class="cx"> template &lt;typename SelectorQueryTrait&gt;
</span><del>-static inline void elementsForLocalName(const ContainerNode&amp; rootNode, const AtomicString&amp; localName, typename SelectorQueryTrait::OutputType&amp; output)
</del><ins>+static inline void elementsForLocalName(const ContainerNode&amp; rootNode, const AtomicString&amp; localName, const AtomicString&amp; lowercaseLocalName, typename SelectorQueryTrait::OutputType&amp; output)
</ins><span class="cx"> {
</span><del>-    for (auto&amp; element : elementDescendants(const_cast&lt;ContainerNode&amp;&gt;(rootNode))) {
-        if (element.tagQName().localName() == localName) {
-            SelectorQueryTrait::appendOutputForElement(output, &amp;element);
-            if (SelectorQueryTrait::shouldOnlyMatchFirstElement)
</del><ins>+    if (localName == lowercaseLocalName) {
+        for (auto&amp; element : elementDescendants(const_cast&lt;ContainerNode&amp;&gt;(rootNode))) {
+            if (element.tagQName().localName() == localName) {
+                SelectorQueryTrait::appendOutputForElement(output, &amp;element);
+                if (SelectorQueryTrait::shouldOnlyMatchFirstElement)
</ins><span class="cx">                 return;
</span><ins>+            }
</ins><span class="cx">         }
</span><ins>+    } else {
+        for (auto&amp; element : elementDescendants(const_cast&lt;ContainerNode&amp;&gt;(rootNode))) {
+            if (localNameMatches(element, localName, lowercaseLocalName)) {
+                SelectorQueryTrait::appendOutputForElement(output, &amp;element);
+                if (SelectorQueryTrait::shouldOnlyMatchFirstElement)
+                return;
+            }
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -313,12 +331,13 @@
</span><span class="cx"> 
</span><span class="cx">     const QualifiedName&amp; tagQualifiedName = selectorData.selector-&gt;tagQName();
</span><span class="cx">     const AtomicString&amp; selectorLocalName = tagQualifiedName.localName();
</span><ins>+    const AtomicString&amp; selectorLowercaseLocalName = selectorData.selector-&gt;tagLowercaseLocalName();
</ins><span class="cx">     const AtomicString&amp; selectorNamespaceURI = tagQualifiedName.namespaceURI();
</span><span class="cx"> 
</span><span class="cx">     if (selectorNamespaceURI == starAtom) {
</span><span class="cx">         if (selectorLocalName != starAtom) {
</span><span class="cx">             // Common case: name defined, selectorNamespaceURI is a wildcard.
</span><del>-            elementsForLocalName&lt;SelectorQueryTrait&gt;(rootNode, selectorLocalName, output);
</del><ins>+            elementsForLocalName&lt;SelectorQueryTrait&gt;(rootNode, selectorLocalName, selectorLowercaseLocalName, output);
</ins><span class="cx">         } else {
</span><span class="cx">             // Other fairly common case: both are wildcards.
</span><span class="cx">             anyElement&lt;SelectorQueryTrait&gt;(rootNode, output);
</span><span class="lines">@@ -326,7 +345,7 @@
</span><span class="cx">     } else {
</span><span class="cx">         // Fallback: NamespaceURI is set, selectorLocalName may be starAtom.
</span><span class="cx">         for (auto&amp; element : elementDescendants(const_cast&lt;ContainerNode&amp;&gt;(rootNode))) {
</span><del>-            if (element.namespaceURI() == selectorNamespaceURI &amp;&amp; (selectorLocalName == starAtom || element.tagQName().localName() == selectorLocalName)) {
</del><ins>+            if (element.namespaceURI() == selectorNamespaceURI &amp;&amp; localNameMatches(element, selectorLocalName, selectorLowercaseLocalName)) {
</ins><span class="cx">                 SelectorQueryTrait::appendOutputForElement(output, &amp;element);
</span><span class="cx">                 if (SelectorQueryTrait::shouldOnlyMatchFirstElement)
</span><span class="cx">                     return;
</span></span></pre>
</div>
</div>

</body>
</html>