| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 fontDescription.setGenericFamily(FontDescription::SerifFamily); | 592 fontDescription.setGenericFamily(FontDescription::SerifFamily); |
| 593 | 593 |
| 594 NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize
:controlSize]]; | 594 NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize
:controlSize]]; |
| 595 fontDescription.firstFamily().setFamily([font webCoreFamilyName]); | 595 fontDescription.firstFamily().setFamily([font webCoreFamilyName]); |
| 596 fontDescription.setComputedSize([font pointSize] * style.effectiveZoom()); | 596 fontDescription.setComputedSize([font pointSize] * style.effectiveZoom()); |
| 597 fontDescription.setSpecifiedSize([font pointSize] * style.effectiveZoom()); | 597 fontDescription.setSpecifiedSize([font pointSize] * style.effectiveZoom()); |
| 598 | 598 |
| 599 // Reset line height. | 599 // Reset line height. |
| 600 style.setLineHeight(ComputedStyle::initialLineHeight()); | 600 style.setLineHeight(ComputedStyle::initialLineHeight()); |
| 601 | 601 |
| 602 // TODO(esprehn): The fontSelector manual management is buggy and error pron
e. |
| 603 FontSelector* fontSelector = style.font().fontSelector(); |
| 602 if (style.setFontDescription(fontDescription)) | 604 if (style.setFontDescription(fontDescription)) |
| 603 style.font().update(nullptr); | 605 style.font().update(fontSelector); |
| 604 } | 606 } |
| 605 | 607 |
| 606 NSControlSize LayoutThemeMac::controlSizeForSystemFont(const ComputedStyle& styl
e) const | 608 NSControlSize LayoutThemeMac::controlSizeForSystemFont(const ComputedStyle& styl
e) const |
| 607 { | 609 { |
| 608 float fontSize = style.fontSize(); | 610 float fontSize = style.fontSize(); |
| 609 float zoomLevel = style.effectiveZoom(); | 611 float zoomLevel = style.effectiveZoom(); |
| 610 if (zoomLevel != 1) | 612 if (zoomLevel != 1) |
| 611 fontSize /= zoomLevel; | 613 fontSize /= zoomLevel; |
| 612 if (fontSize >= [NSFont systemFontSizeForControlSize:NSRegularControlSize]) | 614 if (fontSize >= [NSFont systemFontSizeForControlSize:NSRegularControlSize]) |
| 613 return NSRegularControlSize; | 615 return NSRegularControlSize; |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 | 1170 |
| 1169 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const | 1171 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const |
| 1170 { | 1172 { |
| 1171 ControlPart part = style.appearance(); | 1173 ControlPart part = style.appearance(); |
| 1172 if (part == CheckboxPart || part == RadioPart) | 1174 if (part == CheckboxPart || part == RadioPart) |
| 1173 return style.effectiveZoom() != 1; | 1175 return style.effectiveZoom() != 1; |
| 1174 return false; | 1176 return false; |
| 1175 } | 1177 } |
| 1176 | 1178 |
| 1177 } // namespace blink | 1179 } // namespace blink |
| OLD | NEW |