[Text Autosizing] Provide an API for influencing the font scale factor
authorpeter@chromium.org <peter@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2012 22:12:23 +0000 (22:12 +0000)
committerpeter@chromium.org <peter@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2012 22:12:23 +0000 (22:12 +0000)
commit626fbf5718941f0d1cc8a07cbc68f5cdc5b0c8ae
tree2d86fa7da5339aa0cdd1efe59d36b773217cc58c
parentb7616701b4b70be29e3035032359a0ed751d104b
[Text Autosizing] Provide an API for influencing the font scale factor
https://bugs.webkit.org/show_bug.cgi?id=92882

Reviewed by Adam Barth.

Source/WebCore:

Add the font scale factor to settings, and provide an API in
window.internal.settings to change it from layout tests.

The font scale factor applied to Text Autosizing influences the sizing
of text, and will influence the scaling of boosted blocks once the
implementation progresses. For Android, it will be set to the font size
chosen in the user's system-wide preferences.

Test: fast/text-autosizing/font-scale-factor.html

* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore):
(WebCore::Settings::setTextAutosizingFontScaleFactor):
* page/Settings.h:
(Settings):
(WebCore::Settings::textAutosizingFontScaleFactor):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processBlock):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTextAutosizingFontScaleFactor):
(WebCore):
* testing/InternalSettings.h:
(Backup):
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit/chromium:

Add an API to change Text Autosizing's font scale factor.

The font scale factor applied to Text Autosizing influences the sizing
of text, and will influence the scaling of boosted blocks once the
implementation progresses. For Android, it will be set to the font size
chosen in the user's system-wide preferences.

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setTextAutosizingFontScaleFactor):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

LayoutTests:

Add a basic test. More usable tests should be added later, as it's
really hard to test this accurately in this phase of the implementation,
and Text Autosizing is still subject to various bugs.

The font scale factor applied to Text Autosizing influences the sizing
of text, and will influence the scaling of boosted blocks once the
implementation progresses. For Android, it will be set to the font size
chosen in the user's system-wide preferences.

* fast/text-autosizing/font-scale-factor-expected.html: Added.
* fast/text-autosizing/font-scale-factor.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text-autosizing/font-scale-factor-expected.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/font-scale-factor.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/rendering/TextAutosizer.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h