summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow_test.unitjs4
-rw-r--r--content/common/view_messages.h1
-rw-r--r--content/public/common/renderer_preferences.cc1
-rw-r--r--content/public/common/renderer_preferences.h2
-rw-r--r--content/renderer/render_view_linux.cc6
5 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow_test.unitjs b/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow_test.unitjs
index c0cedb5..ce87422 100644
--- a/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow_test.unitjs
+++ b/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow_test.unitjs
@@ -48,8 +48,10 @@ three
/**
* Test the get line of a multiline textarea with wrapping instead of
* explicit newlines.
+ * Test disabled due to not being reliable if font size changes.
+ * See https://codereview.chromium.org/549303004/
*/
-TEST_F('CvoxShadowUnitTest', 'MultilineWrap', function() {
+TEST_F('CvoxShadowUnitTest', 'DISABLED_MultilineWrap', function() {
this.loadDoc(function() {/*!
<div><textarea id="area"
cols=4 rows=20>One two thr fou fiv six sev eig</textarea>
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 415c314..cd34d14 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -289,6 +289,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::RendererPreferences)
IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_height_vertical_scroll_bar_in_dips)
IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_width_horizontal_scroll_bar_in_dips)
#endif
+ IPC_STRUCT_TRAITS_MEMBER(default_font_size)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(content::WebPluginGeometry)
diff --git a/content/public/common/renderer_preferences.cc b/content/public/common/renderer_preferences.cc
index 48a784d..57c259f 100644
--- a/content/public/common/renderer_preferences.cc
+++ b/content/public/common/renderer_preferences.cc
@@ -51,6 +51,7 @@ RendererPreferences::RendererPreferences()
arrow_bitmap_height_vertical_scroll_bar_in_dips(0),
arrow_bitmap_width_horizontal_scroll_bar_in_dips(0)
#endif
+ , default_font_size(0)
{}
RendererPreferences::~RendererPreferences() { }
diff --git a/content/public/common/renderer_preferences.h b/content/public/common/renderer_preferences.h
index 1a69081..aaee9d5 100644
--- a/content/public/common/renderer_preferences.h
+++ b/content/public/common/renderer_preferences.h
@@ -175,6 +175,8 @@ struct CONTENT_EXPORT RendererPreferences {
int32 arrow_bitmap_width_horizontal_scroll_bar_in_dips;
#endif
+ // The default font size used for rendering on Linux.
+ int default_font_size;
};
} // namespace content
diff --git a/content/renderer/render_view_linux.cc b/content/renderer/render_view_linux.cc
index 7f3ab8d..c3b6116 100644
--- a/content/renderer/render_view_linux.cc
+++ b/content/renderer/render_view_linux.cc
@@ -14,6 +14,8 @@ namespace content {
namespace {
+const int kMaxDefaultFontSize = 999;
+
SkPaint::Hinting RendererPreferencesToSkiaHinting(
const RendererPreferences& prefs) {
if (!prefs.should_antialias_text) {
@@ -62,6 +64,10 @@ void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() {
prefs.subpixel_rendering !=
gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning);
+ if (prefs.default_font_size > 0 &&
+ prefs.default_font_size <= kMaxDefaultFontSize) {
+ WebFontRendering::setDefaultFontSize(prefs.default_font_size);
+ }
}
} // namespace content