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

Issue 1276003003: Reland 2: mac: Use a placeholder string for the family name of the system font. (Closed)

Created:
5 years, 4 months ago by erikchen
Modified:
5 years, 4 months ago
Reviewers:
tkent, keishi, Nico
CC:
blink-reviews, krit, pdr+renderingwatchlist_chromium.org, drott+blinkwatch_chromium.org, Rik, zoltan1, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, Justin Novosad, jbroman, danakj, blink-reviews-rendering, f(malita), jchaffraix+rendering, dshwang, Stephen Chennney, pdr+graphicswatchlist_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Reland 2: mac: Use a placeholder string for the family name of the system font. This CL contains 4 functional differences from Reland #1. 1) The default system font average char width hack is only applied on OSX 10.9 or earlier. The 10.10 layout tests were recently rebaselined to not use this hack. 2) On OSX 10.10+, the implementation of MatchNSFontFamily uses the new NSFont private method +[NSFont fontWithSize:weight:]. This matches mmaxfield@'s implementation for WebKit. 3) The first reland was accidentally comparing an AppKit font weight with blink::FontWeight. 4) The first reland forgot to apply traits to the default system font. This CL rebaselines 5 Yosemite layout tests that use a bold system font. The previous logic in MatchNSFontFamily was converting the default system font to a string, and then back to an NSFont*. On Yosemite, this operation produces non-deterministic results (dependent on global state). The new mechanism for grabbing the system font is deterministic. Original issue's description: > mac: Use a placeholder string for the family name of the system font. > > This CL is inspired by mmaxfield@apple.com and > http://trac.webkit.org/changeset/184353. > > The system font varies by OS version, as well as the version of the OSX SDK that > the binary is compiled against. This CL uses a placeholder string for the family > name of the system font that is passed around. > > This CL has two positive effects. > > 1) Logic in LayoutTestControl* was checking the family name of the font directly > against the string "Lucida Grande". This was broken any time the system font > wasn't "Lucida Grande". > 2) Layout tests were failing on OSX 10.10, 10.11, and when the binary was > compiled against the OSX 10.10 SDK. This CL fixes this particular set of > problems by always using the font "Lucida Grande" for layout tests. > > This CL has one non-regression behavior change. If the font family of a text > control is set to "Lucida Grande", its width is no longer modified by the > special logic in LayoutTestControl*. This isn't a regression because there is no > reason to expect the special logic of LayoutTestControl to apply to the text > control to begin with (since "Lucida Grande" may or may not be the system font). > If we really want the system font to always have this behavior, we should > implement font family keywords like "-apple-system". See 515989 for more > details. > > BUG=515989, 515836 BUG=515989, 515836 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200304

Patch Set 1 : Copy of Reland 1. #

Patch Set 2 : Don't perform average char width hack on 10.10+. #

Patch Set 3 : Use new font weight methods on Yosemite. Add unit test. #

Patch Set 4 : Add version utils. #

Patch Set 5 : Add platform export. #

Patch Set 6 : Compile errors. #

Patch Set 7 : Remove unused code. #

Patch Set 8 : Rebase against top of tree. #

Patch Set 9 : Rebaseline Yosemite tests that use bold fonts. #

Total comments: 4

Patch Set 10 : Comments from tkent. #

Total comments: 4

Patch Set 11 : Comments from tkent, round two. #

