OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // FIXME: http://b/1119883 Since this is only used for "small caption", | 112 // FIXME: http://b/1119883 Since this is only used for "small caption", |
113 // "menu", and "status bar" objects, I'm not sure how much this even | 113 // "menu", and "status bar" objects, I'm not sure how much this even |
114 // matters. Plus the Gecko patch went in back in 2002, and maybe this | 114 // matters. Plus the Gecko patch went in back in 2002, and maybe this |
115 // isn't even relevant anymore. We should investigate whether this should | 115 // isn't even relevant anymore. We should investigate whether this should |
116 // be removed, or perhaps broadened to be "any CJK locale". | 116 // be removed, or perhaps broadened to be "any CJK locale". |
117 // | 117 // |
118 return ((size < 12.0f) && (GetACP() == 936)) ? 12.0f : size; | 118 return ((size < 12.0f) && (GetACP() == 936)) ? 12.0f : size; |
119 } | 119 } |
120 | 120 |
121 // static | 121 // static |
122 void RenderThemeChromiumFontProvider::systemFont(int propId, FontDescription& fo
ntDescription) | 122 void RenderThemeChromiumFontProvider::systemFont(CSSValueID valueID, FontDescrip
tion& fontDescription) |
123 { | 123 { |
124 // This logic owes much to RenderThemeSafari.cpp. | 124 // This logic owes much to RenderThemeSafari.cpp. |
125 FontDescription* cachedDesc = 0; | 125 FontDescription* cachedDesc = 0; |
126 AtomicString faceName; | 126 AtomicString faceName; |
127 float fontSize = 0; | 127 float fontSize = 0; |
128 switch (propId) { | 128 switch (valueID) { |
129 case CSSValueSmallCaption: | 129 case CSSValueSmallCaption: |
130 cachedDesc = &smallSystemFont(); | 130 cachedDesc = &smallSystemFont(); |
131 if (!smallSystemFont().isAbsoluteSize()) { | 131 if (!smallSystemFont().isAbsoluteSize()) { |
132 NONCLIENTMETRICS metrics; | 132 NONCLIENTMETRICS metrics; |
133 getNonClientMetrics(&metrics); | 133 getNonClientMetrics(&metrics); |
134 faceName = AtomicString(metrics.lfSmCaptionFont.lfFaceName, wcslen(m
etrics.lfSmCaptionFont.lfFaceName)); | 134 faceName = AtomicString(metrics.lfSmCaptionFont.lfFaceName, wcslen(m
etrics.lfSmCaptionFont.lfFaceName)); |
135 fontSize = systemFontSize(metrics.lfSmCaptionFont); | 135 fontSize = systemFontSize(metrics.lfSmCaptionFont); |
136 } | 136 } |
137 break; | 137 break; |
138 case CSSValueMenu: | 138 case CSSValueMenu: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // static | 183 // static |
184 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize) | 184 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize) |
185 { | 185 { |
186 s_defaultFontSize = static_cast<float>(fontSize); | 186 s_defaultFontSize = static_cast<float>(fontSize); |
187 | 187 |
188 // Reset cached fonts. | 188 // Reset cached fonts. |
189 smallSystemFont() = menuFont() = labelFont() = FontDescription(); | 189 smallSystemFont() = menuFont() = labelFont() = FontDescription(); |
190 } | 190 } |
191 | 191 |
192 } // namespace WebCore | 192 } // namespace WebCore |
OLD | NEW |