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 <barraclough at apple.com>
+
+ String.localeCompare should normalize input
+ https://bugs.webkit.org/show_bug.cgi?id=3D97639
+
+ Reviewed by Filip Pizlo.
+
+ From the spec: "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."
+
+ * 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 <raphael.=
kubo.da.costa at intel.com>
</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("This test checks String.localeCompare().&q=
uot;);
+
+shouldBeTrue('"a".localeCompare("aa") < 0');
+shouldBeTrue('"a".localeCompare("b") < 0');
+
+shouldBeTrue('"a".localeCompare("a") =3D=3D=3D 0');
+shouldBeTrue('"a\u0308\u0323".localeCompare("a\u0323\u030=
8") =3D=3D=3D 0');
+
+shouldBeTrue('"aa".localeCompare("a") > 0');
+shouldBeTrue('"b".localeCompare("a") > 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 "PASS" messages, followed=
by "TEST COMPLETE".
+
+
+PASS "a".localeCompare("aa") < 0 is true
+PASS "a".localeCompare("b") < 0 is true
+PASS "a".localeCompare("a") =3D=3D=3D 0 is true
+PASS "a=CC=88=CC=A3".localeCompare("a=CC=A3=CC=88") =
=3D=3D=3D 0 is true
+PASS "aa".localeCompare("a") > 0 is true
+PASS "b".localeCompare("a") > 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>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"&g=
t;
+<html>
+<head>
+<script src=3D"resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src=3D"script-tests/string-localeCompare.js"><=
;/script>
+<script src=3D"resources/js-test-post.js"></script>=
;
+</body>
+</html>
</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 <barraclough at apple.com>
+
+ String.localeCompare should normalize input
+ https://bugs.webkit.org/show_bug.cgi?id=3D97639
+
+ Reviewed by Filip Pizlo.
+
+ From the spec: "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."
+
+ * wtf/unicode/icu/CollatorICU.cpp:
+ (WTF::Collator::createCollator):
+ - Enable normalization.
+
</ins><span class=3D"cx"> 2012-09-25 Cosmin Truta <ctruta at rim.com>=
;
</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, &status);
</span><span class=3D"cx"> ASSERT(U_SUCCESS(status));
</span><ins>+
+ ucol_setAttribute(m_collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &=
;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