No subject


Wed Aug 1 07:28:53 PDT 2012


Strings that are
canonically equivalent according to the Unicode standard as identical (in=
 other words,
compare the Strings as if they had both been converted to Normalised Form=
 C or D first).
It is also recommended that this function not honour Unicode compatibilit=
y equivalences
or decompositions."

Source/WTF:=20

* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::createCollator):
    - Enable normalization.

LayoutTests:=20

* fast/js/script-tests/string-localeCompare.js: Added.
* fast/js/string-localeCompare-expected.txt: Added.
* fast/js/string-localeCompare.html: Added.
    - Add lests for localeCompare.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></=
li>
<li><a href=3D"#trunkSourceWTFwtfunicodeicuCollatorICUcpp">trunk/Source/W=
TF/wtf/unicode/icu/CollatorICU.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsfastjsscripttestsstringlocaleComparejs">t=
runk/LayoutTests/fast/js/script-tests/string-localeCompare.js</a></li>
<li><a href=3D"#trunkLayoutTestsfastjsstringlocaleCompareexpectedtxt">tru=
nk/LayoutTests/fast/js/string-localeCompare-expected.txt</a></li>
<li><a href=3D"#trunkLayoutTestsfastjsstringlocaleComparehtml">trunk/Layo=
utTests/fast/js/string-localeCompare.html</a></li>
</ul>

