[iOS] languageSpecificFallbackFont() is not consistent
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jul 2014 00:14:38 +0000 (00:14 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jul 2014 00:14:38 +0000 (00:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134473

Reviewed by Darin Adler.

It can use "<" throughout the function as well as keeping the fallthrough behavior consistent.

No tests because there is no behavior change.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::languageSpecificFallbackFont):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170618 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

index 6e1df60f90cee2c3e8cc604d09ae7c7be9eccf30..090231609045fbdc8330fe330d303f1411d6d037 100644 (file)
@@ -1,3 +1,17 @@
+2014-06-30  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [iOS] languageSpecificFallbackFont() is not consistent
+        https://bugs.webkit.org/show_bug.cgi?id=134473
+
+        Reviewed by Darin Adler.
+
+        It can use "<" throughout the function as well as keeping the fallthrough behavior consistent.
+
+        No tests because there is no behavior change.
+
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::languageSpecificFallbackFont):
+
 2014-06-30  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Unreviewed gardening.
 2014-06-30  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Unreviewed gardening.
index 01177f0f8beacf1fe2635516941c07d70c49f66a..44d9d369638a7d1627c281474d96d0fe372fa839 100644 (file)
@@ -129,29 +129,31 @@ static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
 
     if (c < 0x400)
         return LanguageSpecificFont::None;
 
     if (c < 0x400)
         return LanguageSpecificFont::None;
-    if (c <= 0x52F)
+    if (c < 0x530)
         return LanguageSpecificFont::Cyrillic;
     if (c < 0x590)
         return LanguageSpecificFont::None;
     if (c < 0x600)
         return LanguageSpecificFont::Hebrew;
         return LanguageSpecificFont::Cyrillic;
     if (c < 0x590)
         return LanguageSpecificFont::None;
     if (c < 0x600)
         return LanguageSpecificFont::Hebrew;
-    if (c <= 0x6FF)
+    if (c < 0x700)
         return LanguageSpecificFont::Arabic;
     if (c < 0x900)
         return LanguageSpecificFont::None;
     if (c < 0xE00)
         return LanguageSpecificFont::Arabic;
         return LanguageSpecificFont::Arabic;
     if (c < 0x900)
         return LanguageSpecificFont::None;
     if (c < 0xE00)
         return LanguageSpecificFont::Arabic;
-    if (c <= 0xE7F)
+    if (c < 0xE80)
         return LanguageSpecificFont::Thai;
     if (c < 0x0F00)
         return LanguageSpecificFont::Lao;
         return LanguageSpecificFont::Thai;
     if (c < 0x0F00)
         return LanguageSpecificFont::Lao;
-    if (c <= 0x0FFF)
+    if (c < 0x1000)
         return LanguageSpecificFont::Tibetan;
     if (c < 0x1100)
         return LanguageSpecificFont::None;
         return LanguageSpecificFont::Tibetan;
     if (c < 0x1100)
         return LanguageSpecificFont::None;
-    if (c <= 0x11FF)
+    if (c < 0x1200)
         return LanguageSpecificFont::Korean;
         return LanguageSpecificFont::Korean;
-    if (c > 0x1400 && c < 0x1780)
+    if (c < 0x1401)
+        return LanguageSpecificFont::Khmer; // FIXME: These codepoints don't belong to Khmer
+    if (c < 0x1780)
         return LanguageSpecificFont::CanadianAboriginalSyllabic;
     if (c < 0x1800)
         return LanguageSpecificFont::Khmer;
         return LanguageSpecificFont::CanadianAboriginalSyllabic;
     if (c < 0x1800)
         return LanguageSpecificFont::Khmer;
@@ -159,27 +161,25 @@ static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
         return LanguageSpecificFont::None;
     if (c < 0x3130)
         return LanguageSpecificFont::ChineseJapanese;
         return LanguageSpecificFont::None;
     if (c < 0x3130)
         return LanguageSpecificFont::ChineseJapanese;
-    if (c <= 0x318F)
+    if (c < 0x3190)
         return LanguageSpecificFont::Korean;
     if (c < 0xAC00)
         return LanguageSpecificFont::ChineseJapanese;
         return LanguageSpecificFont::Korean;
     if (c < 0xAC00)
         return LanguageSpecificFont::ChineseJapanese;
-    if (c <= 0xD7A3)
+    if (c < 0xD7A4)
         return LanguageSpecificFont::Korean;
         return LanguageSpecificFont::Korean;
-    if (c <= 0xDFFF)
-        return LanguageSpecificFont::ChineseJapanese;
     if (c < 0xE000)
     if (c < 0xE000)
-        return LanguageSpecificFont::None;
+        return LanguageSpecificFont::ChineseJapanese;
     if (c < 0xE600)
         return isGB18030ComplianceRequired ? LanguageSpecificFont::ChineseJapanese : LanguageSpecificFont::Emoji;
     if (c < 0xE600)
         return isGB18030ComplianceRequired ? LanguageSpecificFont::ChineseJapanese : LanguageSpecificFont::Emoji;
-    if (c <= 0xE864 && isGB18030ComplianceRequired)
+    if (c < 0xE865 && isGB18030ComplianceRequired)
         return LanguageSpecificFont::ChineseJapanese;
         return LanguageSpecificFont::ChineseJapanese;
-    if (c <= 0xF8FF)
+    if (c < 0xF900)
         return LanguageSpecificFont::None;
     if (c < 0xFB00)
         return LanguageSpecificFont::ChineseJapanese;
     if (c < 0xFB50)
         return LanguageSpecificFont::None;
         return LanguageSpecificFont::None;
     if (c < 0xFB00)
         return LanguageSpecificFont::ChineseJapanese;
     if (c < 0xFB50)
         return LanguageSpecificFont::None;
-    if (c <= 0xFDFF)
+    if (c < 0xFE00)
         return LanguageSpecificFont::Arabic;
     if (c < 0xFE20)
         return LanguageSpecificFont::None;
         return LanguageSpecificFont::Arabic;
     if (c < 0xFE20)
         return LanguageSpecificFont::None;
@@ -189,7 +189,9 @@ static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
         return LanguageSpecificFont::Arabic;
     if (c < 0xFFF0)
         return LanguageSpecificFont::ChineseJapanese;
         return LanguageSpecificFont::Arabic;
     if (c < 0xFFF0)
         return LanguageSpecificFont::ChineseJapanese;
-    if (c >=0x20000 && c <= 0x2FFFF)
+    if (c < 0x20000)
+        return LanguageSpecificFont::None;
+    if (c < 0x30000)
         return LanguageSpecificFont::ChineseJapanese;
     return LanguageSpecificFont::None;
 }
         return LanguageSpecificFont::ChineseJapanese;
     return LanguageSpecificFont::None;
 }