Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Incorrect use of String::foldCase for font family names
https://bugs.webkit.org/show_bug.cgi?id=194895 Reviewed by Myles C. Maxfield. * platform/graphics/FontCascadeDescription.cpp: (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use familyNamesAreEqual instead of calling convertToASCIILowercase directly. (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's operator== when we want case sensitive family name comparisons. This is a special case to accomodate CoreText, which uses "."-prefix names for internal fonts that are treated case sensitively. (Ideally webpages would not use these fonts at all.) (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash when we want case sensitive family name hashing. (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an AtomicString so we can use this at an additional call site. Converting from an AtomicString to a String if free and automatic at the existing call sites. Use convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one must be consistent. 2) this is considerably faster, and 3) font family names don't need arbitrary Unicode case folding, it's only A-Z that should be folded. * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString in the foldedFamilyName function. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use FontCascadeDescription::foldedFamilyName to correctly fold font family names. Canonical link: https://commits.webkit.org/209362@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
4 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters