OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Google, Inc. | 3 * Copyright (C) 2008, 2009 Google, Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 default: | 296 default: |
297 cachedDesc = &systemFont; | 297 cachedDesc = &systemFont; |
298 if (!systemFont.isAbsoluteSize()) | 298 if (!systemFont.isAbsoluteSize()) |
299 font = [NSFont systemFontOfSize:[NSFont systemFontSize]]; | 299 font = [NSFont systemFontOfSize:[NSFont systemFontSize]]; |
300 } | 300 } |
301 | 301 |
302 if (font) { | 302 if (font) { |
303 NSFontManager *fontManager = [NSFontManager sharedFontManager]; | 303 NSFontManager *fontManager = [NSFontManager sharedFontManager]; |
304 cachedDesc->setIsAbsoluteSize(true); | 304 cachedDesc->setIsAbsoluteSize(true); |
305 cachedDesc->setGenericFamily(FontDescription::NoFamily); | 305 cachedDesc->setGenericFamily(FontDescription::NoFamily); |
306 cachedDesc->firstFamily().setFamily([font webCoreFamilyName]); | 306 NSString* nsFamilyName = [font webCoreFamilyName]; |
dglazkov
2014/01/15 18:47:08
Should this be part of AtomicString constructor?
| |
307 cachedDesc->firstFamily().setFamily(AtomicString([nsFamilyName UTF8Strin g])); | |
307 cachedDesc->setSpecifiedSize([font pointSize]); | 308 cachedDesc->setSpecifiedSize([font pointSize]); |
308 cachedDesc->setWeight(toFontWeight([fontManager weightOfFont:font])); | 309 cachedDesc->setWeight(toFontWeight([fontManager weightOfFont:font])); |
309 cachedDesc->setItalic([fontManager traitsOfFont:font] & NSItalicFontMask ); | 310 cachedDesc->setItalic([fontManager traitsOfFont:font] & NSItalicFontMask ); |
310 } | 311 } |
311 fontDescription = *cachedDesc; | 312 fontDescription = *cachedDesc; |
312 } | 313 } |
313 | 314 |
314 static RGBA32 convertNSColorToColor(NSColor *color) | 315 static RGBA32 convertNSColorToColor(NSColor *color) |
315 { | 316 { |
316 NSColor *colorInColorSpace = [color colorUsingColorSpaceName:NSDeviceRGBColo rSpace]; | 317 NSColor *colorInColorSpace = [color colorUsingColorSpaceName:NSDeviceRGBColo rSpace]; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
718 style->setHeight(Length(size.height(), Fixed)); | 719 style->setHeight(Length(size.height(), Fixed)); |
719 } | 720 } |
720 | 721 |
721 void RenderThemeChromiumMac::setFontFromControlSize(RenderStyle* style, NSContro lSize controlSize) const | 722 void RenderThemeChromiumMac::setFontFromControlSize(RenderStyle* style, NSContro lSize controlSize) const |
722 { | 723 { |
723 FontDescription fontDescription; | 724 FontDescription fontDescription; |
724 fontDescription.setIsAbsoluteSize(true); | 725 fontDescription.setIsAbsoluteSize(true); |
725 fontDescription.setGenericFamily(FontDescription::SerifFamily); | 726 fontDescription.setGenericFamily(FontDescription::SerifFamily); |
726 | 727 |
727 NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize :controlSize]]; | 728 NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize :controlSize]]; |
728 fontDescription.firstFamily().setFamily([font webCoreFamilyName]); | 729 NSString* nsFamilyName = [font webCoreFamilyName]; |
730 fontDescription.firstFamily().setFamily(AtomicString([nsFamilyName UTF8Strin g])); | |
729 fontDescription.setComputedSize([font pointSize] * style->effectiveZoom()); | 731 fontDescription.setComputedSize([font pointSize] * style->effectiveZoom()); |
730 fontDescription.setSpecifiedSize([font pointSize] * style->effectiveZoom()); | 732 fontDescription.setSpecifiedSize([font pointSize] * style->effectiveZoom()); |
731 | 733 |
732 // Reset line height | 734 // Reset line height |
733 style->setLineHeight(RenderStyle::initialLineHeight()); | 735 style->setLineHeight(RenderStyle::initialLineHeight()); |
734 | 736 |
735 if (style->setFontDescription(fontDescription)) | 737 if (style->setFontDescription(fontDescription)) |
736 style->font().update(0); | 738 style->font().update(0); |
737 } | 739 } |
738 | 740 |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2004 | 2006 |
2005 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const | 2007 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const |
2006 { | 2008 { |
2007 ControlPart part = style->appearance(); | 2009 ControlPart part = style->appearance(); |
2008 if (part == CheckboxPart || part == RadioPart) | 2010 if (part == CheckboxPart || part == RadioPart) |
2009 return style->effectiveZoom() != 1; | 2011 return style->effectiveZoom() != 1; |
2010 return false; | 2012 return false; |
2011 } | 2013 } |
2012 | 2014 |
2013 } // namespace WebCore | 2015 } // namespace WebCore |
OLD | NEW |