<!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>[179203] trunk/LayoutTests</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/179203">179203</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-27 12:45:10 -0800 (Tue, 27 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Import some extra tests for <a href="http://trac.webkit.org/projects/webkit/changeset/179132">r179132</a>
https://bugs.webkit.org/show_bug.cgi?id=140930

Reviewed by Sam Weinig.

Add some tests that were done from previous attempts at fixing
the bug.

* fast/dom/SelectorAPI/tag-case-insensitive-expected.txt: Added.
* fast/dom/SelectorAPI/tag-case-insensitive.html: Added.
* fast/dom/SelectorAPI/tag-case-sensitive-expected.txt: Added.
* fast/dom/SelectorAPI/tag-case-sensitive.xhtml: Added.
* svg/css/case-sensitive-tags-expected.txt: Added.
* svg/css/case-sensitive-tags.html: Added.
* svg/dom/tag-case-sensitive-svg-in-html-expected.txt: Added.
* svg/dom/tag-case-sensitive-svg-in-html.html: Added.
Those tests were created by Alexandru Chiculita for
https://bugs.webkit.org/show_bug.cgi?id=83438

The patch was rejected at the time due to the perf impact.
That has been solved since then by the CSS JIT.

* svg/css/foreignObject-case-styling-expected.html: Added.
* svg/css/foreignObject-case-styling.html: Added.
This test is from Boris Zbarsky when he reported
https://bugs.webkit.org/show_bug.cgi?id=79444.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomSelectorAPItagcaseinsensitiveexpectedtxt">trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomSelectorAPItagcaseinsensitivehtml">trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive.html</a></li>
<li><a href="#trunkLayoutTestsfastdomSelectorAPItagcasesensitiveexpectedtxt">trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomSelectorAPItagcasesensitivexhtml">trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive.xhtml</a></li>
<li><a href="#trunkLayoutTestssvgcsscasesensitivetagsexpectedtxt">trunk/LayoutTests/svg/css/case-sensitive-tags-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcsscasesensitivetagshtml">trunk/LayoutTests/svg/css/case-sensitive-tags.html</a></li>
<li><a href="#trunkLayoutTestssvgcssforeignObjectcasestylingexpectedhtml">trunk/LayoutTests/svg/css/foreignObject-case-styling-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgcssforeignObjectcasestylinghtml">trunk/LayoutTests/svg/css/foreignObject-case-styling.html</a></li>
<li><a href="#trunkLayoutTestssvgdomtagcasesensitivesvginhtmlexpectedtxt">trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomtagcasesensitivesvginhtmlhtml">trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179202 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-27 20:25:04 UTC (rev 179202)
+++ trunk/LayoutTests/ChangeLog        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-01-27  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Import some extra tests for r179132
+        https://bugs.webkit.org/show_bug.cgi?id=140930
+
+        Reviewed by Sam Weinig.
+
+        Add some tests that were done from previous attempts at fixing
+        the bug.
+
+        * fast/dom/SelectorAPI/tag-case-insensitive-expected.txt: Added.
+        * fast/dom/SelectorAPI/tag-case-insensitive.html: Added.
+        * fast/dom/SelectorAPI/tag-case-sensitive-expected.txt: Added.
+        * fast/dom/SelectorAPI/tag-case-sensitive.xhtml: Added.
+        * svg/css/case-sensitive-tags-expected.txt: Added.
+        * svg/css/case-sensitive-tags.html: Added.
+        * svg/dom/tag-case-sensitive-svg-in-html-expected.txt: Added.
+        * svg/dom/tag-case-sensitive-svg-in-html.html: Added.
+        Those tests were created by Alexandru Chiculita for
+        https://bugs.webkit.org/show_bug.cgi?id=83438
+
+        The patch was rejected at the time due to the perf impact.
+        That has been solved since then by the CSS JIT.
+
+        * svg/css/foreignObject-case-styling-expected.html: Added.
+        * svg/css/foreignObject-case-styling.html: Added.
+        This test is from Boris Zbarsky when he reported
+        https://bugs.webkit.org/show_bug.cgi?id=79444.
+
</ins><span class="cx"> 2015-01-27  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Update test results and test expectations
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomSelectorAPItagcaseinsensitiveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive-expected.txt (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive-expected.txt        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+PASS document.querySelector('SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('SPAN') is true
+PASS document.querySelector('SPAN &gt; img') is document.getElementById('img1')
+PASS document.getElementById('img1').webkitMatchesSelector('SPAN &gt; img') is true
+PASS document.querySelector('SPAN img') is document.getElementById('img1')
+PASS document.getElementById('img1').webkitMatchesSelector('SPAN img') is true
+PASS document.querySelector('div ul li SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li SPAN') is true
+PASS document.querySelector('div ul li textarea + SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li textarea + SPAN') is true
+PASS document.querySelector('div ul li span') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li span') is true
+PASS document.querySelector('div ul li spAn') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li spAn') is true
+PASS document.querySelector('DIV ul li span') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('DIV ul li span') is true
+PASS document.querySelector('div UL li span') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div UL li span') is true
+PASS content.querySelector('span1') is null
+PASS content.querySelector('span#UPPER1') is null
+PASS document.querySelector('unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('unknownTag') is true
+PASS document.querySelector('div unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('div unknownTag') is true
+PASS document.querySelector('ul + unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('ul + unknownTag') is true
+PASS document.querySelector('DIV unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('DIV unknownTag') is true
+PASS document.querySelector('UL + unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('UL + unknownTag') is true
+PASS document.querySelector('unknowntag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('unknowntag') is true
+PASS document.querySelector('Unknowntag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('Unknowntag') is true
+PASS document.querySelector('div unknowntag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('div unknowntag') is true
+PASS document.querySelector('ul') is document.getElementById('ul1')
+PASS document.getElementById('ul1').webkitMatchesSelector('ul') is true
+PASS document.querySelector('UL') is document.getElementById('ul1')
+PASS document.getElementById('ul1').webkitMatchesSelector('UL') is true
+PASS content.querySelector('unknowntag1') is null
+PASS content.querySelector('ol') is null
+PASS content.querySelector('OL') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomSelectorAPItagcaseinsensitivehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive.html (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-insensitive.html        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,60 @@
</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;!-- Testing that in HTML documents CSS selectors use case-insensitive tag name matching. --&gt;
+    &lt;div id=&quot;content&quot;&gt;
+        &lt;div style=&quot;display: none&quot;&gt;
+            &lt;ul id=&quot;ul1&quot;&gt;
+                &lt;li&gt;
+                    &lt;textarea id=&quot;textarea1&quot;&gt;&lt;/textarea&gt;
+                    &lt;SPAN id=&quot;upper1&quot;&gt;
+                        &lt;img id=&quot;img1&quot; /&gt;
+                    &lt;/SPAN&gt;
+                &lt;/li&gt;
+            &lt;/ul&gt;
+            &lt;unknownTag id=&quot;unknownTag1&quot;&gt;&lt;/unknownTag&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;script&gt;
+        var content = document.getElementById(&quot;content&quot;);
+        function checkMatchingSelector(selector, elementId) {
+            shouldBe(&quot;document.querySelector('&quot; + selector + &quot;')&quot;, &quot;document.getElementById('&quot; + elementId + &quot;')&quot;);
+            shouldBeTrue(&quot;document.getElementById('&quot; + elementId + &quot;').webkitMatchesSelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        function checkNonMatchingSelector(selector) {
+            shouldBeNull(&quot;content.querySelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        checkMatchingSelector(&quot;SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;SPAN &gt; img&quot;, &quot;img1&quot;);
+        checkMatchingSelector(&quot;SPAN img&quot;, &quot;img1&quot;);
+        checkMatchingSelector(&quot;div ul li SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div ul li textarea + SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div ul li span&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div ul li spAn&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;DIV ul li span&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div UL li span&quot;, &quot;upper1&quot;);
+        checkNonMatchingSelector(&quot;span1&quot;);
+        checkNonMatchingSelector(&quot;span#UPPER1&quot;);
+
+        checkMatchingSelector(&quot;unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;div unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;ul + unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;DIV unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;UL + unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;unknowntag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;Unknowntag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;div unknowntag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;ul&quot;, &quot;ul1&quot;);
+        checkMatchingSelector(&quot;UL&quot;, &quot;ul1&quot;);
+        checkNonMatchingSelector(&quot;unknowntag1&quot;);
+        checkNonMatchingSelector(&quot;ol&quot;);
+        checkNonMatchingSelector(&quot;OL&quot;);
+    &lt;/script&gt;
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomSelectorAPItagcasesensitiveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive-expected.txt (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive-expected.txt        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+PASS content.querySelector('div ul li SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li SPAN') is true
+PASS content.querySelector('div ul li textarea + SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li textarea + SPAN') is true
+PASS content.querySelector('div ul li span') is null
+PASS content.querySelector('div ul li spAn') is null
+PASS content.querySelector('DIV ul li span') is null
+PASS content.querySelector('div UL li span') is null
+PASS content.querySelector('unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('unknownTag') is true
+PASS content.querySelector('div unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('div unknownTag') is true
+PASS content.querySelector('ul + unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('ul + unknownTag') is true
+PASS content.querySelector('DIV unknownTag') is null
+PASS content.querySelector('UL + unknownTag') is null
+PASS content.querySelector('unknownTag1') is null
+PASS content.querySelector('unknowntag') is null
+PASS content.querySelector('Unknowntag') is null
+PASS content.querySelector('div unknowntag') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomSelectorAPItagcasesensitivexhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive.xhtml (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive.xhtml                                (rev 0)
+++ trunk/LayoutTests/fast/dom/SelectorAPI/tag-case-sensitive.xhtml        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!DOCTYPE html 
+     PUBLIC &quot;-//W3C//DTD XHTML 1.1 Strict//EN&quot;
+     &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&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;!-- Testing that in XHTML documents CSS selectors use case-sensitive tag name matching. --&gt;
+    &lt;div id=&quot;content&quot;&gt;
+        &lt;div style=&quot;display: none&quot;&gt;
+            &lt;ul&gt;
+                &lt;li&gt;
+                    &lt;textarea id=&quot;textarea1&quot;&gt;&lt;/textarea&gt;
+                    &lt;SPAN id=&quot;upper1&quot;&gt;&lt;/SPAN&gt;
+                &lt;/li&gt;
+            &lt;/ul&gt;
+            &lt;unknownTag id=&quot;unknownTag1&quot;&gt;&lt;/unknownTag&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;script&gt;
+    &lt;![CDATA[ 
+        var content = document.getElementById(&quot;content&quot;);
+        function checkMatchingSelector(selector, elementId) {
+            shouldBe(&quot;content.querySelector('&quot; + selector + &quot;')&quot;, &quot;document.getElementById('&quot; + elementId + &quot;')&quot;);
+            shouldBeTrue(&quot;document.getElementById('&quot; + elementId + &quot;').webkitMatchesSelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        function checkNonMatchingSelector(selector) {
+            shouldBeNull(&quot;content.querySelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        checkMatchingSelector(&quot;div ul li SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div ul li textarea + SPAN&quot;, &quot;upper1&quot;);
+        checkNonMatchingSelector(&quot;div ul li span&quot;);
+        checkNonMatchingSelector(&quot;div ul li spAn&quot;);
+        checkNonMatchingSelector(&quot;DIV ul li span&quot;);
+        checkNonMatchingSelector(&quot;div UL li span&quot;);
+
+        checkMatchingSelector(&quot;unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;div unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;ul + unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkNonMatchingSelector(&quot;DIV unknownTag&quot;);
+        checkNonMatchingSelector(&quot;UL + unknownTag&quot;);
+        checkNonMatchingSelector(&quot;unknownTag1&quot;);
+        checkNonMatchingSelector(&quot;unknowntag&quot;);
+        checkNonMatchingSelector(&quot;Unknowntag&quot;);
+        checkNonMatchingSelector(&quot;div unknowntag&quot;);
+    ]]&gt; 
+    &lt;/script&gt;
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcsscasesensitivetagsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/case-sensitive-tags-expected.txt (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/case-sensitive-tags-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/css/case-sensitive-tags-expected.txt        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+PASS window.getComputedStyle(document.getElementById(&quot;div1&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;div2&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;div3&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;fo1&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;fo2&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;fo3&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;fo4&quot;)).color is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;circle1&quot;)).fill is &quot;#008000&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;circle2&quot;)).fill is &quot;#008000&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;circle3&quot;)).fill is &quot;#008000&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop1&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop2&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop3&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop4&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop5&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop6&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop7&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS window.getComputedStyle(document.getElementById(&quot;stop8&quot;)).stopColor is &quot;rgb(0, 128, 0)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcsscasesensitivetagshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/case-sensitive-tags.html (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/case-sensitive-tags.html                                (rev 0)
+++ trunk/LayoutTests/svg/css/case-sensitive-tags.html        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,191 @@
</span><ins>+
+&lt;!doctype html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;style&gt;
+            @namespace svg &quot;http://www.w3.org/2000/svg&quot;;
+
+            .red-color {
+                color: red;
+            }
+
+            .green-color {
+                color: green;
+            }
+
+            .red-fill {
+                fill: red;
+            }
+
+            .green-fill {
+                fill: green;
+            }
+
+            .red-stop-color {
+                stop-color: red;
+            }
+
+            .green-stop-color {
+                stop-color: green;
+            }
+
+            .group0 div:nth-of-type(1),
+            .group0 DIV:nth-of-type(2),
+            .group0 Div:nth-of-type(3),
+            .group1 foreignObject:nth-of-type(3) {
+                color: green;
+            }
+
+            .group1 foreignobject:nth-of-type(1),
+            .group1 FOREIGNOBJECT:nth-of-type(2),
+            .group1 ForeignObject:nth-of-type(4)
+            { 
+                color: red;
+            }
+
+            .group2 circle:nth-of-type(1)
+            { 
+                fill: green;
+            }
+
+            .group2 CIRCLE:nth-of-type(2),
+            .group2 Circle:nth-of-type(3) {
+                /* Matching any of these selectors is bad as SVG should use case-sensitive matching. */
+                fill: red;
+            }
+
+            .group3 linearGradient:nth-of-type(3) stop {
+                stop-color: green;
+            }
+
+            .group3 lineargradient:nth-of-type(1) stop,
+            .group3 LINEARGRADIENT:nth-of-type(2) stop,
+            .group3 LinearGradient:nth-of-type(4) stop
+            {
+                /* Matching any of these selectors is bad as SVG should use case-sensitive matching. */
+                stop-color: red;
+            }
+
+            .group4 svg|linearGradient:nth-of-type(3) stop {
+                stop-color: green;
+            }
+
+            .group4 svg|lineargradient:nth-of-type(1) stop,
+            .group4 svg|LINEARGRADIENT:nth-of-type(2) stop,
+            .group4 svg|LinearGradient:nth-of-type(4) stop
+            {
+                /* Matching any of these selectors is bad as SVG should use case-sensitive matching. */
+                stop-color: red;
+            }
+        &lt;/style&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;container&quot;&gt;
+            &lt;div class=&quot;group0&quot;&gt;
+                &lt;div id=&quot;div1&quot; class=&quot;red-color&quot;&gt;HTML element matched using lower case selector.&lt;/div&gt;
+                &lt;div id=&quot;div2&quot; class=&quot;red-color&quot;&gt;HTML element matched using upper case selector.&lt;/div&gt;
+                &lt;div id=&quot;div3&quot; class=&quot;red-color&quot;&gt;HTML element matched using mixed case selector.&lt;/div&gt;
+            &lt;/div&gt;
+
+            &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; height=&quot;900&quot; width=&quot;800&quot;&gt;
+                &lt;g class=&quot;group1&quot; transform=&quot;translate(0, 10)&quot;&gt;
+                    &lt;foreignObject id=&quot;fo1&quot; class=&quot;green-color&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;20&quot;&gt;
+                        SVG foreign object is NOT matched using lower case selector.
+                    &lt;/foreignObject&gt;
+                    &lt;foreignObject id=&quot;fo2&quot; class=&quot;green-color&quot; y=&quot;40&quot; width=&quot;100%&quot; height=&quot;20&quot;&gt;
+                        SVG foreign object is NOT matched using upper case selector.
+                    &lt;/foreignObject&gt;
+                    &lt;foreignObject id=&quot;fo3&quot; class=&quot;red-color&quot; y=&quot;80&quot; width=&quot;100%&quot; height=&quot;20&quot;&gt;
+                        SVG foreign object is matched using canonical form selector.
+                    &lt;/foreignObject&gt;
+                    &lt;foreignObject id=&quot;fo4&quot; class=&quot;green-color&quot; y=&quot;120&quot; width=&quot;100%&quot; height=&quot;20&quot;&gt;
+                        SVG foreign object is NOT matched using mixed case selector.
+                    &lt;/foreignObject&gt;
+                &lt;/g&gt;
+
+                &lt;g class=&quot;group2&quot; transform=&quot;translate(25, 190)&quot;&gt;
+                    &lt;line x1=&quot;-25&quot; y1=&quot;-30&quot; x2=&quot;100%&quot; y2=&quot;-30&quot; stroke-width=&quot;2&quot; stroke=&quot;gray&quot;&gt;&lt;/line&gt;
+
+                    &lt;circle id=&quot;circle1&quot; class=&quot;red-fill&quot; cy=&quot;0&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;0&quot;&gt;Circle SVG element is matched using lower case / canonical form selector&lt;/text&gt;
+
+                    &lt;circle id=&quot;circle2&quot; class=&quot;green-fill&quot; cy=&quot;60&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;60&quot;&gt;Circle SVG element is NOT matched using upper case selector&lt;/text&gt;
+
+                    &lt;circle id=&quot;circle3&quot; class=&quot;green-fill&quot; cy=&quot;120&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;120&quot;&gt;Circle SVG element is NOT matched using mixed case selector&lt;/text&gt;
+                &lt;/g&gt;
+
+                &lt;g class=&quot;group3&quot; transform=&quot;translate(25, 370)&quot;&gt;
+                    &lt;line x1=&quot;-25&quot; y1=&quot;-30&quot; x2=&quot;100%&quot; y2=&quot;-30&quot; stroke-width=&quot;2&quot; stroke=&quot;gray&quot;&gt;&lt;/line&gt;
+
+                    &lt;linearGradient id=&quot;Gradient1&quot;&gt;
+                        &lt;stop id=&quot;stop1&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;0&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient1)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;0&quot;&gt;SVG LinearGradient fill element is NOT matched using lower case selector&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient2&quot;&gt;
+                        &lt;stop id=&quot;stop2&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;60&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient2)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;60&quot;&gt;SVG LinearGradient fill element is NOT matched using upper case selector&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient3&quot;&gt;
+                        &lt;stop id=&quot;stop3&quot; offset=&quot;0%&quot; class=&quot;red-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;120&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient3)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;120&quot;&gt;SVG LinearGradient fill element is matched using canonical form selector&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient4&quot;&gt;
+                        &lt;stop id=&quot;stop4&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;180&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient4)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;180&quot;&gt;SVG LinearGradient fill element is NOT matched using mixed case selector&lt;/text&gt;
+                &lt;/g&gt;
+
+                &lt;g class=&quot;group4&quot; transform=&quot;translate(25, 610)&quot;&gt;
+                    &lt;line x1=&quot;-25&quot; y1=&quot;-30&quot; x2=&quot;100%&quot; y2=&quot;-30&quot; stroke-width=&quot;2&quot; stroke=&quot;gray&quot;&gt;&lt;/line&gt;
+
+                    &lt;linearGradient id=&quot;Gradient5&quot;&gt;
+                        &lt;stop id=&quot;stop5&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;0&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient5)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;0&quot;&gt;SVG LinearGradient fill element is NOT matched using lower case selector + svg namespace&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient6&quot;&gt;
+                        &lt;stop id=&quot;stop6&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;60&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient6)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;60&quot;&gt;SVG LinearGradient fill element is NOT matched using upper case selector + svg namespace&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient7&quot;&gt;
+                        &lt;stop id=&quot;stop7&quot; offset=&quot;0%&quot; class=&quot;red-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;120&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient7)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;120&quot;&gt;SVG LinearGradient fill element is matched using canonical form selector + svg namespace&lt;/text&gt;
+
+                    &lt;linearGradient id=&quot;Gradient8&quot;&gt;
+                        &lt;stop id=&quot;stop8&quot; offset=&quot;0%&quot; class=&quot;green-stop-color&quot; /&gt;
+                    &lt;/linearGradient&gt;
+                    &lt;circle cy=&quot;180&quot; r=&quot;20&quot; stroke=&quot;black&quot; stroke-width=&quot;2&quot; fill=&quot;url(#Gradient8)&quot; /&gt;
+                    &lt;text x=&quot;50&quot; y=&quot;180&quot;&gt;SVG LinearGradient fill element is NOT matched using mixed case selector + svg namespace&lt;/text&gt;
+                &lt;/g&gt;
+            &lt;/svg&gt;
+        &lt;/div&gt;
+        &lt;script&gt;
+            function checkStyle(prefix, count, property, value) {
+                for (var i = 1; i &lt;= count; ++i)
+                    shouldBe(&quot;window.getComputedStyle(document.getElementById(\&quot;&quot; + prefix + i + &quot;\&quot;)).&quot; + property, &quot;\&quot;&quot; + value + &quot;\&quot;&quot;);
+            }
+            checkStyle(&quot;div&quot;, 3, &quot;color&quot;, &quot;rgb(0, 128, 0)&quot;);
+            checkStyle(&quot;fo&quot;, 4, &quot;color&quot;, &quot;rgb(0, 128, 0)&quot;);
+            checkStyle(&quot;circle&quot;, 3, &quot;fill&quot;, &quot;#008000&quot;);
+            checkStyle(&quot;stop&quot;, 8, &quot;stopColor&quot;, &quot;rgb(0, 128, 0)&quot;);
+
+            document.getElementById(&quot;container&quot;).style.display = &quot;none&quot;;
+        &lt;/script&gt;
+        &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssforeignObjectcasestylingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/foreignObject-case-styling-expected.html (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/foreignObject-case-styling-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/css/foreignObject-case-styling-expected.html        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;p&gt;This test the styling of elements in foreignObject. WebKit uses to fail this because it was unable to match &amp;lt;foreignObject&amp;gt; due the uppercase 'O'&lt;/p&gt;
+&lt;p&gt;If test suceed, both words should be green.&lt;/p&gt;
+&lt;svg width=&quot;500&quot; height=&quot;100&quot;&gt;
+  &lt;foreignObject width=&quot;500&quot; height=&quot;100&quot;&gt;
+    &lt;span style=&quot;color:green&quot;&gt;Green&lt;/span&gt;
+    &lt;SPAN style=&quot;color:green&quot;&gt;Green&lt;/SPAN&gt;
+  &lt;/foreignObject&gt;
+&lt;/svg&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcssforeignObjectcasestylinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/foreignObject-case-styling.html (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/foreignObject-case-styling.html                                (rev 0)
+++ trunk/LayoutTests/svg/css/foreignObject-case-styling.html        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;style&gt;
+  span { color: red; }
+  foreignObject span { color: blue; }
+  foreignObject SPAN { color: green; }
+&lt;/style&gt;
+&lt;p&gt;This test the styling of elements in foreignObject. WebKit uses to fail this because it was unable to match &amp;lt;foreignObject&amp;gt; due the uppercase 'O'&lt;/p&gt;
+&lt;p&gt;If test suceed, both words should be green.&lt;/p&gt;
+&lt;svg width=&quot;500&quot; height=&quot;100&quot;&gt;
+  &lt;foreignObject width=&quot;500&quot; height=&quot;100&quot;&gt;
+    &lt;span&gt;Green&lt;/span&gt;
+    &lt;SPAN&gt;Green&lt;/SPAN&gt;
+  &lt;/foreignObject&gt;
+&lt;/svg&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgdomtagcasesensitivesvginhtmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html-expected.txt (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html-expected.txt        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+PASS content.querySelector('SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('SPAN') is true
+PASS content.querySelector('div ul li SPAN') is document.getElementById('upper1')
+PASS document.getElementById('upper1').webkitMatchesSelector('div ul li SPAN') is true
+PASS content.querySelector('unknownTag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('unknownTag') is true
+PASS content.querySelector('unknowntag') is document.getElementById('unknownTag1')
+PASS document.getElementById('unknownTag1').webkitMatchesSelector('unknowntag') is true
+PASS content.querySelector('g') is document.getElementById('group1')
+PASS document.getElementById('group1').webkitMatchesSelector('g') is true
+PASS content.querySelector('G') is null
+PASS content.querySelector('textPath') is document.getElementById('textPath1')
+PASS document.getElementById('textPath1').webkitMatchesSelector('textPath') is true
+PASS content.querySelector('svg textPath') is document.getElementById('textPath1')
+PASS document.getElementById('textPath1').webkitMatchesSelector('svg textPath') is true
+PASS content.querySelector('textpath') is null
+PASS content.querySelector('TextPath') is null
+PASS content.querySelector('foreignObject') is document.getElementById('foreignObject1')
+PASS document.getElementById('foreignObject1').webkitMatchesSelector('foreignObject') is true
+PASS content.querySelector('svg foreignObject') is document.getElementById('foreignObject1')
+PASS document.getElementById('foreignObject1').webkitMatchesSelector('svg foreignObject') is true
+PASS content.querySelector('foreignobject') is null
+PASS content.querySelector('ForeignObject') is null
+PASS content.querySelector('textPath + foreignObject') is document.getElementById('foreignObject1')
+PASS document.getElementById('foreignObject1').webkitMatchesSelector('textPath + foreignObject') is true
+PASS content.querySelector('svg textPath + foreignObject') is document.getElementById('foreignObject1')
+PASS document.getElementById('foreignObject1').webkitMatchesSelector('svg textPath + foreignObject') is true
+PASS content.querySelector('textPath + foreignobject') is null
+PASS content.querySelector('textPath + ForeignObject') is null
+PASS content.querySelector('textpath + foreignObject') is null
+PASS content.querySelector('TextPath + foreignObject') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgdomtagcasesensitivesvginhtmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html.html (0 => 179203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html.html                                (rev 0)
+++ trunk/LayoutTests/svg/dom/tag-case-sensitive-svg-in-html.html        2015-01-27 20:45:10 UTC (rev 179203)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;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;!-- Testing that in SVG tags inside HTML documents match using case-insensitive mode. --&gt;
+    &lt;div id=&quot;content&quot;&gt;
+        &lt;div style=&quot;display: none&quot;&gt;
+            &lt;ul&gt;
+                &lt;li&gt;
+                    &lt;SPAN id=&quot;upper1&quot;&gt;&lt;/SPAN&gt;
+                    &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+                        &lt;g id=&quot;group1&quot;&gt;&lt;/g&gt;
+                        &lt;textPath id=&quot;textPath1&quot;&gt;&lt;/textPath&gt;
+                        &lt;foreignObject id=&quot;foreignObject1&quot;&gt;&lt;/foreignObject&gt;
+                    &lt;/svg&gt;
+                &lt;/li&gt;
+            &lt;/ul&gt;
+            &lt;unknownTag id=&quot;unknownTag1&quot;&gt;&lt;/unknownTag&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;script&gt;
+        var content = document.getElementById(&quot;content&quot;);
+        function checkMatchingSelector(selector, elementId) {
+            shouldBe(&quot;content.querySelector('&quot; + selector + &quot;')&quot;, &quot;document.getElementById('&quot; + elementId + &quot;')&quot;);
+            shouldBeTrue(&quot;document.getElementById('&quot; + elementId + &quot;').webkitMatchesSelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        function checkNonMatchingSelector(selector) {
+            shouldBeNull(&quot;content.querySelector('&quot; + selector + &quot;')&quot;);
+        }
+
+        // Checking that tag name selectors still work on HTML elements when SVG is around.
+        checkMatchingSelector(&quot;SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;div ul li SPAN&quot;, &quot;upper1&quot;);
+        checkMatchingSelector(&quot;unknownTag&quot;, &quot;unknownTag1&quot;);
+        checkMatchingSelector(&quot;unknowntag&quot;, &quot;unknownTag1&quot;);
+
+        checkMatchingSelector(&quot;g&quot;, &quot;group1&quot;);
+        checkNonMatchingSelector(&quot;G&quot;);
+
+        checkMatchingSelector(&quot;textPath&quot;, &quot;textPath1&quot;);
+        checkMatchingSelector(&quot;svg textPath&quot;, &quot;textPath1&quot;);
+        checkNonMatchingSelector(&quot;textpath&quot;);
+        checkNonMatchingSelector(&quot;TextPath&quot;);
+
+        checkMatchingSelector(&quot;foreignObject&quot;, &quot;foreignObject1&quot;);
+        checkMatchingSelector(&quot;svg foreignObject&quot;, &quot;foreignObject1&quot;);
+        checkNonMatchingSelector(&quot;foreignobject&quot;);
+        checkNonMatchingSelector(&quot;ForeignObject&quot;);
+
+        checkMatchingSelector(&quot;textPath + foreignObject&quot;, &quot;foreignObject1&quot;);
+        checkMatchingSelector(&quot;svg textPath + foreignObject&quot;, &quot;foreignObject1&quot;);
+        checkNonMatchingSelector(&quot;textPath + foreignobject&quot;);
+        checkNonMatchingSelector(&quot;textPath + ForeignObject&quot;);
+        checkNonMatchingSelector(&quot;textpath + foreignObject&quot;);
+        checkNonMatchingSelector(&quot;TextPath + foreignObject&quot;);
+    &lt;/script&gt;
+    &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre>
</div>
</div>

</body>
</html>