diff options
author | falken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 07:20:32 +0000 |
---|---|---|
committer | falken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 07:20:32 +0000 |
commit | 966d1e1627da47dc782a3d7ca8204de233b6edd6 (patch) | |
tree | 49477476b24226b10881e6b0cc35e26197b77c74 /webkit/tools/test_shell/test_shell.cc | |
parent | 1c6189ff4780f3a0968eb93370de7f477bf44b50 (diff) | |
download | chromium_src-966d1e1627da47dc782a3d7ca8204de233b6edd6.zip chromium_src-966d1e1627da47dc782a3d7ca8204de233b6edd6.tar.gz chromium_src-966d1e1627da47dc782a3d7ca8204de233b6edd6.tar.bz2 |
Migrate WebKit "global script" font prefs.
The effect is to migrate a pref like
webkit.webprefs.global.standard_font_family to webkit.webprefs.fonts.standard.Zyyy
This has two motivations:
1) Undo the migration of font prefs to the "global" (as opposed to per-tab)
namespace, as planned here: <http://codereview.chromium.org/9838050>. There are still
more prefs to move out of "global" after this patch.
2) Move the "global script" (as opposed to per-script) font prefs into the
per-script font maps, under the script code "Zyyy" (the ISO 15924 code for
the "Common" script). This is consistent with WebKit-side settings and should
simplify the code overall as we no longer have to special case the global
script vs the per-script fonts.
TBR=gene for chrome/browser/printing
BUG=123812
TEST=browser_tests --gtest_filter=PrefsTab* and ExtensionApiTest.Font*
Review URL: https://chromiumcodereview.appspot.com/10107014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 07f57a6..e929405 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -301,13 +301,17 @@ void TestShell::ResetWebPreferences() { *web_prefs_ = WebPreferences(); #if defined(OS_MACOSX) - web_prefs_->serif_font_family = ASCIIToUTF16("Times"); - web_prefs_->cursive_font_family = ASCIIToUTF16("Apple Chancery"); - web_prefs_->fantasy_font_family = ASCIIToUTF16("Papyrus"); + web_prefs_->serif_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Times"); + web_prefs_->cursive_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Apple Chancery"); + web_prefs_->fantasy_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Papyrus"); #else // NOTE: case matters here, this must be 'times new roman', else // some layout tests fail. - web_prefs_->serif_font_family = ASCIIToUTF16("times new roman"); + web_prefs_->serif_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("times new roman"); // These two fonts are picked from the intersection of // Win XP font list and Vista font list : @@ -319,12 +323,17 @@ void TestShell::ResetWebPreferences() { // They (especially Impact for fantasy) are not typical cursive // and fantasy fonts, but it should not matter for layout tests // as long as they're available. - web_prefs_->cursive_font_family = ASCIIToUTF16("Comic Sans MS"); - web_prefs_->fantasy_font_family = ASCIIToUTF16("Impact"); + web_prefs_->cursive_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Comic Sans MS"); + web_prefs_->fantasy_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Impact"); #endif - web_prefs_->standard_font_family = web_prefs_->serif_font_family; - web_prefs_->fixed_font_family = ASCIIToUTF16("Courier"); - web_prefs_->sans_serif_font_family = ASCIIToUTF16("Helvetica"); + web_prefs_->standard_font_family_map[WebPreferences::kCommonScript] = + web_prefs_->serif_font_family_map[WebPreferences::kCommonScript]; + web_prefs_->fixed_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Courier"); + web_prefs_->sans_serif_font_family_map[WebPreferences::kCommonScript] = + ASCIIToUTF16("Helvetica"); web_prefs_->default_encoding = "ISO-8859-1"; web_prefs_->default_font_size = 16; |