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

Side by Side Diff: third_party/WebKit/WebCore/rendering/RenderThemeChromiumLinux.cpp

Issue 56198: Roll out dominantScript, getGenericFontForScript patches to unfork a bunch of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // We aim to match IE here. 82 // We aim to match IE here.
83 // -IE uses a font based on the encoding as the default font for form controls. 83 // -IE uses a font based on the encoding as the default font for form controls.
84 // -Gecko uses MS Shell Dlg (actually calls GetStockObject(DEFAULT_GUI_FONT), 84 // -Gecko uses MS Shell Dlg (actually calls GetStockObject(DEFAULT_GUI_FONT),
85 // which returns MS Shell Dlg) 85 // which returns MS Shell Dlg)
86 // -Safari uses Lucida Grande. 86 // -Safari uses Lucida Grande.
87 // 87 //
88 // FIXME: The only case where we know we don't match IE is for ANSI encodings. 88 // FIXME: The only case where we know we don't match IE is for ANSI encodings.
89 // IE uses MS Shell Dlg there, which we render incorrectly at certain pixel 89 // IE uses MS Shell Dlg there, which we render incorrectly at certain pixel
90 // sizes (e.g. 15px). So, for now we just use Arial. 90 // sizes (e.g. 15px). So, for now we just use Arial.
91 static const char* defaultGUIFont(Document* document) 91 static const char* defaultGUIFont()
92 { 92 {
93 return "Arial"; 93 return "Arial";
94 } 94 }
95 95
96 RenderTheme* theme() 96 RenderTheme* theme()
97 { 97 {
98 static RenderThemeChromiumLinux theme; 98 static RenderThemeChromiumLinux theme;
99 return &theme; 99 return &theme;
100 } 100 }
101 101
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 { 148 {
149 // Disable the blinking caret in layout test mode, as it introduces 149 // Disable the blinking caret in layout test mode, as it introduces
150 // a race condition for the pixel tests. http://b/1198440 150 // a race condition for the pixel tests. http://b/1198440
151 if (ChromiumBridge::layoutTestMode()) 151 if (ChromiumBridge::layoutTestMode())
152 return 0; 152 return 0;
153 153
154 // We cache the interval so we don't have to repeatedly request it from gtk. 154 // We cache the interval so we don't have to repeatedly request it from gtk.
155 return 0.5; 155 return 0.5;
156 } 156 }
157 157
158 void RenderThemeChromiumLinux::systemFont(int propId, Document* document, FontDe scription& fontDescription) const 158 void RenderThemeChromiumLinux::systemFont(int propId, FontDescription& fontDescr iption) const
159 { 159 {
160 float fontSize = DefaultFontSize; 160 float fontSize = DefaultFontSize;
161 161
162 switch (propId) { 162 switch (propId) {
163 case CSSValueWebkitMiniControl: 163 case CSSValueWebkitMiniControl:
164 case CSSValueWebkitSmallControl: 164 case CSSValueWebkitSmallControl:
165 case CSSValueWebkitControl: 165 case CSSValueWebkitControl:
166 // Why 2 points smaller? Because that's what Gecko does. Note that we 166 // Why 2 points smaller? Because that's what Gecko does. Note that we
167 // are assuming a 96dpi screen, which is the default that we use on 167 // are assuming a 96dpi screen, which is the default that we use on
168 // Windows. 168 // Windows.
169 static const float pointsPerInch = 72.0f; 169 static const float pointsPerInch = 72.0f;
170 static const float pixelsPerInch = 96.0f; 170 static const float pixelsPerInch = 96.0f;
171 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch; 171 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch;
172 break; 172 break;
173 } 173 }
174 174
175 fontDescription.firstFamily().setFamily(defaultGUIFont(NULL)); 175 fontDescription.firstFamily().setFamily(defaultGUIFont());
176 fontDescription.setSpecifiedSize(fontSize); 176 fontDescription.setSpecifiedSize(fontSize);
177 fontDescription.setIsAbsoluteSize(true); 177 fontDescription.setIsAbsoluteSize(true);
178 fontDescription.setGenericFamily(FontDescription::NoFamily); 178 fontDescription.setGenericFamily(FontDescription::NoFamily);
179 fontDescription.setWeight(FontWeightNormal); 179 fontDescription.setWeight(FontWeightNormal);
180 fontDescription.setItalic(false); 180 fontDescription.setItalic(false);
181 } 181 }
182 182
183 int RenderThemeChromiumLinux::minimumMenuListSize(RenderStyle* style) const 183 int RenderThemeChromiumLinux::minimumMenuListSize(RenderStyle* style) const
184 { 184 {
185 return 0; 185 return 0;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // If the MenuList actually has appearance "NoAppearance", then that means 513 // If the MenuList actually has appearance "NoAppearance", then that means
514 // we don't draw a button, so don't reserve space for it. 514 // we don't draw a button, so don't reserve space for it.
515 const int bar_type = style->direction() == LTR ? RightPadding : LeftPadding; 515 const int bar_type = style->direction() == LTR ? RightPadding : LeftPadding;
516 if (paddingType == bar_type && style->appearance() != NoControlPart) 516 if (paddingType == bar_type && style->appearance() != NoControlPart)
517 padding += ScrollbarTheme::nativeTheme()->scrollbarThickness(); 517 padding += ScrollbarTheme::nativeTheme()->scrollbarThickness();
518 518
519 return padding; 519 return padding;
520 } 520 }
521 521
522 } // namespace WebCore 522 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698