Use -webkit-locale for font selection.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Aug 2011 15:22:05 +0000 (15:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Aug 2011 15:22:05 +0000 (15:22 +0000)
commitedf95aea5fc5bcb54f21177804a1800564f0719b
tree8cfbab4e16642b03e0118a8f4fe4db31f17fd108
parent4607aa9b0838e3b0b5f67cbbf32699e4680cb35a
Use -webkit-locale for font selection.
https://bugs.webkit.org/show_bug.cgi?id=10874

Patch by Matt Falkenhagen <falken@chromium.org> on 2011-08-04
Reviewed by Dan Bernstein.

Infer a script from -webkit-locale to use to choose a font for generic
font families and the default unstyled font.  The font is retrieved
from per-script font settings (see bug 20797).  Since these settings
have not changed there should be no visible effect yet.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontSelector.cpp: Use script when getting font from Settings
(WebCore::fontDataForGenericFamily):
(WebCore::CSSFontSelector::getFontData):
* css/CSSPropertyNames.in: Increase priority of -webkit-locale since it affects font
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::styleForDocument):
(WebCore::CSSStyleSelector::applyDeclarations):
(WebCore::CSSStyleSelector::applyProperty): Set script in font based on -webkit-locale
* page/Settings.cpp:
(WebCore::getGenericFontFamilyForScript): Fallback to USCRIPT_COMMON
* platform/graphics/FontDescription.h: Add m_script
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::script):
(WebCore::FontDescription::setScript):
(WebCore::FontDescription::operator==):
* platform/text/LocaleToScriptMapping.h: Added.
* platform/text/LocaleToScriptMappingDefault.cpp: Added.
(WebCore::localeToScriptCodeForFontSelection):
(WebCore::LocaleScript::if):
(WebCore::LocaleScript::while):
* platform/text/LocaleToScriptMappingICU.cpp: Added.
(WebCore::scriptCodeForFontSelection):
(WebCore::localeToScriptCodeForFontSelection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/text/LocaleToScriptMapping.h [new file with mode: 0644]
Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp [new file with mode: 0644]
Source/WebCore/platform/text/LocaleToScriptMappingICU.cpp [new file with mode: 0644]