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

Unified Diff: Source/core/layout/LayoutTextControlMultiLine.cpp

Issue 1292593003: Revert "Revert "Reland 2: mac: Use a placeholder string for the family name of the system font." Br… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTextControlMultiLine.cpp
diff --git a/Source/core/layout/LayoutTextControlMultiLine.cpp b/Source/core/layout/LayoutTextControlMultiLine.cpp
index 6a67ae7fad0722e19b98b330ec44dd9dfd7ae5bd..b48e0b00ec98de5acff36df47a38347f05fb6ef7 100644
--- a/Source/core/layout/LayoutTextControlMultiLine.cpp
+++ b/Source/core/layout/LayoutTextControlMultiLine.cpp
@@ -24,6 +24,7 @@
#include "core/html/HTMLTextAreaElement.h"
#include "core/layout/HitTestResult.h"
+#include "core/layout/LayoutTheme.h"
namespace blink {
@@ -50,10 +51,11 @@ bool LayoutTextControlMultiLine::nodeAtPoint(HitTestResult& result, const HitTes
float LayoutTextControlMultiLine::getAvgCharWidth(const AtomicString& family) const
{
- // Since Lucida Grande is the default font, we want this to match the width
- // of Courier New, the default font for textareas in IE, Firefox and Safari Win.
- // 1229 is the avgCharWidth value in the OS/2 table for Courier New.
- if (family == "Lucida Grande")
+ // Match the default system font to the width of MS Shell Dlg, the default
+ // font for textareas in Firefox, Safari Win and IE for some encodings (in
+ // IE, the default font is encoding specific). 1229 is the avgCharWidth
+ // value in the OS/2 table for Courier New.
+ if (LayoutTheme::theme().needsHackForTextControlWithFontFamily(family))
return scaleEmToUnits(1229);
return LayoutTextControl::getAvgCharWidth(family);
« no previous file with comments | « no previous file | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698