Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: Source/WebCore/platform/mac/WebFontCache.mm

Issue 13905007: Remove the last remaining PLATFORM() bits from WebCore. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fffffffffff Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/mac/WebFontCache.mm
diff --git a/Source/WebCore/platform/mac/WebFontCache.mm b/Source/WebCore/platform/mac/WebFontCache.mm
index be7c715db8034b1655bf1e5e39a6ba66f36bc092..a3039ce0183876a9b6ea375a08204eb01fc81b40 100644
--- a/Source/WebCore/platform/mac/WebFontCache.mm
+++ b/Source/WebCore/platform/mac/WebFontCache.mm
@@ -101,18 +101,6 @@ static BOOL betterChoice(NSFontTraitMask desiredTraits, int desiredWeight,
return candidateWeightDeltaMagnitude < chosenWeightDeltaMagnitude;
}
-// Workaround for <rdar://problem/5781372>.
-static inline void fixUpWeight(NSInteger& weight, NSString *fontName)
-{
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- UNUSED_PARAM(weight);
- UNUSED_PARAM(fontName);
-#else
- if (weight == 3 && [fontName rangeOfString:@"ultralight" options:NSCaseInsensitiveSearch | NSBackwardsSearch | NSLiteralSearch].location != NSNotFound)
- weight = 2;
-#endif
-}
-
static inline FontTraitsMask toTraitsMask(NSFontTraitMask appKitTraits, NSInteger appKitWeight)
{
return static_cast<FontTraitsMask>(((appKitTraits & NSFontItalicTrait) ? FontStyleItalicMask : FontStyleNormalMask)
@@ -149,7 +137,6 @@ static inline FontTraitsMask toTraitsMask(NSFontTraitMask appKitTraits, NSIntege
if ([desiredFamily caseInsensitiveCompare:availableFont] == NSOrderedSame) {
NSFont *font = [NSFont fontWithName:availableFont size:10];
NSInteger weight = [fontManager weightOfFont:font];
- fixUpWeight(weight, desiredFamily);
traitsMasks.append(toTraitsMask([fontManager traitsOfFont:font], weight));
break;
}
@@ -163,9 +150,7 @@ static inline FontTraitsMask toTraitsMask(NSFontTraitMask appKitTraits, NSIntege
for (i = 0; i < n; i++) {
NSArray *fontInfo = [fonts objectAtIndex:i];
// Array indices must be hard coded because of lame AppKit API.
- NSString *fontFullName = [fontInfo objectAtIndex:0];
NSInteger fontWeight = [[fontInfo objectAtIndex:2] intValue];
- fixUpWeight(fontWeight, fontFullName);
NSFontTraitMask fontTraits = [[fontInfo objectAtIndex:3] unsignedIntValue];
traitsMasks.append(toTraitsMask(fontTraits, fontWeight));
@@ -229,7 +214,6 @@ static inline FontTraitsMask toTraitsMask(NSFontTraitMask appKitTraits, NSIntege
// Array indices must be hard coded because of lame AppKit API.
NSString *fontFullName = [fontInfo objectAtIndex:0];
NSInteger fontWeight = [[fontInfo objectAtIndex:2] intValue];
- fixUpWeight(fontWeight, fontFullName);
NSFontTraitMask fontTraits = [[fontInfo objectAtIndex:3] unsignedIntValue];
« no previous file with comments | « Source/WebCore/platform/mac/WebCoreSystemInterface.mm ('k') | Source/WebCore/platform/text/cf/HyphenationCF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698