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

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: . 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..2b989834e8627b5725ac411093136408da1f85c1 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;
}
@@ -165,7 +152,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];
traitsMasks.append(toTraitsMask(fontTraits, fontWeight));
@@ -229,7 +215,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];

Powered by Google App Engine
This is Rietveld 408576698