<!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>[181845] 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/181845">181845</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-22 22:04:46 -0700 (Sun, 22 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>CSS Selectors: fix attribute case-insensitive matching of Contain and List
https://bugs.webkit.org/show_bug.cgi?id=142932
Reviewed by Darin Adler.
Source/WebCore:
Fix the last two attribute selectors that were using full case-insensitive
match:
-Contain ([foo*=bar]).
-List (foo~=bar]).
Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::attributeValueContains):
(WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
Source/WTF:
Add some utility functions to the string classes to find substrings
using ASCII case-insensitive comparisons.
* wtf/text/AtomicString.h:
(WTF::AtomicString::contains):
Add the light version that only lock one register.
(WTF::AtomicString::containsIgnoringASCIICase):
(WTF::AtomicString::findIgnoringASCIICase):
* wtf/text/StringCommon.h:
(WTF::findIgnoringASCIICase):
This is the common implementation used by StringView and StringImpl.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::findIgnoringASCIICase):
* wtf/text/StringImpl.h:
* wtf/text/StringView.cpp:
(WTF::StringView::containsIgnoringASCIICase):
(WTF::StringView::findIgnoringASCIICase):
* wtf/text/StringView.h:
* wtf/text/WTFString.h:
(WTF::String::findIgnoringASCIICase):
(WTF::String::contains):
(WTF::String::containsIgnoringASCIICase):
Tools:
Add tests for the new features and fix some existing tests using the
stringFromUTF8() utility recently added by Dhi.
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::stringFromUTF8):
* TestWebKitAPI/Tests/WTF/StringView.cpp:
LayoutTests:
* fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt: Added.
* fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html: Added.
* fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt: Added.
* fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextAtomicStringh">trunk/Source/WTF/wtf/text/AtomicString.h</a></li>
<li><a href="#trunkSourceWTFwtftextStringCommonh">trunk/Source/WTF/wtf/text/StringCommon.h</a></li>
<li><a href="#trunkSourceWTFwtftextStringImplcpp">trunk/Source/WTF/wtf/text/StringImpl.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextStringImplh">trunk/Source/WTF/wtf/text/StringImpl.h</a></li>
<li><a href="#trunkSourceWTFwtftextStringViewcpp">trunk/Source/WTF/wtf/text/StringView.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextStringViewh">trunk/Source/WTF/wtf/text/StringView.h</a></li>
<li><a href="#trunkSourceWTFwtftextWTFStringh">trunk/Source/WTF/wtf/text/WTFString.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFStringImplcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFStringViewcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastselectorsattributecontainsvaluematchingisasciicaseinsensitiveexpectedtxt">trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsattributecontainsvaluematchingisasciicaseinsensitivehtml">trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsattributelistvaluematchingisasciicaseinsensitiveexpectedtxt">trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsattributelistvaluematchingisasciicaseinsensitivehtml">trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/LayoutTests/ChangeLog        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-22 Benjamin Poulain <benjamin@webkit.org>
+
+ CSS Selectors: fix attribute case-insensitive matching of Contain and List
+ https://bugs.webkit.org/show_bug.cgi?id=142932
+
+ Reviewed by Darin Adler.
+
+ * fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt: Added.
+ * fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html: Added.
+ * fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt: Added.
+ * fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html: Added.
+
</ins><span class="cx"> 2015-03-22 Gyuyoung Kim <gyuyoung.kim@samsung.com>
</span><span class="cx">
</span><span class="cx"> [EFL] Update new flaky tests and remove duplicated failure test.
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsattributecontainsvaluematchingisasciicaseinsensitiveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt (0 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -0,0 +1,417 @@
</span><ins>+When matching attributes case insensitively, it should be ASCII case insensitive. This test verifies the behavior when matching substring anywhere in the values (e.g. [a*="b"])
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing "[data-attribute*=Web-É-Kit]"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit]')[0].id is "target1"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=b-É-K]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-K]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-K]')[0].id is "target1"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=web-É-kit]"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit]')[0].id is "target2"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=b-É-k]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k]')[0].id is "target2"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=WEB-É-KIT]"
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT]')[0].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=B-É-K]"
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K]')[0].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=Web-é-Kit]"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-é-Kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-é-Kit]')[0].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=b-é-K]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-K]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-K]')[0].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=web-é-kit]"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-é-kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=web-é-kit]')[0].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute*=b-é-k]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k]')[0].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute*=Web-É-Kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-É-Kit i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=b-É-k i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=web-É-kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-É-kit i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=b-É-k i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-É-k i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=WEB-É-KIT i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=WEB-É-KIT i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=B-É-K i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute*=B-É-K i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute*=Web-é-Kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-é-Kit i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-é-Kit i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute*=Web-é-Kit i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute*=b-é-k i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute*=web-é-kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-é-kit i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute*=web-é-kit i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute*=web-é-kit i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute*=b-é-k i]"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute*=b-é-k i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=WEB-é-KIT]"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=B-é-K]"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=Web-é-Kit]"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=b-é-k]"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-k]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=b-é-k]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-k]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-k]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=Web-é-kit]"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=b-é-K]"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=web-É-kit]"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=b-É-K]"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=web-É-Kit]"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=b-É-k]"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=WEB-é-KIT i]"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=WEB-é-KIT i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=B-é-k i]"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-k i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=B-é-k i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-k i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-k i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=Web-é-Kit i]"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-Kit i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=b-é-K i]"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=b-é-K i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=Web-é-kit i]"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=Web-é-kit i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=B-é-K i]"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple*=B-é-K i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple*=web-É-kit i]"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-kit i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=b-É-K i]"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-K i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=web-É-Kit i]"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=web-É-Kit i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple*=b-É-k i]"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple*=b-É-k i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsattributecontainsvaluematchingisasciicaseinsensitivehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html (0 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html         (rev 0)
+++ trunk/LayoutTests/fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<style>
+#test-root * {
+ background-color: red;
+}
+</style>
+<style id="style">
+</style>
+</head>
+<body>
+ <div style="display:none" id="test-root">
+ <div data-attribute="Web-É-Kit" multiple="WEB-é-KIT" id="target1"></div>
+ <div data-attribute="web-É-kit" multiple="Web-é-Kit" id="target2"></div>
+ <div data-attribute="WEB-É-KIT" multiple="Web-é-kit" id="target3"></div>
+ <div data-attribute="Web-é-Kit" multiple="web-É-kit" id="target4"></div>
+ <div data-attribute="web-é-kit" multiple="web-É-Kit" id="target5"></div>
+ </div>
+</body>
+<script>
+description('When matching attributes case insensitively, it should be ASCII case insensitive. This test verifies the behavior when matching substring anywhere in the values (e.g. [a*="b"])');
+
+function testQuerySelector(selector, expectedIds) {
+ shouldBe("document.querySelectorAll('" + selector + "').length", '' + expectedIds.length);
+ for (var i = 0; i < expectedIds.length; ++i)
+ shouldBeEqualToString("document.querySelectorAll('" + selector + "')[" + i + "].id", 'target' + expectedIds[i]);
+}
+
+function testStyling(selector, expectedIds) {
+ var stylingElement = document.getElementById("style");
+ stylingElement.innerHTML = '' + selector + ' { background-color: rgb(10, 100, 200); }';
+
+ var allTestCases = document.querySelectorAll("#test-root *");
+ for (var i = 0; i < allTestCases.length; ++i) {
+ var expectMatch = expectedIds.indexOf(parseInt(allTestCases[i].id.replace('target', ''))) >= 0;
+ shouldBeEqualToString('getComputedStyle(document.querySelectorAll("#test-root *")[' + i + ']).backgroundColor', expectMatch ? 'rgb(10, 100, 200)' : 'rgb(255, 0, 0)');
+ }
+
+ stylingElement.innerHTML = '';
+}
+
+function testSelector(selector, expectedIds) {
+ debug("Testing \"" + selector + "\"");
+ testQuerySelector("#test-root " + selector, expectedIds);
+ testStyling("#test-root " + selector, expectedIds);
+ debug("");
+}
+
+var testCases = [
+ // Regular attribute matching is case sensitive.
+ ['[data-attribute*=Web-É-Kit]', [1]],
+ ['[data-attribute*=b-É-K]', [1]],
+
+ ['[data-attribute*=web-É-kit]', [2]],
+ ['[data-attribute*=b-É-k]', [2]],
+
+ ['[data-attribute*=WEB-É-KIT]', [3]],
+ ['[data-attribute*=B-É-K]', [3]],
+
+ ['[data-attribute*=Web-é-Kit]', [4]],
+ ['[data-attribute*=b-é-K]', [4]],
+
+ ['[data-attribute*=web-é-kit]', [5]],
+ ['[data-attribute*=b-é-k]', [5]],
+
+ // Same selectors with the case-insensitive flag.
+ ['[data-attribute*=Web-É-Kit i]', [1, 2, 3]],
+ ['[data-attribute*=b-É-k i]', [1, 2, 3]],
+
+ ['[data-attribute*=web-É-kit i]', [1, 2, 3]],
+ ['[data-attribute*=b-É-k i]', [1, 2, 3]],
+
+ ['[data-attribute*=WEB-É-KIT i]', [1, 2, 3]],
+ ['[data-attribute*=B-É-K i]', [1, 2, 3]],
+
+ ['[data-attribute*=Web-é-Kit i]', [4, 5]],
+ ['[data-attribute*=b-é-k i]', [4, 5]],
+
+ ['[data-attribute*=web-é-kit i]', [4, 5]],
+ ['[data-attribute*=b-é-k i]', [4, 5]],
+
+ // "multiple" is one of those weird legacy exception: it is always case insensitive in HTML.
+ ['[multiple*=WEB-é-KIT]', [1, 2, 3]],
+ ['[multiple*=B-é-K]', [1, 2, 3]],
+
+ ['[multiple*=Web-é-Kit]', [1, 2, 3]],
+ ['[multiple*=b-é-k]', [1, 2, 3]],
+
+ ['[multiple*=Web-é-kit]', [1, 2, 3]],
+ ['[multiple*=b-é-K]', [1, 2, 3]],
+
+ ['[multiple*=web-É-kit]', [4, 5]],
+ ['[multiple*=b-É-K]', [4, 5]],
+
+ ['[multiple*=web-É-Kit]', [4, 5]],
+ ['[multiple*=b-É-k]', [4, 5]],
+
+ ['[multiple*=WEB-é-KIT i]', [1, 2, 3]],
+ ['[multiple*=B-é-k i]', [1, 2, 3]],
+
+ ['[multiple*=Web-é-Kit i]', [1, 2, 3]],
+ ['[multiple*=b-é-K i]', [1, 2, 3]],
+
+ ['[multiple*=Web-é-kit i]', [1, 2, 3]],
+ ['[multiple*=B-é-K i]', [1, 2, 3]],
+
+ ['[multiple*=web-É-kit i]', [4, 5]],
+ ['[multiple*=b-É-K i]', [4, 5]],
+
+ ['[multiple*=web-É-Kit i]', [4, 5]],
+ ['[multiple*=b-É-k i]', [4, 5]],
+];
+
+for (var testCase of testCases) {
+ testSelector(testCase[0], testCase[1]);
+}
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsattributelistvaluematchingisasciicaseinsensitiveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt (0 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -0,0 +1,393 @@
</span><ins>+When matching attributes case insensitively, it should be ASCII case insensitive. This test verifies the behavior when matching a substring in a whitespace-separated list (e.g. [a~="b"])
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing "[data-attribute~=WÈb]"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb]')[0].id is "target1"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=Kit]"
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit]')[0].id is "target1"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=wÈb]"
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb]')[0].id is "target2"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=kit]"
+PASS document.querySelectorAll('#test-root [data-attribute~=kit]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=kit]')[0].id is "target2"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=WÈB]"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB]')[0].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=KIT]"
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT]')[0].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=Wèb]"
+PASS document.querySelectorAll('#test-root [data-attribute~=Wèb]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=Wèb]')[0].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=wèb]"
+PASS document.querySelectorAll('#test-root [data-attribute~=wèb]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=wèb]')[0].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=kIt]"
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt]').length is 1
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt]')[0].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=WÈb i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈb i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=Kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit i]').length is 4
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [data-attribute~=Kit i]')[3].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=wÈb i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=wÈb i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=kit i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=kit i]').length is 4
+PASS document.querySelectorAll('#test-root [data-attribute~=kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=kit i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [data-attribute~=kit i]')[3].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=WÈB i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB i]').length is 3
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=WÈB i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[data-attribute~=KIT i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT i]').length is 4
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [data-attribute~=KIT i]')[3].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=Wèb i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=Wèb i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute~=Wèb i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute~=Wèb i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=wèb i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=wèb i]').length is 2
+PASS document.querySelectorAll('#test-root [data-attribute~=wèb i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [data-attribute~=wèb i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[data-attribute~=kIt i]"
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt i]').length is 4
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [data-attribute~=kIt i]')[3].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple~=WèB]"
+PASS document.querySelectorAll('#test-root [multiple~=WèB]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=WèB]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=WèB]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=WèB]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=KIT]"
+PASS document.querySelectorAll('#test-root [multiple~=KIT]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=KIT]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=KIT]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=KIT]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=KIT]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Wèb]"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Kit]"
+PASS document.querySelectorAll('#test-root [multiple~=Kit]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=Kit]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Kit]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Kit]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=Kit]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Wèb]"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=kit]"
+PASS document.querySelectorAll('#test-root [multiple~=kit]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=kit]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=kit]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=kit]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=kit]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=wÈb]"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]').length is 2
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple~=kiT]"
+PASS document.querySelectorAll('#test-root [multiple~=kiT]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=kiT]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=kiT]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=kiT]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=kiT]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=wÈb]"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]').length is 2
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple~=WèB i]"
+PASS document.querySelectorAll('#test-root [multiple~=WèB i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=WèB i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=WèB i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=WèB i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=KIT i]"
+PASS document.querySelectorAll('#test-root [multiple~=KIT i]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=KIT i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=KIT i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=KIT i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=KIT i]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Wèb i]"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Kit i]"
+PASS document.querySelectorAll('#test-root [multiple~=Kit i]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=Kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Kit i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=Kit i]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=Wèb i]"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]').length is 3
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=Wèb i]')[2].id is "target3"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=kit i]"
+PASS document.querySelectorAll('#test-root [multiple~=kit i]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=kit i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=kit i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=kit i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=kit i]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=wÈb i]"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+Testing "[multiple~=kiT i]"
+PASS document.querySelectorAll('#test-root [multiple~=kiT i]').length is 4
+PASS document.querySelectorAll('#test-root [multiple~=kiT i]')[0].id is "target1"
+PASS document.querySelectorAll('#test-root [multiple~=kiT i]')[1].id is "target2"
+PASS document.querySelectorAll('#test-root [multiple~=kiT i]')[2].id is "target3"
+PASS document.querySelectorAll('#test-root [multiple~=kiT i]')[3].id is "target4"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(255, 0, 0)"
+
+Testing "[multiple~=wÈb i]"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]').length is 2
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]')[0].id is "target4"
+PASS document.querySelectorAll('#test-root [multiple~=wÈb i]')[1].id is "target5"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[0]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[1]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[2]).backgroundColor is "rgb(255, 0, 0)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[3]).backgroundColor is "rgb(10, 100, 200)"
+PASS getComputedStyle(document.querySelectorAll("#test-root *")[4]).backgroundColor is "rgb(10, 100, 200)"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsattributelistvaluematchingisasciicaseinsensitivehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html (0 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html         (rev 0)
+++ trunk/LayoutTests/fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<style>
+#test-root * {
+ background-color: red;
+}
+</style>
+<style id="style">
+</style>
+</head>
+<body>
+ <div style="display:none" id="test-root">
+ <div data-attribute="WÈb Kit" multiple="padding WèB KIT" id="target1"></div>
+ <div data-attribute="padding wÈb kit" multiple="Kit Wèb" id="target2"></div>
+ <div data-attribute="KIT WÈB" multiple="Wèb kit" id="target3"></div>
+ <div data-attribute="Wèb" multiple="padding wÈb kiT" id="target4"></div>
+ <div data-attribute="padding wèb kIt" multiple="wÈb" id="target5"></div>
+ </div>
+</body>
+<script>
+description('When matching attributes case insensitively, it should be ASCII case insensitive. This test verifies the behavior when matching a substring in a whitespace-separated list (e.g. [a~="b"])');
+
+function testQuerySelector(selector, expectedIds) {
+ shouldBe("document.querySelectorAll('" + selector + "').length", '' + expectedIds.length);
+ for (var i = 0; i < expectedIds.length; ++i)
+ shouldBeEqualToString("document.querySelectorAll('" + selector + "')[" + i + "].id", 'target' + expectedIds[i]);
+}
+
+function testStyling(selector, expectedIds) {
+ var stylingElement = document.getElementById("style");
+ stylingElement.innerHTML = '' + selector + ' { background-color: rgb(10, 100, 200); }';
+
+ var allTestCases = document.querySelectorAll("#test-root *");
+ for (var i = 0; i < allTestCases.length; ++i) {
+ var expectMatch = expectedIds.indexOf(parseInt(allTestCases[i].id.replace('target', ''))) >= 0;
+ shouldBeEqualToString('getComputedStyle(document.querySelectorAll("#test-root *")[' + i + ']).backgroundColor', expectMatch ? 'rgb(10, 100, 200)' : 'rgb(255, 0, 0)');
+ }
+
+ stylingElement.innerHTML = '';
+}
+
+function testSelector(selector, expectedIds) {
+ debug("Testing \"" + selector + "\"");
+ testQuerySelector("#test-root " + selector, expectedIds);
+ testStyling("#test-root " + selector, expectedIds);
+ debug("");
+}
+
+var testCases = [
+ // Regular attribute matching is case sensitive.
+ ['[data-attribute~=WÈb]', [1]],
+ ['[data-attribute~=Kit]', [1]],
+
+ ['[data-attribute~=wÈb]', [2]],
+ ['[data-attribute~=kit]', [2]],
+
+ ['[data-attribute~=WÈB]', [3]],
+ ['[data-attribute~=KIT]', [3]],
+
+ ['[data-attribute~=Wèb]', [4]],
+
+ ['[data-attribute~=wèb]', [5]],
+ ['[data-attribute~=kIt]', [5]],
+
+ // Same selectors with the case-insensitive flag.
+ ['[data-attribute~=WÈb i]', [1, 2, 3]],
+ ['[data-attribute~=Kit i]', [1, 2, 3, 5]],
+
+ ['[data-attribute~=wÈb i]', [1, 2, 3]],
+ ['[data-attribute~=kit i]', [1, 2, 3, 5]],
+
+ ['[data-attribute~=WÈB i]', [1, 2, 3]],
+ ['[data-attribute~=KIT i]', [1, 2, 3, 5]],
+
+ ['[data-attribute~=Wèb i]', [4, 5]],
+
+ ['[data-attribute~=wèb i]', [4, 5]],
+ ['[data-attribute~=kIt i]', [1, 2, 3, 5]],
+
+ // "multiple" is one of those weird legacy exception: it is always case insensitive in HTML.
+ ['[multiple~=WèB]', [1, 2, 3]],
+ ['[multiple~=KIT]', [1, 2, 3, 4]],
+
+ ['[multiple~=Wèb]', [1, 2, 3]],
+ ['[multiple~=Kit]', [1, 2, 3, 4]],
+
+ ['[multiple~=Wèb]', [1, 2, 3]],
+ ['[multiple~=kit]', [1, 2, 3, 4]],
+
+ ['[multiple~=wÈb]', [4, 5]],
+ ['[multiple~=kiT]', [1, 2, 3, 4]],
+
+ ['[multiple~=wÈb]', [4, 5]],
+
+ ['[multiple~=WèB i]', [1, 2, 3]],
+ ['[multiple~=KIT i]', [1, 2, 3, 4]],
+
+ ['[multiple~=Wèb i]', [1, 2, 3]],
+ ['[multiple~=Kit i]', [1, 2, 3, 4]],
+
+ ['[multiple~=Wèb i]', [1, 2, 3]],
+ ['[multiple~=kit i]', [1, 2, 3, 4]],
+
+ ['[multiple~=wÈb i]', [4, 5]],
+ ['[multiple~=kiT i]', [1, 2, 3, 4]],
+
+ ['[multiple~=wÈb i]', [4, 5]],
+];
+
+for (var testCase of testCases) {
+ testSelector(testCase[0], testCase[1]);
+}
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/ChangeLog        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-03-22 Benjamin Poulain <benjamin@webkit.org>
+
+ CSS Selectors: fix attribute case-insensitive matching of Contain and List
+ https://bugs.webkit.org/show_bug.cgi?id=142932
+
+ Reviewed by Darin Adler.
+
+ Add some utility functions to the string classes to find substrings
+ using ASCII case-insensitive comparisons.
+
+ * wtf/text/AtomicString.h:
+ (WTF::AtomicString::contains):
+ Add the light version that only lock one register.
+
+ (WTF::AtomicString::containsIgnoringASCIICase):
+ (WTF::AtomicString::findIgnoringASCIICase):
+
+ * wtf/text/StringCommon.h:
+ (WTF::findIgnoringASCIICase):
+ This is the common implementation used by StringView and StringImpl.
+
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::findIgnoringASCIICase):
+ * wtf/text/StringImpl.h:
+ * wtf/text/StringView.cpp:
+ (WTF::StringView::containsIgnoringASCIICase):
+ (WTF::StringView::findIgnoringASCIICase):
+ * wtf/text/StringView.h:
+ * wtf/text/WTFString.h:
+ (WTF::String::findIgnoringASCIICase):
+ (WTF::String::contains):
+ (WTF::String::containsIgnoringASCIICase):
+
</ins><span class="cx"> 2015-03-19 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> DFGAllocator should use bmalloc's aligned allocator.
</span></span></pre></div>
<a id="trunkSourceWTFwtftextAtomicStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/AtomicString.h (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/AtomicString.h        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/AtomicString.h        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -115,14 +115,22 @@
</span><span class="cx"> bool contains(UChar c) const { return m_string.contains(c); }
</span><span class="cx"> bool contains(const LChar* s, bool caseSensitive = true) const
</span><span class="cx"> { return m_string.contains(s, caseSensitive); }
</span><del>- bool contains(const String& s, bool caseSensitive = true) const
</del><ins>+ bool contains(const String& s) const
+ { return m_string.contains(s); }
+ bool contains(const String& s, bool caseSensitive) const
</ins><span class="cx"> { return m_string.contains(s, caseSensitive); }
</span><ins>+ bool containsIgnoringASCIICase(const String& s) const
+ { return m_string.containsIgnoringASCIICase(s); }
</ins><span class="cx">
</span><span class="cx"> size_t find(UChar c, unsigned start = 0) const { return m_string.find(c, start); }
</span><span class="cx"> size_t find(const LChar* s, unsigned start = 0, bool caseSentitive = true) const
</span><span class="cx"> { return m_string.find(s, start, caseSentitive); }
</span><span class="cx"> size_t find(const String& s, unsigned start = 0, bool caseSentitive = true) const
</span><span class="cx"> { return m_string.find(s, start, caseSentitive); }
</span><ins>+ size_t findIgnoringASCIICase(const String& s) const
+ { return m_string.findIgnoringASCIICase(s); }
+ size_t findIgnoringASCIICase(const String& s, unsigned startOffset) const
+ { return m_string.findIgnoringASCIICase(s, startOffset); }
</ins><span class="cx"> size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) const
</span><span class="cx"> { return m_string.find(matchFunction, start); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringCommonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringCommon.h (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringCommon.h        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/StringCommon.h        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -417,6 +417,50 @@
</span><span class="cx"> return equalIgnoringASCIICase(reference.characters16() + startOffset, suffix.characters16(), suffixLength);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template <typename SearchCharacterType, typename MatchCharacterType>
+size_t findIgnoringASCIICase(const SearchCharacterType* source, const MatchCharacterType* matchCharacters, unsigned startOffset, unsigned searchLength, unsigned matchLength)
+{
+ ASSERT(searchLength >= matchLength);
+
+ const SearchCharacterType* startSearchedCharacters = source + startOffset;
+
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = searchLength - matchLength;
+
+ for (unsigned i = 0; i <= delta; ++i) {
+ if (equalIgnoringASCIICase(startSearchedCharacters + i, matchCharacters, matchLength))
+ return startOffset + i;
+ }
+ return notFound;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename StringClassA, typename StringClassB>
+size_t findIgnoringASCIICase(const StringClassA& source, const StringClassB& stringToFind, unsigned startOffset)
+{
+ unsigned sourceStringLength = source.length();
+ unsigned matchLength = stringToFind.length();
+ if (!matchLength)
+ return std::min(startOffset, sourceStringLength);
+
+ // Check startOffset & matchLength are in range.
+ if (startOffset > sourceStringLength)
+ return notFound;
+ unsigned searchLength = sourceStringLength - startOffset;
+ if (matchLength > searchLength)
+ return notFound;
+
+ if (source.is8Bit()) {
+ if (stringToFind.is8Bit())
+ return findIgnoringASCIICase(source.characters8(), stringToFind.characters8(), startOffset, searchLength, matchLength);
+ return findIgnoringASCIICase(source.characters8(), stringToFind.characters16(), startOffset, searchLength, matchLength);
+ }
+
+ if (stringToFind.is8Bit())
+ return findIgnoringASCIICase(source.characters16(), stringToFind.characters8(), startOffset, searchLength, matchLength);
+
+ return findIgnoringASCIICase(source.characters16(), stringToFind.characters16(), startOffset, searchLength, matchLength);
+}
+
+}
+
</ins><span class="cx"> #endif // StringCommon_h
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringImpl.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -1226,6 +1226,30 @@
</span><span class="cx"> return findIgnoringCaseInner(characters16() + index, matchString->characters16(), index, searchLength, matchLength);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+size_t StringImpl::findIgnoringASCIICase(const StringImpl& matchString) const
+{
+ return ::WTF::findIgnoringASCIICase(*this, matchString, 0);
+}
+
+size_t StringImpl::findIgnoringASCIICase(const StringImpl& matchString, unsigned startOffset) const
+{
+ return ::WTF::findIgnoringASCIICase(*this, matchString, startOffset);
+}
+
+size_t StringImpl::findIgnoringASCIICase(const StringImpl* matchString) const
+{
+ if (!matchString)
+ return notFound;
+ return ::WTF::findIgnoringASCIICase(*this, *matchString, 0);
+}
+
+size_t StringImpl::findIgnoringASCIICase(const StringImpl* matchString, unsigned startOffset) const
+{
+ if (!matchString)
+ return notFound;
+ return ::WTF::findIgnoringASCIICase(*this, *matchString, startOffset);
+}
+
</ins><span class="cx"> size_t StringImpl::findNextLineStart(unsigned index)
</span><span class="cx"> {
</span><span class="cx"> if (is8Bit())
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringImpl.h (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringImpl.h        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/StringImpl.h        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -661,6 +661,10 @@
</span><span class="cx"> size_t findIgnoringCase(const LChar*, unsigned index = 0);
</span><span class="cx"> ALWAYS_INLINE size_t findIgnoringCase(const char* s, unsigned index = 0) { return findIgnoringCase(reinterpret_cast<const LChar*>(s), index); }
</span><span class="cx"> WTF_EXPORT_STRING_API size_t findIgnoringCase(StringImpl*, unsigned index = 0);
</span><ins>+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl&) const;
+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl&, unsigned startOffset) const;
+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl*) const;
+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl*, unsigned startOffset) const;
</ins><span class="cx">
</span><span class="cx"> WTF_EXPORT_STRING_API size_t findNextLineStart(unsigned index = UINT_MAX);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringView.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringView.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/StringView.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -33,6 +33,26 @@
</span><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><ins>+bool StringView::containsIgnoringASCIICase(const StringView& matchString) const
+{
+ return findIgnoringASCIICase(matchString) != notFound;
+}
+
+bool StringView::containsIgnoringASCIICase(const StringView& matchString, unsigned startOffset) const
+{
+ return findIgnoringASCIICase(matchString, startOffset) != notFound;
+}
+
+size_t StringView::findIgnoringASCIICase(const StringView& matchString) const
+{
+ return ::WTF::findIgnoringASCIICase(*this, matchString, 0);
+}
+
+size_t StringView::findIgnoringASCIICase(const StringView& matchString, unsigned startOffset) const
+{
+ return ::WTF::findIgnoringASCIICase(*this, matchString, startOffset);
+}
+
</ins><span class="cx"> bool StringView::startsWith(const StringView& prefix) const
</span><span class="cx"> {
</span><span class="cx"> return ::WTF::startsWith(*this, prefix);
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringView.h (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringView.h        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/StringView.h        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -104,7 +104,12 @@
</span><span class="cx"> StringView substring(unsigned start, unsigned length = std::numeric_limits<unsigned>::max()) const;
</span><span class="cx">
</span><span class="cx"> size_t find(UChar, unsigned start = 0) const;
</span><ins>+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringView&) const;
+ WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringView&, unsigned startOffset) const;
+
</ins><span class="cx"> bool contains(UChar) const;
</span><ins>+ WTF_EXPORT_STRING_API bool containsIgnoringASCIICase(const StringView&) const;
+ WTF_EXPORT_STRING_API bool containsIgnoringASCIICase(const StringView&, unsigned startOffset) const;
</ins><span class="cx">
</span><span class="cx"> WTF_EXPORT_STRING_API bool startsWith(const StringView&) const;
</span><span class="cx"> WTF_EXPORT_STRING_API bool startsWithIgnoringASCIICase(const StringView&) const;
</span></span></pre></div>
<a id="trunkSourceWTFwtftextWTFStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/WTFString.h (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/WTFString.h        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WTF/wtf/text/WTFString.h        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -220,6 +220,10 @@
</span><span class="cx"> { return m_impl ? m_impl->find(str.impl()) : notFound; }
</span><span class="cx"> size_t find(const String& str, unsigned start) const
</span><span class="cx"> { return m_impl ? m_impl->find(str.impl(), start) : notFound; }
</span><ins>+ size_t findIgnoringASCIICase(const String& str) const
+ { return m_impl ? m_impl->findIgnoringASCIICase(str.impl()) : notFound; }
+ size_t findIgnoringASCIICase(const String& str, unsigned startOffset) const
+ { return m_impl ? m_impl->findIgnoringASCIICase(str.impl(), startOffset) : notFound; }
</ins><span class="cx">
</span><span class="cx"> size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) const
</span><span class="cx"> { return m_impl ? m_impl->find(matchFunction, start) : notFound; }
</span><span class="lines">@@ -258,8 +262,14 @@
</span><span class="cx"> bool contains(UChar c) const { return find(c) != notFound; }
</span><span class="cx"> bool contains(const LChar* str, bool caseSensitive = true, unsigned startOffset = 0) const
</span><span class="cx"> { return find(str, startOffset, caseSensitive) != notFound; }
</span><del>- bool contains(const String& str, bool caseSensitive = true, unsigned startOffset = 0) const
</del><ins>+ bool contains(const String& str) const
+ { return find(str) != notFound; }
+ bool contains(const String& str, bool caseSensitive, unsigned startOffset = 0) const
</ins><span class="cx"> { return find(str, startOffset, caseSensitive) != notFound; }
</span><ins>+ bool containsIgnoringASCIICase(const String& str) const
+ { return findIgnoringASCIICase(str) != notFound; }
+ bool containsIgnoringASCIICase(const String& str, unsigned startOffset) const
+ { return findIgnoringASCIICase(str, startOffset) != notFound; }
</ins><span class="cx">
</span><span class="cx"> bool startsWith(const String& s) const
</span><span class="cx"> { return m_impl ? m_impl->startsWith(s.impl()) : s.isEmpty(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WebCore/ChangeLog        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-03-22 Benjamin Poulain <benjamin@webkit.org>
+
+ CSS Selectors: fix attribute case-insensitive matching of Contain and List
+ https://bugs.webkit.org/show_bug.cgi?id=142932
+
+ Reviewed by Darin Adler.
+
+ Fix the last two attribute selectors that were using full case-insensitive
+ match:
+ -Contain ([foo*=bar]).
+ -List (foo~=bar]).
+
+ Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
+ fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
+
+ * css/SelectorChecker.cpp:
+ (WebCore::attributeValueMatches):
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::attributeValueContains):
+ (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
+
</ins><span class="cx"> 2015-03-22 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> Detect when url filter pattern with groups match the empty string
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -431,7 +431,11 @@
</span><span class="cx">
</span><span class="cx"> unsigned startSearchAt = 0;
</span><span class="cx"> while (true) {
</span><del>- size_t foundPos = value.find(selectorValue, startSearchAt, caseSensitive);
</del><ins>+ size_t foundPos;
+ if (caseSensitive)
+ foundPos = value.find(selectorValue, startSearchAt);
+ else
+ foundPos = value.findIgnoringASCIICase(selectorValue, startSearchAt);
</ins><span class="cx"> if (foundPos == notFound)
</span><span class="cx"> return false;
</span><span class="cx"> if (!foundPos || isHTMLSpace(value[foundPos - 1])) {
</span><span class="lines">@@ -445,10 +449,18 @@
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- case CSSSelector::Contain:
- if (!value.contains(selectorValue, caseSensitive) || selectorValue.isEmpty())
</del><ins>+ case CSSSelector::Contain: {
+ bool valueContainsSelectorValue;
+ if (caseSensitive)
+ valueContainsSelectorValue = value.contains(selectorValue);
+ else
+ valueContainsSelectorValue = value.containsIgnoringASCIICase(selectorValue);
+
+ if (!valueContainsSelectorValue || selectorValue.isEmpty())
</ins><span class="cx"> return false;
</span><ins>+
</ins><span class="cx"> break;
</span><ins>+ }
</ins><span class="cx"> case CSSSelector::Begin:
</span><span class="cx"> if (selectorValue.isEmpty())
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -2817,7 +2817,7 @@
</span><span class="cx"> AtomicStringImpl& valueImpl = *attribute->value().impl();
</span><span class="cx"> if (caseSensitivity == CaseSensitive)
</span><span class="cx"> return valueImpl.find(expectedString) != notFound;
</span><del>- return valueImpl.findIgnoringCase(expectedString) != notFound;
</del><ins>+ return valueImpl.findIgnoringASCIICase(expectedString) != notFound;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<CaseSensitivity caseSensitivity>
</span><span class="lines">@@ -2863,7 +2863,7 @@
</span><span class="cx"> if (caseSensitivity == CaseSensitive)
</span><span class="cx"> foundPos = value.find(expectedString, startSearchAt);
</span><span class="cx"> else
</span><del>- foundPos = value.findIgnoringCase(expectedString, startSearchAt);
</del><ins>+ foundPos = value.findIgnoringASCIICase(expectedString, startSearchAt);
</ins><span class="cx"> if (foundPos == notFound)
</span><span class="cx"> return false;
</span><span class="cx"> if (!foundPos || isHTMLSpace(value[foundPos - 1])) {
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Tools/ChangeLog        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-03-22 Benjamin Poulain <benjamin@webkit.org>
+
+ CSS Selectors: fix attribute case-insensitive matching of Contain and List
+ https://bugs.webkit.org/show_bug.cgi?id=142932
+
+ Reviewed by Darin Adler.
+
+ Add tests for the new features and fix some existing tests using the
+ stringFromUTF8() utility recently added by Dhi.
+
+ * TestWebKitAPI/Tests/WTF/StringImpl.cpp:
+ (TestWebKitAPI::stringFromUTF8):
+ * TestWebKitAPI/Tests/WTF/StringView.cpp:
+
</ins><span class="cx"> 2015-03-22 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] install-dependencies should install orc
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFStringImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -142,12 +142,17 @@
</span><span class="cx"> ASSERT_TRUE(equalIgnoringASCIICase(b.get(), a.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static RefPtr<StringImpl> stringFromUTF8(const char* characters)
+{
+ return String::fromUTF8(characters).impl();
+}
+
</ins><span class="cx"> TEST(WTF, StringImplEqualIgnoringASCIICaseWithLatin1Characters)
</span><span class="cx"> {
</span><del>- RefPtr<StringImpl> a = StringImpl::create(reinterpret_cast<const LChar*>("aBcéeFG"));
- RefPtr<StringImpl> b = StringImpl::create(reinterpret_cast<const LChar*>("ABCÉEFG"));
- RefPtr<StringImpl> c = StringImpl::create(reinterpret_cast<const LChar*>("ABCéEFG"));
- RefPtr<StringImpl> d = StringImpl::create(reinterpret_cast<const LChar*>("abcéefg"));
</del><ins>+ RefPtr<StringImpl> a = stringFromUTF8("aBcéeFG");
+ RefPtr<StringImpl> b = stringFromUTF8("ABCÉEFG");
+ RefPtr<StringImpl> c = stringFromUTF8("ABCéEFG");
+ RefPtr<StringImpl> d = stringFromUTF8("abcéefg");
</ins><span class="cx">
</span><span class="cx"> // Identity.
</span><span class="cx"> ASSERT_TRUE(equalIgnoringASCIICase(a.get(), a.get()));
</span><span class="lines">@@ -164,10 +169,174 @@
</span><span class="cx"> ASSERT_TRUE(equalIgnoringASCIICase(c.get(), d.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+TEST(WTF, StringImplFindIgnoringASCIICaseBasic)
+{
+ RefPtr<StringImpl> referenceA = stringFromUTF8("aBcéeFG");
+ RefPtr<StringImpl> referenceB = stringFromUTF8("ABCÉEFG");
+
+ // Search the exact string.
+ EXPECT_EQ(static_cast<size_t>(0), referenceA->findIgnoringASCIICase(referenceA.get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB->findIgnoringASCIICase(referenceB.get()));
+
+ // A and B are distinct by the non-ascii character é/É.
+ EXPECT_EQ(static_cast<size_t>(notFound), referenceA->findIgnoringASCIICase(referenceB.get()));
+ EXPECT_EQ(static_cast<size_t>(notFound), referenceB->findIgnoringASCIICase(referenceA.get()));
+
+ // Find the prefix.
+ EXPECT_EQ(static_cast<size_t>(0), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("a").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA->findIgnoringASCIICase(stringFromUTF8("abcé").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("A").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA->findIgnoringASCIICase(stringFromUTF8("ABCé").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("a").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB->findIgnoringASCIICase(stringFromUTF8("abcÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("A").get()));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get()));
+
+ // Not a prefix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("x").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("accé").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("abcÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("X").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("ABDé").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("y").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("accÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("abcé").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("Y").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("ABdÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("ABCé").get()));
+
+ // Find the infix.
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("cée").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA->findIgnoringASCIICase(stringFromUTF8("ée").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("cé").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("c").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA->findIgnoringASCIICase(stringFromUTF8("é").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("Cée").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA->findIgnoringASCIICase(stringFromUTF8("éE").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("Cé").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA->findIgnoringASCIICase(stringFromUTF8("C").get()));
+
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("cÉe").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB->findIgnoringASCIICase(stringFromUTF8("Ée").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("cÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("c").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB->findIgnoringASCIICase(stringFromUTF8("É").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("CÉe").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB->findIgnoringASCIICase(stringFromUTF8("ÉE").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("CÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB->findIgnoringASCIICase(stringFromUTF8("C").get()));
+
+ // Not an infix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("céd").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("Ée").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("bé").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("x").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("É").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("CÉe").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("éd").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("CÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("Y").get()));
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("cée").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("Éc").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("cé").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("W").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("é").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("bÉe").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("éE").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("BÉ").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("z").get()));
+
+ // Find the suffix.
+ EXPECT_EQ(static_cast<size_t>(6), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("g").get()));
+ EXPECT_EQ(static_cast<size_t>(4), referenceA->findIgnoringASCIICase(stringFromUTF8("efg").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA->findIgnoringASCIICase(stringFromUTF8("éefg").get()));
+ EXPECT_EQ(static_cast<size_t>(6), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("G").get()));
+ EXPECT_EQ(static_cast<size_t>(4), referenceA->findIgnoringASCIICase(stringFromUTF8("EFG").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA->findIgnoringASCIICase(stringFromUTF8("éEFG").get()));
+
+ EXPECT_EQ(static_cast<size_t>(6), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("g").get()));
+ EXPECT_EQ(static_cast<size_t>(4), referenceB->findIgnoringASCIICase(stringFromUTF8("efg").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB->findIgnoringASCIICase(stringFromUTF8("Éefg").get()));
+ EXPECT_EQ(static_cast<size_t>(6), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("G").get()));
+ EXPECT_EQ(static_cast<size_t>(4), referenceB->findIgnoringASCIICase(stringFromUTF8("EFG").get()));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB->findIgnoringASCIICase(stringFromUTF8("ÉEFG").get()));
+
+ // Not a suffix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("X").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("edg").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("Éefg").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(StringImpl::createFromLiteral("w").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("dFG").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA->findIgnoringASCIICase(stringFromUTF8("ÉEFG").get()));
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("Z").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("ffg").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("éefg").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(StringImpl::createFromLiteral("r").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("EgG").get()));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB->findIgnoringASCIICase(stringFromUTF8("éEFG").get()));
+}
+
+TEST(WTF, StringImplFindIgnoringASCIICaseWithValidOffset)
+{
+ RefPtr<StringImpl> reference = stringFromUTF8("ABCÉEFGaBcéeFG");
+ EXPECT_EQ(static_cast<size_t>(0), reference->findIgnoringASCIICase(stringFromUTF8("ABC").get(), 0));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(stringFromUTF8("ABC").get(), 1));
+ EXPECT_EQ(static_cast<size_t>(0), reference->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get(), 0));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get(), 1));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(stringFromUTF8("ABCé").get(), 0));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(stringFromUTF8("ABCé").get(), 1));
+}
+
+TEST(WTF, StringImplFindIgnoringASCIICaseWithInvalidOffset)
+{
+ RefPtr<StringImpl> reference = stringFromUTF8("ABCÉEFGaBcéeFG");
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABC").get(), 15));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABC").get(), 16));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get(), 17));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get(), 42));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(stringFromUTF8("ABCÉ").get(), std::numeric_limits<unsigned>::max()));
+}
+
+TEST(WTF, StringImplFindIgnoringASCIICaseOnNull)
+{
+ RefPtr<StringImpl> reference = stringFromUTF8("ABCÉEFG");
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, 0));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, 3));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, 7));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, 8));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, 42));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(nullptr, std::numeric_limits<unsigned>::max()));
+}
+
+TEST(WTF, StringImplFindIgnoringASCIICaseOnEmpty)
+{
+ RefPtr<StringImpl> reference = stringFromUTF8("ABCÉEFG");
+ RefPtr<StringImpl> empty = StringImpl::create(reinterpret_cast<const LChar*>(""));
+ EXPECT_EQ(static_cast<size_t>(0), reference->findIgnoringASCIICase(empty.get()));
+ EXPECT_EQ(static_cast<size_t>(0), reference->findIgnoringASCIICase(empty.get(), 0));
+ EXPECT_EQ(static_cast<size_t>(3), reference->findIgnoringASCIICase(empty.get(), 3));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(empty.get(), 7));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(empty.get(), 8));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(empty.get(), 42));
+ EXPECT_EQ(static_cast<size_t>(7), reference->findIgnoringASCIICase(empty.get(), std::numeric_limits<unsigned>::max()));
+}
+
+TEST(WTF, StringImplFindIgnoringASCIICaseWithPatternLongerThanReference)
+{
+ RefPtr<StringImpl> reference = stringFromUTF8("ABCÉEFG");
+ RefPtr<StringImpl> pattern = stringFromUTF8("XABCÉEFG");
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference->findIgnoringASCIICase(pattern.get()));
+ EXPECT_EQ(static_cast<size_t>(1), pattern->findIgnoringASCIICase(reference.get()));
+}
+
</ins><span class="cx"> TEST(WTF, StringImplStartsWithIgnoringASCIICaseBasic)
</span><span class="cx"> {
</span><del>- RefPtr<StringImpl> reference = StringImpl::create(reinterpret_cast<const LChar*>("aBcéX"));
- RefPtr<StringImpl> referenceEquivalent = StringImpl::create(reinterpret_cast<const LChar*>("AbCéx"));
</del><ins>+ RefPtr<StringImpl> reference = stringFromUTF8("aBcéX");
+ RefPtr<StringImpl> referenceEquivalent = stringFromUTF8("AbCéx");
</ins><span class="cx">
</span><span class="cx"> // Identity.
</span><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(reference.get()));
</span><span class="lines">@@ -194,23 +363,23 @@
</span><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(abcUpper.get()));
</span><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(*abcUpper.get()));
</span><span class="cx">
</span><del>- RefPtr<StringImpl> abcAccentLower = StringImpl::create(reinterpret_cast<const LChar*>("abcé"));
</del><ins>+ RefPtr<StringImpl> abcAccentLower = stringFromUTF8("abcé");
</ins><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(abcAccentLower.get()));
</span><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(*abcAccentLower.get()));
</span><del>- RefPtr<StringImpl> abcAccentUpper = StringImpl::create(reinterpret_cast<const LChar*>("ABCé"));
</del><ins>+ RefPtr<StringImpl> abcAccentUpper = stringFromUTF8("ABCé");
</ins><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(abcAccentUpper.get()));
</span><span class="cx"> ASSERT_TRUE(reference->startsWithIgnoringASCIICase(*abcAccentUpper.get()));
</span><span class="cx">
</span><span class="cx"> // Negative cases.
</span><del>- RefPtr<StringImpl> differentFirstChar = StringImpl::create(reinterpret_cast<const LChar*>("bBcéX"));
- RefPtr<StringImpl> differentFirstCharProperPrefix = StringImpl::create(reinterpret_cast<const LChar*>("CBcé"));
</del><ins>+ RefPtr<StringImpl> differentFirstChar = stringFromUTF8("bBcéX");
+ RefPtr<StringImpl> differentFirstCharProperPrefix = stringFromUTF8("CBcé");
</ins><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(differentFirstChar.get()));
</span><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(*differentFirstChar.get()));
</span><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(differentFirstCharProperPrefix.get()));
</span><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(*differentFirstCharProperPrefix.get()));
</span><span class="cx">
</span><del>- RefPtr<StringImpl> uppercaseAccent = StringImpl::create(reinterpret_cast<const LChar*>("aBcÉX"));
- RefPtr<StringImpl> uppercaseAccentProperPrefix = StringImpl::create(reinterpret_cast<const LChar*>("aBcÉX"));
</del><ins>+ RefPtr<StringImpl> uppercaseAccent = stringFromUTF8("aBcÉX");
+ RefPtr<StringImpl> uppercaseAccentProperPrefix = stringFromUTF8("aBcÉX");
</ins><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(uppercaseAccent.get()));
</span><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(*uppercaseAccent.get()));
</span><span class="cx"> ASSERT_FALSE(reference->startsWithIgnoringASCIICase(uppercaseAccentProperPrefix.get()));
</span><span class="lines">@@ -240,8 +409,8 @@
</span><span class="cx">
</span><span class="cx"> TEST(WTF, StringImplEndsWithIgnoringASCIICaseBasic)
</span><span class="cx"> {
</span><del>- RefPtr<StringImpl> reference = StringImpl::create(reinterpret_cast<const LChar*>("XÉCbA"));
- RefPtr<StringImpl> referenceEquivalent = StringImpl::create(reinterpret_cast<const LChar*>("xÉcBa"));
</del><ins>+ RefPtr<StringImpl> reference = stringFromUTF8("XÉCbA");
+ RefPtr<StringImpl> referenceEquivalent = stringFromUTF8("xÉcBa");
</ins><span class="cx">
</span><span class="cx"> // Identity.
</span><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(reference.get()));
</span><span class="lines">@@ -268,23 +437,23 @@
</span><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(abcUpper.get()));
</span><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(*abcUpper.get()));
</span><span class="cx">
</span><del>- RefPtr<StringImpl> abcAccentLower = StringImpl::create(reinterpret_cast<const LChar*>("Écba"));
</del><ins>+ RefPtr<StringImpl> abcAccentLower = stringFromUTF8("Écba");
</ins><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(abcAccentLower.get()));
</span><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(*abcAccentLower.get()));
</span><del>- RefPtr<StringImpl> abcAccentUpper = StringImpl::create(reinterpret_cast<const LChar*>("ÉCBA"));
</del><ins>+ RefPtr<StringImpl> abcAccentUpper = stringFromUTF8("ÉCBA");
</ins><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(abcAccentUpper.get()));
</span><span class="cx"> ASSERT_TRUE(reference->endsWithIgnoringASCIICase(*abcAccentUpper.get()));
</span><span class="cx">
</span><span class="cx"> // Negative cases.
</span><del>- RefPtr<StringImpl> differentLastChar = StringImpl::create(reinterpret_cast<const LChar*>("XÉCbB"));
- RefPtr<StringImpl> differentLastCharProperSuffix = StringImpl::create(reinterpret_cast<const LChar*>("ÉCbb"));
</del><ins>+ RefPtr<StringImpl> differentLastChar = stringFromUTF8("XÉCbB");
+ RefPtr<StringImpl> differentLastCharProperSuffix = stringFromUTF8("ÉCbb");
</ins><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(differentLastChar.get()));
</span><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(*differentLastChar.get()));
</span><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(differentLastCharProperSuffix.get()));
</span><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(*differentLastCharProperSuffix.get()));
</span><span class="cx">
</span><del>- RefPtr<StringImpl> lowercaseAccent = StringImpl::create(reinterpret_cast<const LChar*>("aBcéX"));
- RefPtr<StringImpl> loweraseAccentProperSuffix = StringImpl::create(reinterpret_cast<const LChar*>("aBcéX"));
</del><ins>+ RefPtr<StringImpl> lowercaseAccent = stringFromUTF8("aBcéX");
+ RefPtr<StringImpl> loweraseAccentProperSuffix = stringFromUTF8("aBcéX");
</ins><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(lowercaseAccent.get()));
</span><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(*lowercaseAccent.get()));
</span><span class="cx"> ASSERT_FALSE(reference->endsWithIgnoringASCIICase(loweraseAccentProperSuffix.get()));
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFStringViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp (181844 => 181845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp        2015-03-23 05:02:29 UTC (rev 181844)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp        2015-03-23 05:04:46 UTC (rev 181845)
</span><span class="lines">@@ -226,6 +226,171 @@
</span><span class="cx"> return ref;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+TEST(WTF, StringViewFindIgnoringASCIICaseBasic)
+{
+ String referenceAHolder;
+ StringView referenceA = stringViewFromUTF8(referenceAHolder, "aBcéeFG");
+ String referenceBHolder;
+ StringView referenceB = stringViewFromUTF8(referenceBHolder, "ABCÉEFG");
+
+ // Search the exact string.
+ EXPECT_EQ(static_cast<size_t>(0), referenceA.findIgnoringASCIICase(referenceA));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB.findIgnoringASCIICase(referenceB));
+
+ // A and B are distinct by the non-ascii character é/É.
+ EXPECT_EQ(static_cast<size_t>(notFound), referenceA.findIgnoringASCIICase(referenceB));
+ EXPECT_EQ(static_cast<size_t>(notFound), referenceB.findIgnoringASCIICase(referenceA));
+
+ String tempStringHolder;
+ // Find the prefix.
+ EXPECT_EQ(static_cast<size_t>(0), referenceA.findIgnoringASCIICase(stringViewFromLiteral("a")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "abcé")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA.findIgnoringASCIICase(stringViewFromLiteral("A")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCé")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB.findIgnoringASCIICase(stringViewFromLiteral("a")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "abcÉ")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB.findIgnoringASCIICase(stringViewFromLiteral("A")));
+ EXPECT_EQ(static_cast<size_t>(0), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ")));
+
+ // Not a prefix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromLiteral("x")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "accé")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "abcÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromLiteral("X")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABDé")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromLiteral("y")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "accÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "abcé")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromLiteral("Y")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABdÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCé")));
+
+ // Find the infix.
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cée")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ée")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cé")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "c")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "é")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Cée")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éE")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Cé")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "C")));
+
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cÉe")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Ée")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cÉ")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "c")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "É")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "CÉe")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ÉE")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "CÉ")));
+ EXPECT_EQ(static_cast<size_t>(2), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "C")));
+
+ // Not an infix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "céd")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Ée")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "bé")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "x")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "É")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "CÉe")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éd")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "CÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Y")));
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cée")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Éc")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "cé")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "W")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "é")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "bÉe")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éE")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "BÉ")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "z")));
+
+ // Find the suffix.
+ EXPECT_EQ(static_cast<size_t>(6), referenceA.findIgnoringASCIICase(stringViewFromLiteral("g")));
+ EXPECT_EQ(static_cast<size_t>(4), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "efg")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éefg")));
+ EXPECT_EQ(static_cast<size_t>(6), referenceA.findIgnoringASCIICase(stringViewFromLiteral("G")));
+ EXPECT_EQ(static_cast<size_t>(4), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "EFG")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éEFG")));
+
+ EXPECT_EQ(static_cast<size_t>(6), referenceB.findIgnoringASCIICase(stringViewFromLiteral("g")));
+ EXPECT_EQ(static_cast<size_t>(4), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "efg")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Éefg")));
+ EXPECT_EQ(static_cast<size_t>(6), referenceB.findIgnoringASCIICase(stringViewFromLiteral("G")));
+ EXPECT_EQ(static_cast<size_t>(4), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "EFG")));
+ EXPECT_EQ(static_cast<size_t>(3), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ÉEFG")));
+
+ // Not a suffix.
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromLiteral("X")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "edg")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "Éefg")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromLiteral("w")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "dFG")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceA.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ÉEFG")));
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromLiteral("Z")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ffg")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éefg")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromLiteral("r")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "EgG")));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), referenceB.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "éEFG")));
+}
+
+TEST(WTF, StringViewFindIgnoringASCIICaseWithValidOffset)
+{
+ String referenceHolder;
+ StringView reference = stringViewFromUTF8(referenceHolder, "ABCÉEFGaBcéeFG");
+ String tempStringHolder;
+
+ EXPECT_EQ(static_cast<size_t>(0), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABC"), 0));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABC"), 1));
+ EXPECT_EQ(static_cast<size_t>(0), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ"), 0));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ"), 1));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCé"), 0));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCé"), 1));
+}
+
+TEST(WTF, StringViewFindIgnoringASCIICaseWithInvalidOffset)
+{
+ String referenceHolder;
+ StringView reference = stringViewFromUTF8(referenceHolder, "ABCÉEFGaBcéeFG");
+ String tempStringHolder;
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABC"), 15));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABC"), 16));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ"), 17));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ"), 42));
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(stringViewFromUTF8(tempStringHolder, "ABCÉ"), std::numeric_limits<unsigned>::max()));
+}
+
+TEST(WTF, StringViewFindIgnoringASCIICaseOnEmpty)
+{
+ String referenceHolder;
+ StringView reference = stringViewFromUTF8(referenceHolder, "ABCÉEFG");
+ StringView empty = stringViewFromLiteral("");
+ EXPECT_EQ(static_cast<size_t>(0), reference.findIgnoringASCIICase(empty));
+ EXPECT_EQ(static_cast<size_t>(0), reference.findIgnoringASCIICase(empty, 0));
+ EXPECT_EQ(static_cast<size_t>(3), reference.findIgnoringASCIICase(empty, 3));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(empty, 7));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(empty, 8));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(empty, 42));
+ EXPECT_EQ(static_cast<size_t>(7), reference.findIgnoringASCIICase(empty, std::numeric_limits<unsigned>::max()));
+}
+
+TEST(WTF, StringViewFindIgnoringASCIICaseWithPatternLongerThanReference)
+{
+ String referenceHolder;
+ StringView reference = stringViewFromUTF8(referenceHolder, "ABCÉEFG");
+ String patternHolder;
+ StringView pattern = stringViewFromUTF8(referenceHolder, "ABCÉEFGA");
+
+ EXPECT_EQ(static_cast<size_t>(WTF::notFound), reference.findIgnoringASCIICase(pattern));
+ EXPECT_EQ(static_cast<size_t>(0), pattern.findIgnoringASCIICase(reference));
+}
+
</ins><span class="cx"> TEST(WTF, StringViewStartsWithBasic)
</span><span class="cx"> {
</span><span class="cx"> StringView reference = stringViewFromLiteral("abcdefg");
</span></span></pre>
</div>
</div>
</body>
</html>