</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkLayoutTestsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (129600 =
=3D> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog	2012-09-26 07:18:16 =
UTC (rev 129600)
+++ trunk/LayoutTests/ChangeLog	2012-09-26 07:20:47 UTC (rev 129601)
</span><span class=3D"lines">@@ -1,3 +1,21 @@
</span><ins>+2012-09-26  Gavin Barraclough  &lt;barraclough at apple.com&gt;
+
+        String.localeCompare should normalize input
+        https://bugs.webkit.org/show_bug.cgi?id=3D97639
+
+        Reviewed by Filip Pizlo.
+
+        From the spec: &quot;It is strongly recommended that this functi=
on treat Strings that are
+        canonically equivalent according to the Unicode standard as iden=
tical (in other words,
+        compare the Strings as if they had both been converted to Normal=
ised Form C or D first).
+        It is also recommended that this function not honour Unicode com=
patibility equivalences
+        or decompositions.&quot;
+
+        * fast/js/script-tests/string-localeCompare.js: Added.
+        * fast/js/string-localeCompare-expected.txt: Added.
+        * fast/js/string-localeCompare.html: Added.
+            - Add lests for localeCompare.
+
</ins><span class=3D"cx"> 2012-09-26  Raphael Kubo da Costa  &lt;raphael.=
kubo.da.costa at intel.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         [EFL] Unskip passing test after r12959=
2.
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastjsscripttestsstringlocaleComparejs"></a>
<div class=3D"addfile"><h4>Added: trunk/LayoutTests/fast/js/script-tests/=
string-localeCompare.js (0 =3D> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/js/script-tests/string-lo=
caleCompare.js	                        (rev 0)
+++ trunk/LayoutTests/fast/js/script-tests/string-localeCompare.js	2012-0=
9-26 07:20:47 UTC (rev 129601)
</span><span class=3D"lines">@@ -0,0 +1,10 @@
</span><ins>+description(&quot;This test checks String.localeCompare().&q=
uot;);
+
+shouldBeTrue('&quot;a&quot;.localeCompare(&quot;aa&quot;) &lt; 0');
+shouldBeTrue('&quot;a&quot;.localeCompare(&quot;b&quot;) &lt; 0');
+
+shouldBeTrue('&quot;a&quot;.localeCompare(&quot;a&quot;) =3D=3D=3D 0');
+shouldBeTrue('&quot;a\u0308\u0323&quot;.localeCompare(&quot;a\u0323\u030=
8&quot;) =3D=3D=3D 0');
+
+shouldBeTrue('&quot;aa&quot;.localeCompare(&quot;a&quot;) &gt; 0');
+shouldBeTrue('&quot;b&quot;.localeCompare(&quot;a&quot;) &gt; 0');
</ins></span></pre></div>
<a id=3D"trunkLayoutTestsfastjsstringlocaleCompareexpectedtxt"></a>
<div class=3D"addfile"><h4>Added: trunk/LayoutTests/fast/js/string-locale=
Compare-expected.txt (0 =3D> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/js/string-localeCompare-e=
xpected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/js/string-localeCompare-expected.txt	2012-09-2=
6 07:20:47 UTC (rev 129601)
</span><span class=3D"lines">@@ -0,0 +1,15 @@
</span><ins>+This test checks String.localeCompare().
+
+On success, you will see a series of &quot;PASS&quot; messages, followed=
 by &quot;TEST COMPLETE&quot;.
+
+
+PASS &quot;a&quot;.localeCompare(&quot;aa&quot;) &lt; 0 is true
+PASS &quot;a&quot;.localeCompare(&quot;b&quot;) &lt; 0 is true
+PASS &quot;a&quot;.localeCompare(&quot;a&quot;) =3D=3D=3D 0 is true
+PASS &quot;a=CC=88=CC=A3&quot;.localeCompare(&quot;a=CC=A3=CC=88&quot;) =
=3D=3D=3D 0 is true
+PASS &quot;aa&quot;.localeCompare(&quot;a&quot;) &gt; 0 is true
+PASS &quot;b&quot;.localeCompare(&quot;a&quot;) &gt; 0 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id=3D"trunkLayoutTestsfastjsstringlocaleComparehtml"></a>
<div class=3D"addfile"><h4>Added: trunk/LayoutTests/fast/js/string-locale=
Compare.html (0 =3D> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/js/string-localeCompare.h=
tml	                        (rev 0)
+++ trunk/LayoutTests/fast/js/string-localeCompare.html	2012-09-26 07:20:=
47 UTC (rev 129601)
</span><span class=3D"lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&g=
t;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=3D&quot;resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=3D&quot;script-tests/string-localeCompare.js&quot;&gt;&lt=
;/script&gt;
+&lt;script src=3D&quot;resources/js-test-post.js&quot;&gt;&lt;/script&gt=
;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id=3D"trunkSourceWTFChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (129600 =3D=
> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WTF/ChangeLog	2012-09-26 07:18:16 U=
TC (rev 129600)
+++ trunk/Source/WTF/ChangeLog	2012-09-26 07:20:47 UTC (rev 129601)
</span><span class=3D"lines">@@ -1,3 +1,20 @@
</span><ins>+2012-09-26  Gavin Barraclough  &lt;barraclough at apple.com&gt;
+
+        String.localeCompare should normalize input
+        https://bugs.webkit.org/show_bug.cgi?id=3D97639
+
+        Reviewed by Filip Pizlo.
+
+        From the spec: &quot;It is strongly recommended that this functi=
on treat Strings that are
+        canonically equivalent according to the Unicode standard as iden=
tical (in other words,
+        compare the Strings as if they had both been converted to Normal=
ised Form C or D first).
+        It is also recommended that this function not honour Unicode com=
patibility equivalences
+        or decompositions.&quot;
+
+        * wtf/unicode/icu/CollatorICU.cpp:
+        (WTF::Collator::createCollator):
+            - Enable normalization.
+
</ins><span class=3D"cx"> 2012-09-25  Cosmin Truta  &lt;ctruta at rim.com&gt=
;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         [BlackBerry] Enable LLInt
</span></span></pre></div>
<a id=3D"trunkSourceWTFwtfunicodeicuCollatorICUcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WTF/wtf/unicode/icu/Col=
latorICU.cpp (129600 =3D> 129601)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp=
	2012-09-26 07:18:16 UTC (rev 129600)
+++ trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp	2012-09-26 07:20:47 =
UTC (rev 129601)
</span><span class=3D"lines">@@ -132,6 +132,9 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx">     ucol_setAttribute(m_collator, UCOL_CASE_FI=
RST, m_lowerFirst ? UCOL_LOWER_FIRST : UCOL_UPPER_FIRST, &amp;status);
</span><span class=3D"cx">     ASSERT(U_SUCCESS(status));
</span><ins>+
+    ucol_setAttribute(m_collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &amp=
;status);
+    ASSERT(U_SUCCESS(status));
</ins><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void Collator::releaseCollator()
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list