Commit f433130a authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Remove Mac OS 10.10 specific forward declaration

After removing support for Mac OS 10.10, remove specific workaround to
access a non-public font function.

Fixed: 1150869
Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel,mac10.15-blink-rel,mac10.14-blink-rel,mac10.13-blink-rel,mac10.12-blink-rel
Change-Id: I41321d03bd97a42c53d8d6012b79ebdbe6ca1d00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549953Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829308}
parent 26d4746d
......@@ -42,10 +42,6 @@
#import "third_party/blink/renderer/platform/wtf/hash_set.h"
#import "third_party/blink/renderer/platform/wtf/text/atomic_string_hash.h"
@interface NSFont (YosemiteAdditions)
+ (NSFont*)systemFontOfSize:(CGFloat)size weight:(CGFloat)weight;
@end
namespace {
static CGFloat toFontWeight(blink::FontSelectionValue font_weight) {
......@@ -176,15 +172,9 @@ NSFont* MatchNSFontFamily(const AtomicString& desired_family_string,
if (desired_family_string == font_family_names::kSystemUi) {
NSFont* font = nil;
// Normally we'd use an availability macro here, but
// systemFontOfSize:weight: is available but not visible on macOS 10.10,
// so it's been forward declared earlier in this file.
// On OSX 10.10+, the default system font has more weights.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
font = [NSFont systemFontOfSize:size weight:toFontWeight(desired_weight)];
#pragma clang diagnostic pop
if (@available(macOS 10.11, *)) {
font = [NSFont systemFontOfSize:size weight:toFontWeight(desired_weight)];
}
if (desired_traits & IMPORTANT_FONT_TRAITS)
font = [[NSFontManager sharedFontManager] convertFont:font
toHaveTrait:desired_traits];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment