Skip to content
Permalink
Browse files
alternateFamilyName should return a null, not an empty value
https://bugs.webkit.org/show_bug.cgi?id=113987

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-04-04
Reviewed by Anders Carlsson.

The string object corresponding semantically to "no-value" is
a null string, not an empty string.

Fix alternateFamilyName() accordingly.

* platform/graphics/FontCache.cpp:
(WebCore::alternateFamilyName):
(WebCore::FontCache::getCachedFontPlatformData):


Canonical link: https://commits.webkit.org/132348@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Benjamin Poulain authored and BenjaminPoulain committed Apr 5, 2013
1 parent d80065f commit 69cf20b8e9a48efe9f0746f0796b7502a639e68e
Showing 2 changed files with 18 additions and 2 deletions.
@@ -1,3 +1,19 @@
2013-04-04 Benjamin Poulain <bpoulain@apple.com>

alternateFamilyName should return a null, not an empty value
https://bugs.webkit.org/show_bug.cgi?id=113987

Reviewed by Anders Carlsson.

The string object corresponding semantically to "no-value" is
a null string, not an empty string.

Fix alternateFamilyName() accordingly.

* platform/graphics/FontCache.cpp:
(WebCore::alternateFamilyName):
(WebCore::FontCache::getCachedFontPlatformData):

2013-04-04 Anders Carlsson <andersca@apple.com>

Work around a bug in the bindings generation script.
@@ -178,7 +178,7 @@ static const AtomicString& alternateFamilyName(const AtomicString& familyName)
return timesNewRoman;
#endif

return emptyAtom;
return nullAtom;
}

FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription,
@@ -213,7 +213,7 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
// We were unable to find a font. We have a small set of fonts that we alias to other names,
// e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
const AtomicString& alternateName = alternateFamilyName(familyName);
if (!alternateName.isEmpty()) {
if (!alternateName.isNull()) {
FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, true);
// Lookup the key in the hash table again as the previous iterator may have
// been invalidated by the recursive call to getCachedFontPlatformData().

0 comments on commit 69cf20b

Please sign in to comment.