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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumFontProviderLinux.cpp

Issue 677103002: Expand system font values during property parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove isExpandedShorthandForAll. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 23 matching lines...) Expand all
34 34
35 namespace blink { 35 namespace blink {
36 36
37 // static 37 // static
38 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize) 38 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize)
39 { 39 {
40 s_defaultFontSize = static_cast<float>(fontSize); 40 s_defaultFontSize = static_cast<float>(fontSize);
41 } 41 }
42 42
43 // static 43 // static
44 void RenderThemeChromiumFontProvider::systemFont(CSSValueID valueID, FontDescrip tion& fontDescription) 44 void RenderThemeChromiumFontProvider::systemFont(CSSValueID systemFontID, FontSt yle& fontStyle, FontWeight& fontWeight, float& fontSize, AtomicString& fontFamil y)
45 { 45 {
46 float fontSize = s_defaultFontSize; 46 fontWeight = FontWeightNormal;
47 fontStyle = FontStyleNormal;
48 fontSize = s_defaultFontSize;
49 fontFamily = defaultGUIFont();
47 50
48 switch (valueID) { 51 switch (systemFontID) {
49 case CSSValueWebkitMiniControl: 52 case CSSValueWebkitMiniControl:
50 case CSSValueWebkitSmallControl: 53 case CSSValueWebkitSmallControl:
51 case CSSValueWebkitControl: 54 case CSSValueWebkitControl:
52 // Why 2 points smaller? Because that's what Gecko does. Note that we 55 // Why 2 points smaller? Because that's what Gecko does. Note that we
53 // are assuming a 96dpi screen, which is the default that we use on 56 // are assuming a 96dpi screen, which is the default that we use on
54 // Windows. 57 // Windows.
55 static const float pointsPerInch = 72.0f; 58 static const float pointsPerInch = 72.0f;
56 static const float pixelsPerInch = 96.0f; 59 static const float pixelsPerInch = 96.0f;
57 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch; 60 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch;
58 break; 61 break;
59 default: 62 default:
60 break; 63 break;
61 } 64 }
62
63 fontDescription.firstFamily().setFamily(defaultGUIFont());
64 fontDescription.setSpecifiedSize(fontSize);
65 fontDescription.setIsAbsoluteSize(true);
66 fontDescription.setGenericFamily(FontDescription::NoFamily);
67 fontDescription.setWeight(FontWeightNormal);
68 fontDescription.setStyle(FontStyleNormal);
69 } 65 }
70 66
71 } // namespace blink 67 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumFontProvider.h ('k') | Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698