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

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 1128143003: Set default SVG image font settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Page::ordinaryPages can be empty in tests (ImageResourceTest) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/custom/default-font-settings-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index 7091c0cc4998e97a9c4a3a633b0bddb4827d95db..edf144eb476899707ddb53f71ca610ab8bcbec71 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -427,6 +427,18 @@ bool SVGImage::dataChanged(bool allDataReceived)
page->settings().setScriptEnabled(false);
page->settings().setPluginsEnabled(false);
page->settings().setAcceleratedCompositingEnabled(false);
+
+ // Because this page is detached, it can't get default font settings
+ // from the embedder. Copy over font settings so we have sensible
+ // defaults. These settings are fixed and will not update if changed.
+ if (!Page::ordinaryPages().isEmpty()) {
+ Settings& defaultSettings = (*Page::ordinaryPages().begin())->settings();
+ page->settings().genericFontFamilySettings() = defaultSettings.genericFontFamilySettings();
+ page->settings().setMinimumFontSize(defaultSettings.minimumFontSize());
+ page->settings().setMinimumLogicalFontSize(defaultSettings.minimumLogicalFontSize());
+ page->settings().setDefaultFontSize(defaultSettings.defaultFontSize());
+ page->settings().setDefaultFixedFontSize(defaultSettings.defaultFixedFontSize());
+ }
}
RefPtrWillBeRawPtr<LocalFrame> frame = nullptr;
« no previous file with comments | « LayoutTests/svg/custom/default-font-settings-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698