Patch Set 12 : Rebase against top of tree. Comment out more specialized, duplicate rebaseline. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -61 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -1 line 0 comments Download
M Source/core/layout/LayoutTextControlMultiLine.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -4 lines 0 comments Download
M Source/core/layout/LayoutTextControlSingleLine.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +10 lines, -10 lines 0 comments Download
M Source/core/layout/LayoutTheme.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutThemeMac.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutThemeMac.mm View 1 2 3 4 5 6 7 8 9 3 chunks +10 lines, -2 lines 0 comments Download
M Source/platform/blink_platform.gyp View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M Source/platform/fonts/mac/FontCacheMac.mm View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -19 lines 0 comments Download
M Source/platform/fonts/mac/FontFamilyMatcherMac.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -2 lines 0 comments Download
M Source/platform/fonts/mac/FontFamilyMatcherMac.mm View 1 2 3 4 5 6 7 8 9 7 chunks +84 lines, -5 lines 0 comments Download
A Source/platform/fonts/mac/FontFamilyMatcherMacTest.mm View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
M Source/platform/mac/ThemeMac.h View 1 chunk +0 lines, -4 lines 0 comments Download
M Source/platform/mac/ThemeMac.mm View 6 7 2 chunks +1 line, -13 lines 0 comments Download
A Source/platform/mac/VersionUtilMac.h View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download
A Source/platform/mac/VersionUtilMac.mm View 1 2 3 4 5 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (12 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1276003003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1276003003/120001
5 years, 4 months ago (2015-08-06 22:57:17 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: blink_presubmit on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/39264)
5 years, 4 months ago (2015-08-06 22:59:18 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1276003003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1276003003/140001
5 years, 4 months ago (2015-08-06 23:07:54 UTC) #6
erikchen
thakis: Please review.
5 years, 4 months ago (2015-08-06 23:14:21 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-07 01:57:49 UTC) #10
erikchen
On 2015/08/07 01:57:49, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
5 years, 4 months ago (2015-08-10 16:59:49 UTC) #11
Nico
tkent, since you looked at https://code.google.com/p/chromium/issues/detail?id=508768#c6 , can you take a look at the changes ...
5 years, 4 months ago (2015-08-10 17:05:49 UTC) #13
tkent
+keishi
5 years, 4 months ago (2015-08-11 01:29:16 UTC) #15
tkent
https://codereview.chromium.org/1276003003/diff/160001/Source/core/layout/LayoutTextControlMultiLine.cpp File Source/core/layout/LayoutTextControlMultiLine.cpp (right): https://codereview.chromium.org/1276003003/diff/160001/Source/core/layout/LayoutTextControlMultiLine.cpp#newcode63 Source/core/layout/LayoutTextControlMultiLine.cpp:63: #if defined(WTF_OS_MACOSX) We'd like to minimize OS-specific code in ...
5 years, 4 months ago (2015-08-11 01:34:36 UTC) #16
erikchen
tkent: PTAL https://codereview.chromium.org/1276003003/diff/160001/Source/core/layout/LayoutTextControlMultiLine.cpp File Source/core/layout/LayoutTextControlMultiLine.cpp (right): https://codereview.chromium.org/1276003003/diff/160001/Source/core/layout/LayoutTextControlMultiLine.cpp#newcode63 Source/core/layout/LayoutTextControlMultiLine.cpp:63: #if defined(WTF_OS_MACOSX) On 2015/08/11 01:34:36, tkent wrote: ...
5 years, 4 months ago (2015-08-11 05:21:13 UTC) #17
tkent
lgtm https://codereview.chromium.org/1276003003/diff/180001/Source/core/layout/LayoutTextControlSingleLine.cpp File Source/core/layout/LayoutTextControlSingleLine.cpp (right): https://codereview.chromium.org/1276003003/diff/180001/Source/core/layout/LayoutTextControlSingleLine.cpp#newcode306 Source/core/layout/LayoutTextControlSingleLine.cpp:306: // This is a hack which Blink no ...
5 years, 4 months ago (2015-08-11 05:24:49 UTC) #18
erikchen
https://codereview.chromium.org/1276003003/diff/180001/Source/core/layout/LayoutTextControlSingleLine.cpp File Source/core/layout/LayoutTextControlSingleLine.cpp (right): https://codereview.chromium.org/1276003003/diff/180001/Source/core/layout/LayoutTextControlSingleLine.cpp#newcode306 Source/core/layout/LayoutTextControlSingleLine.cpp:306: // This is a hack which Blink no longer ...
5 years, 4 months ago (2015-08-11 05:30:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1276003003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1276003003/200001
5 years, 4 months ago (2015-08-11 05:30:55 UTC) #22
keishi
LGTM
5 years, 4 months ago (2015-08-11 05:31:40 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/39478)
5 years, 4 months ago (2015-08-11 05:36:40 UTC) #25
erikchen
On 2015/08/11 05:36:40, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 4 months ago (2015-08-11 05:49:15 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1276003003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1276003003/220001
5 years, 4 months ago (2015-08-11 05:50:37 UTC) #29
commit-bot: I haz the power
5 years, 4 months ago (2015-08-11 07:14:17 UTC) #30
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200304

Powered by Google App Engine
This is Rietveld 408576698