Changeset 220009 in webkit
- Timestamp:
- Jul 28, 2017 11:36:37 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220008 r220009 1 2017-07-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [macOS] Reeder's defaults font is Times instead of San Francisco 4 https://bugs.webkit.org/show_bug.cgi?id=174885 5 <rdar://problem/33462483> 6 7 Reviewed by Simon Fraser. 8 9 * fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html: Added. 10 * fast/text/font-lookup-dot-prefix-case-sensitive-2.html: Added. 11 * fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html: Added. 12 * fast/text/font-lookup-dot-prefix-case-sensitive.html: Added. 13 1 14 2017-07-28 Devin Rousso <drousso@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r220008 r220009 1 2017-07-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [macOS] Reeder's defaults font is Times instead of San Francisco 4 https://bugs.webkit.org/show_bug.cgi?id=174885 5 <rdar://problem/33462483> 6 7 Reviewed by Simon Fraser. 8 9 Reeder uses explicit dot-prefixed names in its source code. Within Core Text, 10 dot-prefixed names cannot be matched case insensitively. The solution is to 11 not case-fold these family names, and to make our caches case sensitive for 12 these special names. 13 14 Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html 15 fast/text/font-lookup-dot-prefix-case-sensitive.html 16 17 * platform/graphics/FontCache.cpp: 18 (WebCore::FontPlatformDataCacheKey::operator==): 19 (WebCore::FontPlatformDataCacheKeyHash::hash): 20 * platform/graphics/FontCascade.cpp: 21 (WebCore::keysMatch): 22 (WebCore::computeFontCascadeCacheHash): 23 * platform/graphics/FontDescription.cpp: 24 (WebCore::FontCascadeDescription::familyNamesAreEqual): 25 (WebCore::FontCascadeDescription::familyNameHash): 26 (WebCore::FontCascadeDescription::foldedFamilyName): 27 * platform/graphics/FontDescription.h: 28 * platform/graphics/cocoa/FontCacheCoreText.cpp: 29 (WebCore::FontDatabase::fontForPostScriptName): 30 1 31 2017-07-28 Devin Rousso <drousso@apple.com> 2 32 -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r219237 r220009 128 128 if (m_family.isNull() || other.m_family.isNull()) 129 129 return false; 130 return ASCIICaseInsensitiveHash::equal(m_family, other.m_family);130 return FontCascadeDescription::familyNamesAreEqual(m_family, other.m_family); 131 131 } 132 132 … … 142 142 { 143 143 IntegerHasher hasher; 144 hasher.add( ASCIICaseInsensitiveHash::hash(fontKey.m_family));144 hasher.add(FontCascadeDescription::familyNameHash(fontKey.m_family)); 145 145 hasher.add(fontKey.m_fontDescriptionKey.computeHash()); 146 146 hasher.add(fontKey.m_fontFaceFeatures.hash()); -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r219858 r220009 186 186 return false; 187 187 for (unsigned i = 0; i < size; ++i) { 188 if (! equalIgnoringASCIICase(a.families[i], b.families[i]))188 if (!FontCascadeDescription::familyNamesAreEqual(a.families[i], b.families[i])) 189 189 return false; 190 190 } … … 230 230 hasher.add(key.fontSelectorVersion); 231 231 for (unsigned i = 0; i < key.families.size(); ++i) { 232 StringImpl* family = key.families[i].impl();233 hasher.add(family ? ASCIICaseInsensitiveHash::hash(family) : 0);232 auto& family = key.families[i]; 233 hasher.add(family.isNull() ? 0 : FontCascadeDescription::familyNameHash(family)); 234 234 } 235 235 return hasher.hash(); -
trunk/Source/WebCore/platform/graphics/FontDescription.cpp
r218372 r220009 32 32 33 33 #include "LocaleToScriptMapping.h" 34 #include <wtf/text/StringHash.h> 34 35 35 36 namespace WebCore { … … 156 157 #endif // ENABLE(TEXT_AUTOSIZING) 157 158 159 bool FontCascadeDescription::familyNamesAreEqual(const AtomicString& family1, const AtomicString& family2) 160 { 161 // FIXME: <rdar://problem/33594253> CoreText matches dot-prefixed font names case sensitively. We should 162 // always take the case insensitive patch once this radar is fixed. 163 if (family1.startsWith('.')) 164 return StringHash::equal(family1.string(), family2.string()); 165 return ASCIICaseInsensitiveHash::equal(family1, family2); 166 } 167 168 unsigned FontCascadeDescription::familyNameHash(const AtomicString& family) 169 { 170 // FIXME: <rdar://problem/33594253> CoreText matches dot-prefixed font names case sensitively. We should 171 // always take the case insensitive patch once this radar is fixed. 172 if (family.startsWith('.')) 173 return StringHash::hash(family.string()); 174 return ASCIICaseInsensitiveHash::hash(family); 175 } 176 177 String FontCascadeDescription::foldedFamilyName(const AtomicString& family) 178 { 179 // FIXME: <rdar://problem/33594253> CoreText matches dot-prefixed font names case sensitively. We should 180 // always take the case insensitive patch once this radar is fixed. 181 if (family.startsWith('.')) 182 return family.string(); 183 return family.string().foldCase(); 184 } 185 158 186 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/FontDescription.h
r219544 r220009 233 233 const RefCountedArray<AtomicString>& families() const { return m_families; } 234 234 235 static bool familyNamesAreEqual(const AtomicString&, const AtomicString&); 236 static unsigned familyNameHash(const AtomicString&); 237 static String foldedFamilyName(const AtomicString&); 238 235 239 unsigned effectiveFamilyCount() const; 236 240 FontFamilySpecification effectiveFamilyAt(unsigned) const; -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
r219237 r220009 908 908 const InstalledFont& fontForPostScriptName(const AtomicString& postScriptName) 909 909 { 910 auto folded = postScriptName.string().foldCase();910 const auto& folded = FontCascadeDescription::foldedFamilyName(postScriptName); 911 911 return m_postScriptNameToFontDescriptors.ensure(folded, [&] { 912 912 auto postScriptNameString = folded.createCFString();
Note: See TracChangeset
for help on using the changeset viewer.