[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 18:42:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c5136218ea1bc4f1428e36fe8552bebf6c33ff1d
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 16 00:55:23 2010 +0000

    2010-12-15  Yong Li  <yoli at rim.com>
    
            Reviewed by Darin Adler.
    
            https://bugs.webkit.org/show_bug.cgi?id=51035
            Add tests for UTF-16 BE/LE and their variants.
            Also, check the full decoded text but not only the first one.
    
            * fast/encoding/char-decoding.html:
            * fast/encoding/char-decoding-expected.txt:
            * fast/encoding/resources/char-decoding-utils.js:
    2010-12-15  Yong Li  <yoli at rim.com>
    
            Reviewed by Darin Adler.
    
            UTF-16 and its variants should be treated as Big Endian when BOM
            is absent.
            https://bugs.webkit.org/show_bug.cgi?id=51035
    
            Test: fast/encoding/char-decoding.html (changed)
    
            * platform/text/TextCodecUTF16.cpp:
            (WebCore::TextCodecUTF16::registerEncodingNames):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a7988e2..1cd410f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-15  Yong Li  <yoli at rim.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=51035
+        Add tests for UTF-16 BE/LE and their variants.
+        Also, check the full decoded text but not only the first one.
+
+        * fast/encoding/char-decoding.html:
+        * fast/encoding/char-decoding-expected.txt:
+        * fast/encoding/resources/char-decoding-utils.js:
+
 2010-12-15  Mihai Parparita  <mihaip at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/encoding/char-decoding-expected.txt b/LayoutTests/fast/encoding/char-decoding-expected.txt
index 26afe48..372b179 100644
--- a/LayoutTests/fast/encoding/char-decoding-expected.txt
+++ b/LayoutTests/fast/encoding/char-decoding-expected.txt
@@ -155,8 +155,17 @@ PASS decode('dos-874', '%96') is 'U+2013'
 PASS decode('dos-874', '%A0') is 'U+00A0'
 PASS decode('dos-874', '%A1') is 'U+0E01'
 PASS decode('dos-874', '%DB') is 'U+F8C1'
-PASS decode('UTF-7', '+AD4') is 'U+002B'
-PASS decode('utf-7', '+AD4') is 'U+002B'
+PASS decode('UTF-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('utf-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('UTF-16BE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('UTF-16', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('ISO-10646-UCS-2', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('UCS-2', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('Unicode', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('csUnicode', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('unicodeFFFE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('UTF-16LE', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('unicodeFEFF', '%69%D8%D6%DE') is 'U+D869/U+DED6'
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/encoding/char-decoding.html b/LayoutTests/fast/encoding/char-decoding.html
index b913389..5c71f8b 100644
--- a/LayoutTests/fast/encoding/char-decoding.html
+++ b/LayoutTests/fast/encoding/char-decoding.html
@@ -89,9 +89,20 @@ batchTestDecode(thai);
 
 // UTF-7 is expressly forbidden, so decoding it should not work correctly.
 // This attempts to decode '<' as UTF-7 (+AD4) but it ends up being decoded
-// as a '+'.
-testDecode('UTF-7', '+AD4', 'U+002B');
-testDecode('utf-7', '+AD4', 'U+002B');
+// as a '+AD4'.
+testDecode('UTF-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+testDecode('utf-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+
+// UTF-16 and variants.
+testDecode('UTF-16BE', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('UTF-16', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('ISO-10646-UCS-2', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('UCS-2', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('Unicode', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('csUnicode', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('unicodeFFFE', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('UTF-16LE', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('unicodeFEFF', '%69%D8%D6%DE', 'U+D869/U+DED6');
 
 successfullyParsed = true;
 
diff --git a/LayoutTests/fast/encoding/resources/char-decoding-utils.js b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
index a091ad8..07d2e60 100644
--- a/LayoutTests/fast/encoding/resources/char-decoding-utils.js
+++ b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
@@ -9,14 +9,26 @@ function hex(number)
     return hex;
 }
 
-function decode(charsetName, characterSequence)
+function decodeText(charsetName, characterSequence)
 {
     var req = new XMLHttpRequest;
     req.open('GET', 'data:text/plain,' + characterSequence, false);
     req.overrideMimeType('text/plain; charset="' + charsetName + '"');
     req.send('');
-    var code = hex(req.responseText.charCodeAt(0));
-    return "U+" + ("0000" + code).substr(code.length, 4);
+    return req.responseText;
+}
+
+function decode(charsetName, characterSequence)
+{
+    var decodedText = decodeText(charsetName, characterSequence);
+    var result = "";
+    for (var i = 0; i < decodedText.length; ++i) {
+        var code = hex(decodedText.charCodeAt(i));
+        if (i)
+            result += "/";
+        result += "U+" + ("0000" + code).substr(code.length, 4);
+    }
+    return result;
 }
 
 function testDecode(charsetName, characterSequence, unicode)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 18ac320..6016df5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-15  Yong Li  <yoli at rim.com>
+
+        Reviewed by Darin Adler.
+
+        UTF-16 and its variants should be treated as Big Endian when BOM
+        is absent.
+        https://bugs.webkit.org/show_bug.cgi?id=51035
+
+        Test: fast/encoding/char-decoding.html (changed)
+
+        * platform/text/TextCodecUTF16.cpp:
+        (WebCore::TextCodecUTF16::registerEncodingNames):
+
 2010-12-15  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Chris Marrin.
diff --git a/WebCore/platform/text/TextCodecUTF16.cpp b/WebCore/platform/text/TextCodecUTF16.cpp
index e88e83b..4326e5a 100644
--- a/WebCore/platform/text/TextCodecUTF16.cpp
+++ b/WebCore/platform/text/TextCodecUTF16.cpp
@@ -40,13 +40,13 @@ void TextCodecUTF16::registerEncodingNames(EncodingNameRegistrar registrar)
     registrar("UTF-16LE", "UTF-16LE");
     registrar("UTF-16BE", "UTF-16BE");
 
-    registrar("ISO-10646-UCS-2", "UTF-16LE");
-    registrar("UCS-2", "UTF-16LE");
-    registrar("UTF-16", "UTF-16LE");
-    registrar("Unicode", "UTF-16LE");
-    registrar("csUnicode", "UTF-16LE");
-    registrar("unicodeFEFF", "UTF-16LE");
+    registrar("ISO-10646-UCS-2", "UTF-16BE");
+    registrar("UCS-2", "UTF-16BE");
+    registrar("UTF-16", "UTF-16BE");
+    registrar("Unicode", "UTF-16BE");
+    registrar("csUnicode", "UTF-16BE");
 
+    registrar("unicodeFEFF", "UTF-16LE");
     registrar("unicodeFFFE", "UTF-16BE");
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list