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; |