Diff
Modified: trunk/Source/WTF/ChangeLog (201981 => 201982)
--- trunk/Source/WTF/ChangeLog 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Source/WTF/ChangeLog 2016-06-12 01:14:58 UTC (rev 201982)
@@ -1,5 +1,17 @@
2016-06-11 Myles C. Maxfield <[email protected]>
+ Addressing post-review comments after r201978.
+ https://bugs.webkit.org/show_bug.cgi?id=158649
+ <rdar://problem/13258122>
+
+ Unreviewed.
+
+ * wtf/text/StringCommon.h:
+ (WTF::equal):
+ (WTF::naiveEqualWithoutPerformingUnicodeNormalization): Deleted.
+
+2016-06-11 Myles C. Maxfield <[email protected]>
+
[Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
https://bugs.webkit.org/show_bug.cgi?id=158649
<rdar://problem/13258122>
Modified: trunk/Source/WTF/wtf/text/StringCommon.h (201981 => 201982)
--- trunk/Source/WTF/wtf/text/StringCommon.h 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Source/WTF/wtf/text/StringCommon.h 2016-06-12 01:14:58 UTC (rev 201982)
@@ -323,15 +323,15 @@
return equal(*a, *b);
}
-template<typename StringClass, unsigned length> bool naiveEqualWithoutPerformingUnicodeNormalization(const StringClass& a, const UChar (&codepoints)[length])
+template<typename StringClass, unsigned length> bool equal(const StringClass& a, const UChar (&codeUnits)[length])
{
if (a.length() != length)
return false;
if (a.is8Bit())
- return equal(a.characters8(), codepoints, length);
+ return equal(a.characters8(), codeUnits, length);
- return equal(a.characters16(), codepoints, length);
+ return equal(a.characters16(), codeUnits, length);
}
template<typename CharacterTypeA, typename CharacterTypeB>
Modified: trunk/Source/WebCore/ChangeLog (201981 => 201982)
--- trunk/Source/WebCore/ChangeLog 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Source/WebCore/ChangeLog 2016-06-12 01:14:58 UTC (rev 201982)
@@ -1,3 +1,16 @@
+2016-06-11 Myles C. Maxfield <[email protected]>
+
+ Addressing post-review comments after r201978.
+ https://bugs.webkit.org/show_bug.cgi?id=158649
+ <rdar://problem/13258122>
+
+ Unreviewed.
+
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontCache::alternateFamilyName):
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::FontCache::platformAlternateFamilyName):
+
2016-06-11 Darin Adler <[email protected]>
Tighten code to build set of tag names
Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (201981 => 201982)
--- trunk/Source/WebCore/platform/graphics/FontCache.cpp 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp 2016-06-12 01:14:58 UTC (rev 201982)
@@ -161,12 +161,12 @@
const AtomicString& FontCache::alternateFamilyName(const AtomicString& familyName)
{
- static NeverDestroyed<AtomicString> helvetica("Helvetica", AtomicString::ConstructFromLiteral);
- static NeverDestroyed<AtomicString> timesNewRoman("Times New Roman", AtomicString::ConstructFromLiteral);
- static NeverDestroyed<AtomicString> courierNew("Courier New", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> arial("Arial", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> courier("Courier", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> courierNew("Courier New", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> helvetica("Helvetica", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> times("Times", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> timesNewRoman("Times New Roman", AtomicString::ConstructFromLiteral);
const AtomicString& platformSpecificAlternate = platformAlternateFamilyName(familyName);
if (!platformSpecificAlternate.isNull())
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (201981 => 201982)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2016-06-12 01:14:58 UTC (rev 201982)
@@ -798,41 +798,41 @@
const AtomicString& FontCache::platformAlternateFamilyName(const AtomicString& familyName)
{
+ static const UChar heitiString[] = { 0x9ed1, 0x4f53 };
static const UChar songtiString[] = { 0x5b8b, 0x4f53 };
+ static const UChar weiruanXinXiMingTi[] = { 0x5fae, 0x8edf, 0x65b0, 0x7d30, 0x660e, 0x9ad4 };
static const UChar weiruanYaHeiString[] = { 0x5fae, 0x8f6f, 0x96c5, 0x9ed1 };
- static const UChar heitiString[] = { 0x9ed1, 0x4f53 };
static const UChar weiruanZhengHeitiString[] = { 0x5fae, 0x8edf, 0x6b63, 0x9ed1, 0x9ad4 };
- static const UChar weiruanXinXiMingTi[] = { 0x5fae, 0x8edf, 0x65b0, 0x7d30, 0x660e, 0x9ad4 };
static NeverDestroyed<AtomicString> songtiSC("Songti SC", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> songtiTC("Songti TC", AtomicString::ConstructFromLiteral);
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) || PLATFORM(IOS)
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101100
+ static NeverDestroyed<AtomicString> heitiSCReplacement("Heiti SC", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> heitiTCReplacement("Heiti TC", AtomicString::ConstructFromLiteral);
+#else
static NeverDestroyed<AtomicString> heitiSCReplacement("PingFang SC", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> heitiTCReplacement("PingFang TC", AtomicString::ConstructFromLiteral);
-#else
- static NeverDestroyed<AtomicString> heitiSCReplacement("Heiti SC", AtomicString::ConstructFromLiteral);
- static NeverDestroyed<AtomicString> heitiTCReplacement("Heiti TC", AtomicString::ConstructFromLiteral);
#endif
switch (familyName.length()) {
case 2:
- if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, songtiString))
+ if (equal(familyName, songtiString))
return songtiSC;
- if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, heitiString))
+ if (equal(familyName, heitiString))
return heitiSCReplacement;
break;
case 4:
- if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanYaHeiString))
+ if (equal(familyName, weiruanYaHeiString))
return heitiSCReplacement;
break;
case 5:
- if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanZhengHeitiString))
+ if (equal(familyName, weiruanZhengHeitiString))
return heitiTCReplacement;
break;
case 6:
if (equalLettersIgnoringASCIICase(familyName, "simsun"))
return songtiSC;
- if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanXinXiMingTi))
+ if (equal(familyName, weiruanXinXiMingTi))
return songtiTC;
break;
case 10:
Modified: trunk/Tools/ChangeLog (201981 => 201982)
--- trunk/Tools/ChangeLog 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Tools/ChangeLog 2016-06-12 01:14:58 UTC (rev 201982)
@@ -1,3 +1,14 @@
+2016-06-11 Myles C. Maxfield <[email protected]>
+
+ Addressing post-review comments after r201978.
+ https://bugs.webkit.org/show_bug.cgi?id=158649
+ <rdar://problem/13258122>
+
+ Unreviewed.
+
+ * TestWebKitAPI/Tests/WTF/WTFString.cpp:
+ (TestWebKitAPI::TEST):
+
2016-06-11 Alexey Proskuryakov <[email protected]>
Unreviewed leak fix after r201863.
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (201981 => 201982)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp 2016-06-11 23:44:50 UTC (rev 201981)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp 2016-06-12 01:14:58 UTC (rev 201982)
@@ -292,7 +292,7 @@
ASSERT_EQ(string2.existingHash(), 0u);
}
-TEST(WTF, StringNaiveUnicodeEqual)
+TEST(WTF, StringUnicodeEqualUCharArray)
{
String string1("abc");
ASSERT_FALSE(string1.isNull());
@@ -301,16 +301,16 @@
UChar abc[] = { 'a', 'b', 'c' };
UChar abcd[] = { 'a', 'b', 'c', 'd' };
UChar aBc[] = { 'a', 'B', 'c' };
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, ab));
- ASSERT_TRUE(naiveEqualWithoutPerformingUnicodeNormalization(string1, abc));
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, abcd));
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, aBc));
+ ASSERT_FALSE(equal(string1, ab));
+ ASSERT_TRUE(equal(string1, abc));
+ ASSERT_FALSE(equal(string1, abcd));
+ ASSERT_FALSE(equal(string1, aBc));
String string2(abc, 3);
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, ab));
- ASSERT_TRUE(naiveEqualWithoutPerformingUnicodeNormalization(string2, abc));
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, abcd));
- ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, aBc));
+ ASSERT_FALSE(equal(string2, ab));
+ ASSERT_TRUE(equal(string2, abc));
+ ASSERT_FALSE(equal(string2, abcd));
+ ASSERT_FALSE(equal(string2, aBc));
}
} // namespace TestWebKitAPI