Disable the check for mixed Simplified and Traditional Chinese characters when determining whether to display IDN labels as unicode or punycode. Bug 857481, r=honzab
authorSimon Montagu <smontagu@smontagu.org>
Mon, 08 Apr 2013 01:36:52 -0700
changeset 127964 2089d4146c21eaf48bb92a4d50f3609d1ce341e5
parent 127963 a66e4f7da75f9b165b58b38df5028afe36081116
child 127965 09170e15685a8f3d4e42c2345f76a132d31a6b4d
push id24518
push userryanvm@gmail.com
push dateTue, 09 Apr 2013 00:01:18 +0000
treeherdermozilla-central@a7ec1554d481 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab
bugs857481
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Disable the check for mixed Simplified and Traditional Chinese characters when determining whether to display IDN labels as unicode or punycode. Bug 857481, r=honzab
netwerk/dns/nsIDNService.cpp
netwerk/test/unit/test_bug722299.js
--- a/netwerk/dns/nsIDNService.cpp
+++ b/netwerk/dns/nsIDNService.cpp
@@ -747,17 +747,20 @@ bool nsIDNService::isLabelSafe(const nsA
 
   nsAString::const_iterator current, end;
   label.BeginReading(current);
   label.EndReading(end);
 
   int32_t lastScript = MOZ_SCRIPT_INVALID;
   uint32_t previousChar = 0;
   uint32_t savedNumberingSystem = 0;
+// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
+#if 0
   HanVariantType savedHanVariant = HVT_NotHan;
+#endif
 
   int32_t savedScript = -1;
 
   while (current != end) {
     uint32_t ch = *current++;
 
     if (NS_IS_HIGH_SURROGATE(ch) && current != end &&
         NS_IS_LOW_SURROGATE(*current)) {
@@ -802,25 +805,29 @@ bool nsIDNService::isLabelSafe(const nsA
 
     // Check for consecutive non-spacing marks
     if (previousChar != 0 &&
         previousChar == ch &&
         GetGeneralCategory(ch) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) {
       return false;
     }
 
+    // Simplified/Traditional Chinese check temporarily disabled -- bug 857481
+#if 0
+
     // Check for both simplified-only and traditional-only Chinese characters
     HanVariantType hanVariant = GetHanVariant(ch);
     if (hanVariant == HVT_SimplifiedOnly || hanVariant == HVT_TraditionalOnly) {
       if (savedHanVariant == HVT_NotHan) {
         savedHanVariant = hanVariant;
       } else if (hanVariant != savedHanVariant)  {
         return false;
       }
     }
+#endif
 
     previousChar = ch;
   }
   return true;
 }
 
 // Scripts that we care about in illegalScriptCombo
 static const int32_t scriptTable[] = {
--- a/netwerk/test/unit/test_bug722299.js
+++ b/netwerk/test/unit/test_bug722299.js
@@ -167,20 +167,20 @@ const testcases = [
 
     // Traditional Chinese
     ["萬城",     "xn--uis754h",                      false, true,  true],
 
     // Simplified Chinese
     ["万城",     "xn--chq31v",                       false, true,  true],
 
     // Simplified-only and Traditional-only Chinese in the same label
-    ["万萬城",   "xn--chq31vsl1b",                   false, false, false],
+    ["万萬城",   "xn--chq31vsl1b",                   false, true,  true],
 
     // Traditional-only and Simplified-only Chinese in the same label
-    ["萬万城",   "xn--chq31vrl1b",                   false, false, false],
+    ["萬万城",   "xn--chq31vrl1b",                   false, true,  true],
 
     // Han and Latin and Bopomofo
     ["注音符号bopomofoㄅㄆㄇㄈ",
                  "xn--bopomofo-hj5gkalm1637i876cuw0brk5f",
                                                      false, true,  true],
 
     // Han, bopomofo, Latin
     ["注音符号ㄅㄆㄇㄈbopomofo",