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

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: Update expectations 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 01e791d9deefae29f7542053ed0731169f353ae5..569067ae32f954806e49539b0574454545fd921c 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -434,6 +434,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()) {
Erik Dahlström 2015/05/17 20:20:15 Under what circumstances can ordinaryPages be empt
pdr. 2015/05/19 02:02:29 I don't think it is possible to have ordinaryPages
+ Settings& defaultSettings = (*Page::ordinaryPages().begin())->settings();
Erik Dahlström 2015/05/17 20:20:15 This means svg images can get a different set of d
pdr. 2015/05/19 02:02:29 The defaults for these specific settings shouldn't
+ 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